I am trying to accomplish this through the CellsInViewChanged event using c#, not xaml. Any advice available?
Hello Ron,
Thank you for your post. I have been looking into and I can suggest you see these forum thread:
http://www.infragistics.com/community/forums/t/16353.aspx
and
http://www.infragistics.com/community/forums/t/71407.aspx
http://www.infragistics.com/community/forums/p/29229/125266.aspx
where it is discussed how to add different tooltips in the XamDataGrid. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Can you propose a solution for doing this in code through the CellsInViewChanged event? I tried using CellValuePresenter.FromCell(c).ToolTip, but that didn't work for me.
Hello,
You can iterate the Cells like this:
foreach (var r in e.CurrentCellsInView[0].Records) { foreach (var f in e.CurrentCellsInView[0].Fields) { CellValuePresenter.FromRecordAndField(r as DataRecord, f).ToolTip = "My text"; } }
Please let me know if this helps you or you need further assistance on this matter.
That is essentially what I was doing. I don't get any tooltips in the grid. Could I have them disabled somehow?
I created a sample project for you using the approach I suggested you and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Yes, I am setting cvp.ToolTip, no problems - but, it is not being displayed. Could something else in the grid be overriding the cvp and cause the tooltips to not show?
Solved. Here is the solution that I used:
ToolTipService.SetIsEnabled(cvp, true);
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Hi Stefan, the example you provided doesn't work for the case when I change the underlying type of the datatable item from typeof(int) to typeof(object). Can you please advise?
Thanks,
Chinh
Hello Chinh,
I have modified the sample, so now it has objects and the tooltip seems to work on my side. If the sample doesn’t satisfies your needs, feel free to modify it, so it reproduces your behavior and send it back to us, so we could be able to investigate it further for you.