6 Answers, 1 is accepted
0
Hi,
You can use our Select Column instead of GridViewCheckBox column. Please check this help article for a reference.
Regards,
Yoan
Telerik
You can use our Select Column instead of GridViewCheckBox column. Please check this help article for a reference.
Regards,
Yoan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Tijana
Top achievements
Rank 1
answered on 17 Oct 2014, 12:42 PM
Thank you, but Select colum is not what I'm looking for, because I need to bind data to it.
I have 3 boundable GridViewCheckBox columns in the same grid and I can allow user to check only one check box in each column.
Is there a way to do this with GridViewCheckBox column?
I have 3 boundable GridViewCheckBox columns in the same grid and I can allow user to check only one check box in each column.
Is there a way to do this with GridViewCheckBox column?
0
Hello,
Indeed, GridViewSelectColumn is bound internally to IsSelected property of GridViewRow. However, you can check this example which demonstrates how to bind GridViewRow's IsSelected property to a property of your business object. I believe that this will help you to achieve your requirement.
As a side note - Although GitHub is a very well-known platform we saw a better and easier approach for reviewing our examples developing our SDK Samples Browser. You can also use it to review the examples.
Regards,
Yoan
Telerik
Indeed, GridViewSelectColumn is bound internally to IsSelected property of GridViewRow. However, you can check this example which demonstrates how to bind GridViewRow's IsSelected property to a property of your business object. I believe that this will help you to achieve your requirement.
As a side note - Although GitHub is a very well-known platform we saw a better and easier approach for reviewing our examples developing our SDK Samples Browser. You can also use it to review the examples.
Regards,
Yoan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Tijana
Top achievements
Rank 1
answered on 17 Oct 2014, 01:49 PM
Problem is that I have 3 columns with checkboxes in the same grid.
If I use Select column, by selecting row, all 3 check boxes within this row will be checked and this is not my itention.
These 3 GridViewCheckBox columns are independent of each other.
On the other side I need to bind values from 3 columns, but I have the only one IsSelected property of GridViewRow.
Any suggestion from your side will be appreciated.
If I use Select column, by selecting row, all 3 check boxes within this row will be checked and this is not my itention.
These 3 GridViewCheckBox columns are independent of each other.
On the other side I need to bind values from 3 columns, but I have the only one IsSelected property of GridViewRow.
Any suggestion from your side will be appreciated.
0
Tijana
Top achievements
Rank 1
answered on 20 Oct 2014, 01:10 PM
Any news on this topic?
0
Hi,
You can try other approach - define a Checkbox in the CellEditTemplate of the column. Then you can use its Checked event and loop through the items and update the boolean property. Please check the following code snippet:
I hope this helps.
Regards,
Yoan
Telerik
You can try other approach - define a Checkbox in the CellEditTemplate of the column. Then you can use its Checked event and loop through the items and update the boolean property. Please check the following code snippet:
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding IsActive}"
>
<
telerik:GridViewDataColumn.CellEditTemplate
>
<
DataTemplate
>
<
CheckBox
IsChecked
=
"{Binding IsActive,Mode=TwoWay}"
Checked
=
"CheckBox_Checked"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellEditTemplate
>
</
telerik:GridViewDataColumn
>
.
.
.
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
foreach (var club in (this.clubsGrid.ItemsSource as ObservableCollection<
Club
>))
{
if (club.IsActive && club != (this.clubsGrid.SelectedItem as Club))
{
club.IsActive = false;
}
}
}
I hope this helps.
Regards,
Yoan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.