Hi
I am just evaluating several grids for a new product but have run into a problem with the xamDataGrid.
From what I can see there is no RowDataBound (or equivalent) event in the xamDataGrid. I have seen some declaritive examples using triggers etc in the xaml code but I'm not sure that these will be a good approach for me.
I have a situation where I need to be able to update colors and text in the grid rows and cells based on some fairly complex conditional logic. I also need to be able to access the value of any field in the datasource for each row to gain the values needed for this logic. In addition I need to access and modify the value of unbound cells in the row.
In all other grids that I have used this was all easily accessible in the event args of a RowDataBound (or similar) event. I come from a Winforms/ASP.net background so I realise that things may not be that simple but I have seen this kind of event in othe WPF grids.
Apart from that I think that the xamDataGrid would serve my needs very well so I hope that someone can come up with a simple way that I can apply my logic in the C# codebehind.
Thanks Alan
Hello Alan,
The event you are looking is probably InitializeRecord. In this event, the record is created (bound). The DataRecord exposes a DataItem property, which is your underlying business class. It also exposes a Cells collection ( collection of all the cells in the record).
If you want to perform update on color,text etc on the CellValuePresenter (cells) you can use a converter (IValueConverter). Please follow the link below for an example on how to achieve that:
http://community.infragistics.com/forums/p/20644/74574.aspx#74574
You might also find helpful our helper methods Infragistics.Windows.Utilities.GetAncestorFromType/GetDescendantFromType which would help you go up/down the element tree very easily.
Please let me know if you have any more questions or need further assistance.
Hi Alex
Thanks very much for the very quick response. I couldn't see this event but I downloaded the Express version by mistake (I wanted to evaluate the whole suite) and there seemed to be a couple of other things missing also? Perhaps the express grid is a cut down version? Also I didn't install the service release. Anyway tonight I will download the full trial version and have another look as that sounds like exactly what I need. I presume I should have downloaded NetAdvantage for Win Client 2009 Vol. 1?
Regards
Alan
Yes, Alan.
The Express version is free to use/distribute, but it is only a subset of our control set (XamDataGrid, XamTextEditor and XamCheckEditor). The new features are not present in the Express version as well.
The trial version is for evaluation. It has all the controls with the full functionality. If you are evaluating, you should use the trial version.
The Service Release is not available for trial customers through the site, but we can provide it for you in our support system (link below).
If you have any more questions while evaluating our products, please feel free to ask here (in the forum) or in our support system here. We are always glad to help.