Need to view DetailsPresenter without affecting my row selection.

3 posts, 1 answers
  1. Rajani
    Rajani avatar
    14 posts
    Member since:
    Feb 2013

    Posted 07 Mar 2013 Link to this post

    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?

  2. Answer
    Rossen Hristov
    Rossen Hristov avatar
    2478 posts

    Posted 08 Mar 2013 Link to this post


    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.

  3. Rajani
    Rajani avatar
    14 posts
    Member since:
    Feb 2013

    Posted 21 Mar 2013 Link to this post

    Thank you for your response .. We will be implementing this by creating  a separate user control as you suggested.
Back to Top