GridView Row Details with show details only.

3 posts, 0 answers
  1. Dale
    Dale avatar
    6 posts
    Member since:
    Sep 2016

    Posted 12 Oct 2016 Link to this post

    We would like to click a row and show only the DETAILS row, not the "original" row.  Please see attached files for clarity.

    The main idea here is "Less is More". I don't want essentially 2 rows of information when I select a particular row.

    If the user exits the DETAILS row (either by clicking another row or activates another window) then the row returns back to its normal state.

    Thanks in advance!!!

  2. Dale
    Dale avatar
    6 posts
    Member since:
    Sep 2016

    Posted 14 Oct 2016 Link to this post

    Basically, we'd like to know if we can do (or make it look like) the radgridview_OnRowClick_after.png image.
  3. Stefan Nenchev
    Stefan Nenchev avatar
    665 posts

    Posted 17 Oct 2016 Link to this post

    Hello Dale,

    Thank you for the pictures provided.

    In order to achieve the desired behavior, you need to alter the ControlTemplate of the GridViewRow element up to your needs. Generally, the RowDetails are contained within the DetailsPresenter labeled  "PART_DetailsPresenter". What I did in a sample project at my end is set a negative margin that equals the height of the row. This way, the Details will hide the row and the behavior will be achieved. The standard height of the row is 25, so you can apply the following change:

    <grid:DetailsPresenter x:Name="PART_DetailsPresenter"
                           Margin="0 -25 0 0"                                          
                           DetailsProvider="{TemplateBinding DetailsProvider}"/>

    I have attached the sample application for your reference. Please try selecting an item once you start it. Of course, as I am not sure of your specific setup, you might need to further customize the template so that it fits your exact requirement.

    Please update me whether the approach suits your needs.

    Stefan Nenchev
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top