I have a grid on my page
When I click on a row in the grid it fires the OnSelectedIndexChanged
The problem is it claims nothing has been selected. when I jump over the code I can see the row get seledted and then deselected.
I am trying to set it up so that when the user clicks on a row in the grid it will take that data from the grid and populate some text boxes on the screen.
<telerik:RadGrid ID="RadGrid1" AllowFilteringByColumn="true" Skin="Vista" runat="server" EnableViewState="false" GridLines="None" |
AllowPaging="true" AllowSorting="true" PageSize="6" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged" > |
<AlternatingItemStyle BackColor="#EEEEEE"></AlternatingItemStyle> |
<ClientSettings EnablePostBackOnRowClick="true"> |
<Selecting AllowRowSelect="True"></Selecting> |
<ClientEvents OnCommand="RadGrid1_Command" /> |
</ClientSettings> |
<MasterTableView HierarchyLoadMode="Client" ClientDataKeyNames="DuplicateStatementID"> |
<Columns> |
<telerik:GridBoundColumn AllowFiltering="false" SortExpression="DuplicateStatementID" |
DataField="DuplicateStatementID" HeaderText="ID" DataType="System.Int32" Visible="false" /> |
<telerik:GridBoundColumn SortExpression="Year" DataField="Year" HeaderText="Year" UniqueName="RGYear"> |
<ItemStyle Width="50px" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn SortExpression="MonthName" DataField="MonthName" HeaderText="Month"> |
</Columns> |
</MasterTableView> |
<PagerStyle AlwaysVisible="true" /> |
</telerik:RadGrid> |
When I click on a row in the grid it fires the OnSelectedIndexChanged
protected void RadGrid1_SelectedIndexChanged(object sender, System.EventArgs e) |
{ |
GridDataItem item = RadGrid1.SelectedItems[0] as GridDataItem; |
string s = item["RGYear"].Text; |
} |
The problem is it claims nothing has been selected. when I jump over the code I can see the row get seledted and then deselected.
I am trying to set it up so that when the user clicks on a row in the grid it will take that data from the grid and populate some text boxes on the screen.