GridView Row Details with show details only.

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

    Posted 12 Oct 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
    2 posts
    Member since:
    Sep 2016

    Posted 14 Oct 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. UI for WPF is Visual Studio 2017 Ready
  4. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 17 Oct 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"
                           grid:SelectiveScrollingGrid.SelectiveScrollingClip="True"
                           Margin="0 -25 0 0"                                          
                           Grid.Column="2"
                           Grid.ColumnSpan="2"
                           Grid.Row="1"
                           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.

    Regards,
    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