Permanently displayed DetailsPresenter

7 posts, 1 answers
  1. Leos
    Leos avatar
    57 posts
    Member since:
    Jul 2010

    Posted 23 Aug 2010 Link to this post

    Hello,
    I use RadGridView with DetailsPresenter together and I want to have DetailsPresent permanently displayed, even if no row is selected or datasource is empty (displayed controls can be empty and non editable in this case).
    Thank you very much.
    Leos
    WPF Q2 2010 SP1
  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 24 Aug 2010 Link to this post

    Hello Leos,

    Setting RowDetailsVisibilityMode to Visible will show all details.


    Regards,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Leos
    Leos avatar
    57 posts
    Member since:
    Jul 2010

    Posted 24 Aug 2010 Link to this post

    No, this is not solution for me, it displays Detail for ALL rows and in grid.

    To be clear, this is example of my form.
    Part #1 (Detail of Invoice) is DetailsPresenter (defined by DataTemplate).
    Part #2 (All invoices) is RadGridView.
    When NO DATA in GridView I need to see EMPTY Detail.
    -- DETAIL OF INVOICE --------------------------#1-
     Number:  [    ]
    Company:  [                          ]
       Date:  [  .  .  ]
    -- ALL INVOICES -------------------------------#2-
    Number  |   Company                 | Date
    --------+---------------------------+-------------
    --------+---------------------------+-------------
    Selected record count:0
  5. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 24 Aug 2010 Link to this post

    Hi Leos,

    Just to be sure that I have understood you correctly. You have an external DetailsPresenter which displayer details data and you would like this presenter to display some sort of NoDatatemplate when the grid has no data or no row is selected?


    All the best,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Leos
    Leos avatar
    57 posts
    Member since:
    Jul 2010

    Posted 24 Aug 2010 Link to this post

    Probably yes.
    Here is other way with same result, without DetailsPresenter. So something similar but with DetailsPresenter ( if possible ).

    <DockPanel>
      <Grid DockPanel.Dock="Top" DataContext="{Binding CurrentItem, ElementName=radGridView1}">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="100"/>
          <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition/>
          <RowDefinition/>
          <RowDefinition/>
          <RowDefinition/>
        </Grid.RowDefinitions>
        <Label Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Content="DETAIL"/>
        <Label Grid.Column="0" Grid.Row="1" Content="Reg:"/>
        <TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Registrace, Mode=TwoWay}"/>
        <Label Grid.Column="0" Grid.Row="2" Content="Type:"/>
        <TextBox Grid.Column="1" Grid.Row="2" Text="{Binding Typ, Mode=TwoWay}"/>
        <Separator Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3" Height="10"/>
      </Grid>
      <telerik:RadGridView Name="radGridView1"  ItemsSource="{Binding Repo}" IsSynchronizedWithCurrentItem="True"  />
    </DockPanel>
  7. Answer
    Milan
    Admin
    Milan avatar
    1989 posts

    Posted 25 Aug 2010 Link to this post

    Hello Leos,

    In this case it would be best to use some kind of custom UserControl to show the details data. I have attached a sample project to demonstrate this approach - it is very similar to what you have done but I have isolated the UI of the details into a separate UserControl.


    Sincerely yours,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Jonx
    Jonx avatar
    258 posts
    Member since:
    Jul 2012

    Posted 23 Jun 2011 Link to this post

    Hello Milan,

    The problem with your solution is that you lose the possibility to use the RowDetailsTemplateSelector which is very important to me.
    I do not want to have to handle that logic by myself.

    So the best way would be to make that the RowDetailsTemplateSelector gets evaluates also when no item is selected so that I can get a null in my selector and return and empty template or even better, provide me an EmptyTemplate in the DetailsPresenter.

    By the way it would be very nice to get a simple panel control that let me use a template selector on it... this would be usefull each time I have to display different types in the same panel...

    So what I need is a way to add some text to the default DetailsPresenter soo thta when nothing is selected in the grid that my text displays...

    Thank you for your help,
    John.
Back to Top
UI for WPF is Visual Studio 2017 Ready