This issue occurs occasionally, not always, so before I post code, here's the essence of the issue:
I have a RadGrid displaying customer name and address data. If I filter by address ("Starts With"), and attempt to edit one of the filtered rows, I might find myself editing the next row in the table instead of the one I clicked on.
Some information that might be related:
- the most recent occurrence happened when the two customers (the one I clicked on and the one for whom I was presented the edit control) both had the same name. I had filtered by address, "starts with", on the first three characters of the address.
- the two customers in this case were the next to last and last on the page (the grid is set to page, not scroll through the entire dataset)
- on subsequent refreshes of the page, the order in which these two customers were presented changes. Their addresses are different, but the first three characters (my filter criteria) were the same.
- when debugging, I could see that in the ItemCommand event, e.Item.ItemIndex was pointing to the fourth row (the one I intended to change), but e.Item.OwnerTableView.DataKeyValues[e.Item.Index][" my customer key as defined for the grid "] was giving me the ID of the fifth row - the row it gave me to edit.
Has anyone else seen this and is there a solution? I can post code if necessary.
Ben
I have a RadGrid displaying customer name and address data. If I filter by address ("Starts With"), and attempt to edit one of the filtered rows, I might find myself editing the next row in the table instead of the one I clicked on.
Some information that might be related:
- the most recent occurrence happened when the two customers (the one I clicked on and the one for whom I was presented the edit control) both had the same name. I had filtered by address, "starts with", on the first three characters of the address.
- the two customers in this case were the next to last and last on the page (the grid is set to page, not scroll through the entire dataset)
- on subsequent refreshes of the page, the order in which these two customers were presented changes. Their addresses are different, but the first three characters (my filter criteria) were the same.
- when debugging, I could see that in the ItemCommand event, e.Item.ItemIndex was pointing to the fourth row (the one I intended to change), but e.Item.OwnerTableView.DataKeyValues[e.Item.Index][" my customer key as defined for the grid "] was giving me the ID of the fifth row - the row it gave me to edit.
Has anyone else seen this and is there a solution? I can post code if necessary.
Ben