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

Need to view DetailsPresenter without affecting my row selection.

2 Answers 133 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rajani
Top achievements
Rank 1
Rajani asked on 07 Mar 2013, 11:01 PM
Hi,
I am using a RadGridView and using a DetailsPresenter to present the row details externally. I also have a GridViewSelectColumn to display the checkbox for each row selected which also provide me a Header checkbox out of the box for select/unselect all. 

Now here is my problem. I need to select a row to view the details in the detailPresenter but on doing this the selection checkbox state is toggled. What I want is to be able to move through my rows to view the details without actually doing a selection. I tried using the GridViewCheckboxColumn which works well, however its missing the header checkbox.

Here is what I want to achieve:
1) Have a column with checkbox that the user can check/uncheck to select a row .. the column should also have a checkbox header which will help with select/unselect all rows.
2) Navigate through the rows to view details in the details presenter without affecting my selection checkbox state.

Can you please suggest the best way to achieve this functionality?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Rossen Hristov
Telerik team
answered on 08 Mar 2013, 09:46 AM
Hello,

The best option would be to not use a DetailsPresenter at all. After all the DetailsPresenter is a simple empty rectangle which you fill with UI based on the RowDetailsTemplate. You can easily do this without using the Row Details feature at all, since your details will be outside of RadGridView.

Simply take everything that you have defined inside the RowDetailsTemplate and create an user control out of it. Then set the DataContext of this user control to be the CurrentItem of RadGridView with ElementName Binding. When the user moves around the current item in the grid, because of the Binding the DataContext of your user control will change to be the respective data item (i.e. business object). Since the UI elements inside your user control will be data-bound to the properties of your business object, when the CurrentItem of the grid changes (i.e. this is the business object) your UI elements inside the control will update accrodingly.

This is a general WPF Binding technique. More about WPF Data Binding you can learn here.

I hope this helps.

Kind regards,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rajani
Top achievements
Rank 1
answered on 21 Mar 2013, 06:52 AM
Thank you for your response .. We will be implementing this by creating  a separate user control as you suggested.
Tags
GridView
Asked by
Rajani
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Rajani
Top achievements
Rank 1
Share this question
or