Latest members | More ...
Hi, I am adding one Checkbox control in datagrid. I want to find this control in code behind? My Source code: <DataGrid Background="White" Height="262" Name="GrvTrade" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" > <DataGrid.Columns> <DataGridTemplateColumn> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <CheckBox x:Name="chkstatus" Click="chkstatus_Click" Checked="chkstatus_Checked" IsChecked="{Binding Path = ForDisplay , Mode = TwoWay}"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> <DataGridTextColumn Binding="{Binding Path=Name}" Header="Name"/> </DataGrid.Columns> </DataGrid> Thanks, Venkatesh.P
// Iterates through the rows of the GridView control foreach (GridViewRow row in GrvTrade.Rows) { // Selects the checked items from the gridview CheckBox chkstatus= ((CheckBox )row.FindControl("chkstatus")); if(chkstatus.Checked) { // do what ever you want }
Venkatesh, if this helps please login to Mark As Answer. | Reply | Alert Moderator
Write New Post | More ...