Instead of tooltip with 2 lines i see hint of mouse roll over. Can someone help me plz? Bindings can only be done in codebehind
XAML- Grid.Resources
xaml.cs
private void SetStyle() { Style _rightAlignedstyle = CreateOpenOrderStyle($"{nameof(DataRecord.DataItem)}.{nameof(RIViewModel.Node)}", (Style)_grid.TryFindResource("CellValuePresenterStyle")); _grid.FieldLayouts[0].Fields[4].Settings.CellValuePresenterStyle = _rightAlignedstyle; }
private Style CreateOpenOrderStyle(string node_, Style basedon_) {
var _RMTooltip = (ToolTip)_grid.TryFindResource("RMTooltip") Style style = new Style { TargetType = typeof(CellValuePresenter), BasedOn = basedon_ };var stackPanel_ = (Panel)_RMTooltip.Content;
var children_ = stackPanel_.Children; if (children_.Count == 2) { var descriptionTxtBlock = (TextBlock)children_[0]; descriptionTxtBlock.SetBinding(TextBlock.TextProperty, new Binding($"{node_}.{nameof(INode.Description)}")); var settleTxtBlock = (TextBlock)children_[1]; settleTxtBlock.SetBinding(TextBlock.TextProperty, new Binding($"{node_}.{nameof(INode.TradePx)}")); }
style.Setters.Add(new Setter(CellValuePresenter.ToolTipProperty, _RMTooltip)); return style; }
Hello Anupreet,
Thank you for contacting Infragistics. I've attached a small sample that demonstrates how to setup and bind a tooltip per cell in code-behind for the XamDataGrid. Please review it and modify it accordingly to demonstrate the issue you are having.
Please use the link to download the sample:
https://filetransfer.infragistics.com/public.php?service=files&t=6526e8069f857075a850baa6222da5ea
Let me know if you have any questions.