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
1750
MouseEnter on Group Header
posted

Hello community!

Via searching I found this nice thread http://ko.infragistics.com/community/forums/t/42130.aspx concerning the mouse hover on data row. Great and simple example, Thank you Stefan.

I have the requirement to group my data in the xamdatagrid. If the mouse enters the group header, I should show an image.

I modified the example from stefan, and added a property by which the data could be grouped.
Best would be, if I do not only get the group header information but at least one of the gorup childs.

Which style must be set in the resources?
Thank you for the information.

MouseEnterOnGroupHeader.rar
Parents
  • 1750
    Verified Answer
    Offline posted

    Hello again!

    With the help of this thread http://ko.infragistics.com/community/forums/t/80062.aspx I found the final solution.

    I added a style to the XAML file where the grouped data is shown and modified the Tooltip property.

    <Style TargetType="{x:Type igWPF:GroupByRecordPresenter}">
      <Setter Property="ToolTip" >
       
    <Setter.Value>
         
    <StackPanel Orientation="Vertical">
           
    <Label Content="{Binding Converter={StaticResource GroupToolTipConv}}" />
           
    <Image Source="{Binding Converter={StaticResource GroupToolTipImageConverter}}" />
         
    </StackPanel>
        
    </Setter.Value>
      </Setter>
    </Style>

    If someone still needs the MouseEnter Event on the group header just add the following to your the GroupByRecordPresenter Style

    <EventSetter Event="MouseEnter" Handler="DataRecordPresenterGroup_MouseEnter" />

    And in the code behind file

    void DataRecordPresenterGroup_MouseEnter(object sender, MouseEventArgs e)

    {

       GroupByRecordPresenter groupPresenter = sender as GroupByRecordPresenter;

       if (groupPresenter.DataContext != null)

          {

         GroupByRecord rec = groupPresenter.DataContext as GroupByRecord;

         if (rec.HasChildren)

              {

           if (rec.ChildRecords.Count > 0)

                  {

             var x = ((rec.ChildRecords[0] as DataRecord).DataItem) as ChartData;

                  }

              }

         }

    }

    Attached please find the complete solution.

    MouseEnterOnGroupHeaderPictureInTooltip.rar
Reply Children
No Data