如果我想更新记录,则在单击“网格"中的排序时,id会更改. [英] If I want to update the record the id is getting changed when I click on sorting in Grid.
问题描述
大家好,
这是我的实际网格.
ID武术状态性别
编辑101个单身女性
编辑102个单身男性
编辑103已婚男性
编辑104个单身女性
在单击编辑"按钮之前,我已经对军事状态"进行了排序.因此,记录会像这样更改,
ID武术状态性别
编辑103已婚男性
编辑104个单身女性
编辑101个单身女性
编辑102个单身男性
所以现在我想编辑103条记录,但它却得到101条记录,
ID武术状态性别
更新取消101单身女性
编辑102个单身男性
编辑103已婚男性
编辑104个单身女性
那么,出了什么问题以及如何解决此问题????
预先感谢,
VenkiDesai.
Hi All,
This is my actual grid.
ID Martial Status Gender
Edit 101 Single Female
Edit 102 Single Male
Edit 103 Married Male
Edit 104 Single Female
Before clicking on edit button I did sorting on "Martial Status".So records are changed like this,
ID Martial Status Gender
Edit 103 Married Male
Edit 104 Single Female
Edit 101 Single Female
Edit 102 Single Male
So now I want to edit 103 record but it gets 101 record like this,
ID Martial Status Gender
Update Cancel 101 Single Female
Edit 102 Single Male
Edit 103 Married Male
Edit 104 Single Female
So what went wrong & how to solve this issue????
Thanks in advance,
VenkiDesai.
推荐答案
您可以显示网格项索引,而不是将原始ID显示为
<%#(Container.DataItemIndex)+ 1%>
You can show grid Item Index instead of showing original Id as
<%# (Container.DataItemIndex) + 1%>
在行编辑中调用了排序功能,行取消了编辑和更新.
这样问题就解决了.
Called the sorting function in row editing,row cancel edit & updating.
So issue solved.
这篇关于如果我想更新记录,则在单击“网格"中的排序时,id会更改.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!