Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
175
Custom scrolling tooltip
posted

Hi,

I know grid can show field value while scrolling (IsScrollTipField) in tooltip. I am wondering if grid can show more than just field value. As example, my grid contains market orders and I would like to display let say order side, target shares and symbol all in tooltip. These fields are all presented in the grid in separate columns.

Something like -

Symbol: IBM

Side: BUY

Target: 1000

Could someone point me to right direction how to do this?

Thank you.

Michael

Parents
No Data
Reply
  • 54937
    Offline posted

    The simplest way would be to create an field that contains the concatenated information and set that as the ScrollTipField for the FieldLayout. An alternative approach, assuming that this is a flat datasource, would be to use a custom datatemplate for the RecordScrollTipInfo. e.g. Add something like the following to your DataPresenter's Resources

    <HierarchicalDataTemplate 
     DataType="{x:Type igDP:RecordScrollTipInfo}"
     ItemsSource="{Binding Path=Children}">
     <HierarchicalDataTemplate.Resources>
      <DataTemplate DataType="{x:Type igDP:DataRecord}">
       <Grid>
        <Grid.ColumnDefinitions>
         <ColumnDefinition />
         <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
         <RowDefinition Height="Auto" />
         <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <!-- name field -->
        <ContentPresenter
         Grid.Row="0" Grid.Column="0"
         TextBlock.FontWeight="Bold"
         VerticalAlignment="Center"
         ContentStringFormat="{}{0}:"
         Content="{Binding Path=FieldLayout.Fields[name].Label}"
         />
        <igDP:CellValuePresenter
         Grid.Row="0" Grid.Column="1"
         Padding="0"
         Margin="0"
         BorderThickness="0"
         Field="{Binding Path=FieldLayout.Fields[name]}"/>

        <!-- email field -->
        <ContentPresenter
         Grid.Row="1" Grid.Column="0"
         TextBlock.FontWeight="Bold"
         VerticalAlignment="Center"
         ContentStringFormat="{}{0}:"
         Content="{Binding Path=FieldLayout.Fields[email].Label}"
         />
        <igDP:CellValuePresenter
         Grid.Row="1" Grid.Column="1"
         Padding="0"
         Margin="0"
         BorderThickness="0"
         Field="{Binding Path=FieldLayout.Fields[email]}"/>
       </Grid>
      </DataTemplate>
      <DataTemplate DataType="{x:Type igDP:GroupByRecord}">
       <TextBlock Text="{Binding Path=Description}" Margin="0,3"/>
      </DataTemplate>
      <DataTemplate DataType="{x:Type igDP:ExpandableFieldRecord}">
       <TextBlock Text="{Binding Path=Description}" Margin="0,3"/>
      </DataTemplate>
      <!--SSP 6/7/08 BR33580 - Added SummaryRecord data template-->
      <DataTemplate DataType="{x:Type igDP:SummaryRecord}">
       <TextBlock Text="{Binding Path=Description}" Margin="0,3"/>
      </DataTemplate>
     </HierarchicalDataTemplate.Resources>
     <ContentControl Content="{Binding Path=Record}"/>
    </HierarchicalDataTemplate>

Children