Hi, I'm having a problem with that event when a column is out of margins. When event fires, cell.Control is null.
I need to access data from a custom control inside cell when cell is selected, but also i need to know what cells are selected because user can select multiple cells.
Problem comes using left and right arrows keys, and cell is out of the visible area.
I don't want to lose the navigation with keys between cells.
How can i solve this?
I've attached an example to clarify.And I'm working with XamGrid 11.1.20111.2115.
Thanks in advance.Adrian.
Hi,
This behaviour that you see, the .Control being null is expected. This happens because when a cell is out of view it's being virtualized. You can read more about the virtualization of the XamGrid in this article - http://help.infragistics.com/NetAdvantage/Silverlight/2011.2/CLR4.0/?page=SL_xamGrid_Virtualization.html
If you need to access the value of the cell you can use Value property of the cell.
HTH
Thanks for answer Nikolay.
I didn't know about virtualization, i will read it.
I have an Entity with many properties binded to every row and a custom control within in a template column for each cell. That custom control process many properties of the entity and exposes results to dependency properties.I need to read those dependency properties when a cell (or cells) is selected.
In the example i've attached, i've simplified the template column to just a textblock.
Is there a way to deactivate virtualization?
Thank you.
Ok... I figured out how to disable XamGrid Virtualization...
http://help.infragistics.com/NetAdvantage/Silverlight/2011.2/CLR4.0/?page=SL_xamGrid_Virtualization.html
On that link says:
Disabling Virtualization
Virtualization is always on when you set the Height and Width properties of xamGrid or its containing element. If xamGrid does not have a width set, that is, if the control does not have a width and its parent container allows its width to be infinite then xamGrid will not virtualize cells during horizontal scrolling. An example is if xamGrid was inside a horizontal Stack Panel or a Scroll Viewer. Similarly, if the control has no height, such as when it is in a vertical Stack Panel or Scroll Viewer with no height, xamGrid will not virtualize cells and rows during vertical scrolling.
So i put the xamgrid inside a scrollviewer.That solve my problem.
Thank you again Nikolay.You can close this thread.