سؤال

I already know how to set the tooltip for a XamDataGrid using a style, e.g.:

<Style TargetType={x:Type ig:DataRecordCellArea>...

However, for a specific reason (don't have time to explain it all), I really need to invoke the tooltip programmatically, preferably hooked to a MouseOver event.

I would really appreciate it if someone could illustrate the way. What have I done so far? Not much, because the Infragistics site is full of XAML examples and doesn't offer any guidance on doing this programmatically (except for one trivial cell-level tooltip example).

هل كانت مفيدة؟

المحلول

<XamlDataGrid MouseEnter="XamlDataGridMouseEnter"/>

private void XamlDataGridMouseEnter(object Sender, MouseEventArgs e)
{
    ToolTipService.SetIsEnabled((XamlDataGrid)Sender, true);
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top