I have a Rad Grid with an Button Column on it. When I click on the button I want to pull specific values from the row that the button is on.
The code I do that with is as follows...
Here's the issue: If I don't touch the table, everything works fine. If I drag a column up to the top bar to group, or move columns around, the "column" number remains the same, but e.Item.Cells is using the new format of the table, and, if I use "column" as my indexer, I'm getting something random. (Usually nbsp;)
Could someone demonstrate how to do what I want to do?
Thanks!!
The code I do that with is as follows...
| protected void RadGrid2_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) |
| { |
| if (e.CommandName == "MyCommand") |
| { |
| RadGrid MyGrid = (RadGrid)source; |
| int column = MyGrid.Columns.FindByDataField("ID").OrderIndex |
| string MyID = e.Item.Cells[column].Text; |
| //DO STUFF |
| } |
| } |
Here's the issue: If I don't touch the table, everything works fine. If I drag a column up to the top bar to group, or move columns around, the "column" number remains the same, but e.Item.Cells is using the new format of the table, and, if I use "column" as my indexer, I'm getting something random. (Usually nbsp;)
Could someone demonstrate how to do what I want to do?
Thanks!!