This is a migrated thread and some comments may be shown as answers.

[Solved] Binding checkbox type cells in RadGridView with dynamic number of columns - any ideas?

1 Answer 116 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Geoff Davis
Top achievements
Rank 1
Geoff Davis asked on 29 Oct 2010, 11:58 PM
Could you point us to any existing code or suggest if this hasn't been done before?

We have dynamically loaded the columns. The 1st column acts as a header column and rest of the columns are check box columns. Also, we have header row and rest of the rows are dynamically loaded. The check box columns establishes relationship between the header row and header column (like in matrix table). We would like to implement this in a RadGridView.

We have tried three things so far -

1. GridViewSelectColumn - but it doesn't have DatamemberBinding property to which we can bind to our property in DataContext

2 .GridViewDataColumn - but that requires defining the Datatemplate with control CheckBox withing it ( all under Resources section). Problem is that resources section we were not able to retrieve the column index property so that we could bind the isChecked (of Check box control) to desired property in Datacontext (which is array of boolean values). Our datacontext is Observable collection of Class which itself contains array of boolean values for the columns. Can we do a 2D binding of RadGridView :) ??

3. Use GridViewDataColumn but do not define any Datatemplate under resources and directly bind the property to value of GridViewDataColumn - this automatically built the check boxes within for each column and row. Problem here is the clunky behavior of the check box. The check box responds only to double click. That is, double clicking the check box puts the grid cell in to edit mode and then the check box value can be changed

Any suggestions?

1 Answer, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 01 Nov 2010, 09:42 AM
Hi,

 Why not create your own custom column, override CreateCellElement and create/bind the CheckBox there? You can check this blog post for more info about custom columns. 

Greetings,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Geoff Davis
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or