I have an application with RadGridView and a button, on of the columns of the Grid contains a check box (not binding to any data).
i want to loop through all the rows of the grid on the button click event and check of the check box is check and show a message with a field of the data in the same row, please tell me how to do this.
thank you
7 Answers, 1 is accepted
You can find small example attached.
All the best,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

actualy I am using VB.NET, and I tried to write the same code in VB.NET and I got an error (below is my button click event):
Dim GridRows As IList(Of GridViewRow) = RadGridView1.ChildrenOfType(Of GridViewRow)()
For Each r As GridViewRow In GridRows
If Not (TypeOf r Is GridViewNewRow) AndAlso Not (TypeOf r Is GridViewHeaderRow) Then
' MessageBox.Show(CType(r.FindName("chk"), CheckBox).IsChecked.ToString)
End If
Next
the error location is yellow highlited, the error message is: (Expression of type 'Telerik.Windows.Controls.GridView.GridViewRow' can never be of type 'Telerik.Windows.Controls.GridView.GridViewHeaderRow')can you please tell me if i have a problem somewhere.
also when i tried to write the XAML file as in your example i got an error also (yellow highlited)
<telerik:GridViewColumn>
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox />
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewColumn>
the error message is: the attached property CellTemplate was not found in type GridViewColumn, so i wrote the XAML like this:
<telerik:GridViewDataColumn HeaderText="check me" Width="Auto">
<telerik:GridViewColumn.CellStyle>
<Style TargetType="telerik:GridViewCell">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="telerik:GridViewCell">
<CheckBox Name="chk"></CheckBox>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:GridViewColumn.CellStyle>
</telerik:GridViewDataColumn>
it is working now but can you please tell me what is the problem in the previous code.
Thank you
Do you have our latest version? CellTemplate is available since Q1 2009.
Regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

I removed the references from my project and added a refrences to the DLL files from your projects and it is worked (the XAML file only) but the code behind error (VB.NET error) is still.
My mistake! You can remove GridViewHeaderRow check.
Greetings,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

The best approach is to loop through all data item and update their properties. If the data object implement INotifyPropertyChanged, and they should, the UI will be updated automatically.
You can easily loop through all items using RadGridView's Items property:
foreach
(var item
in
this
.playersGrid.Items)
{
var mydataItem = item
as
MyDataItemType;
mydataItem.Property1 =
"NewValue"
;
}
Greetings,
Milan
the Telerik team