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

server-side selecting items by key values

3 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Roy
Top achievements
Rank 1
Roy asked on 05 Jul 2009, 06:17 AM
Hello all,

I've the following scenario:
i have a user options page. the options are in a data base table, and i have a connecting table between users and the options.
the page gets the user id, and loads all possible options from which the user should select.
the options are bound to a RadGrid, and i have a select column (CheckBox) where the selection is made.
problem is i want to select the option the user currently have on page load (or RadGrid databound).
is there a fast way i can give the grid the keys of the items i would like to select, or i need to check all items?

Good ideas are welcome...
Roy

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 08 Jul 2009, 09:29 AM
Hello Roy,

You can try to wire OnItemDataBound event and depending on some condition to chekc/uncheck the checkbox control. For further information how to get instance of the rendered control you can refer to this help article (you can use the same approach for the OnItemDataBound ).

Regards,
Georgi Krustev
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.
0
Roy
Top achievements
Rank 1
answered on 08 Jul 2009, 10:29 AM
The solution i've implemented was to wire up the OnDataBound Event, and run threw all items, checking them for the condition and selecting them.
I just thought there should probably be a better solution, like specifing the key values to select and that the grid will select them for you...
0
Georgi Krustev
Telerik team
answered on 09 Jul 2009, 04:45 PM
Hello Roy,

Thank you for contacting us.

Unfortunately the behavior you are trying to achieve is not possible. RadGrid does not provide such functionality. The easiest way to achieve your requirements is the suggested approach in my previous post.

Sincerely yours,
Georgi Krustev
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.
Tags
Grid
Asked by
Roy
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Roy
Top achievements
Rank 1
Share this question
or