Hi,
Is there an event or a virtual method in XamGrid that I can override in to check when a row has been added to the grid. I'm not referring to the newly added/adding rows, but those rows that get materialized when you set the Itemssource for the grid when the grid loads for example. The idea is that I need to some cell's control when that control has been loaded already. Something similar with InitializeRow, but in there, e.Row.Cells[0].Control == null. I need an event similar to this, but a bit later when the cell.Control != null. Is there a way to get there?
Hi Alin,
Sounds like you want to use the CellControlAttached event, which fires everytime a Control is attached to a cell or when the cell's value is changed when a control is already attached to that cell.
Out of curiosity, what exactly are you trying to do? As there might be a better way to achieve your functionality via ValueConverters and bindings.
-SteveZ
Thanks for your answer Steve.
I'm trying to add some very customized tooltips (my tooltips XAML are defined somewhere else) and also I'm using custom controls in the grid's cell inheriting TemplatedColumn and ColumnContentProviderBase.
Now in my ColumnContentProvider class I overridden ResolveEditorControl and ResolveDisplayControl and I was thinking to add to add tooltips to my custom control in one of these methods where I instanciate the control itself. But I need somehow to access the data of the current row/cell. The problem with this aproach was that these methods are not being called each time a row itself is added but rather on 'column adding'. I need somehow to get to the data object when it's created with the cell and its content itself so I can set its tooltip. Do you see another aproach?
Thanks.
If you're using 10.2 we actually introduced Tooltips into the XamGrid:
Here is a help article that explains how to take advantage of the feature
http://help.infragistics.com/NetAdvantage/Silverlight/2010.2/CLR4.0/?page=xamGrid_ToolTips.html
Note: that you can customize whats displayed in the Tooltip and you can bind to your data object directly.
Hope this helps.
Thanks again, I believe I'm on the right track using Tooltips as mentioned in your link as I'm using v10.2 of the controls, but I've got an issue with the tooltips when using a custom template for the tooltip that is UserControl and I hope you can help me out.
For example, I have a Usercontrol named DisplayUser in which I have a dependency property named UserID. Now, setting this control in a datatemplate for the Column's TooltipContentTemplate has no effect on my bound UserID property (I was expecting to get in the propertychanged callback method for the DP when hovering a cell):<DataTemplate> <local:DisplayUser UserID="{Binding ID}"/></DataTemplate>.
I set a breakpoint in the prop changed callback of the DP, but it doesn't get there (only in the constructor of this class when I hover the cell). I need somehow to retrieve the bound property's value (in my case ID's value from the model) whenever it shows the tooltip as I am doing some calculations with this value. If I use a simple textblock/label, of course I get the content of the tootlip displayed correctly, but not in the case of a custom UserContorl I made. Can you help me out with this one?
I'm not really sure, whats happening from what you're describing.
Is the tooltip displaying at all? If so, when you're debugging, are there any binding error messages being displayed in the output window when you display the tooltip over a cell?
Hello,
Yes, the tooltip is always displaying - no problem in here, but I don't have any binding issues in my output window for this case. I just don't receive the value from the model itself (as I mentioned I have a DP and a callback method with a breakpoint set) through binding, if I use a custom user control in the tooltips template. Is this an issue? Thanks
Sorry for the delayed response.
Do you have a sample that shows this issue that i can look at?
Thanks,-SteveZ