Just finished writing a piece of code that would save and restore grid field positions and widths. Yes, I know they have a function for that, but it saves and loads everything as a blob, while we want to have more control.
Infragistics is marvelous, just marvelous. For appetizer, the first column will proudly ignore your attempts to programmatically move it unless you set property FieldLayoutSettings.AutoArrangePrimaryFieldReservation
to “None”. Well, this should be obvious to anyone, shouldn’t it? But at least this one is documented.
If you want to catch when field width is updated, it’s not the Width
property that gets changed – that would be to easy. It’s LabelWidthResolved
and CellWidthResolved
, With an added bonus that when you get a PropertyChanged
notification on “LabelWidthResolved
“, it has not actually changed yet (unless you are trying to debug it with some break points – then it works perfectly). Then you receive a property changed notification on “CellWidthResolved
” and find that both values have changed now. So, it looks like that PropertyChanged
on “LabelWidthResolved
” is sent before the value is actually updated, and then the value is updated somehow asynchronously in the background. Welcome to doing it Infragistics style, synchronous property change notifications are for wimps!
And, by the way, if you try to read all this stuff too early in the grid lifecycle it will come up with all the data, but compeltely headerless. No column headers, just like that. That’s not a typo – it’s enough to read something from the grid in order to break it.
This all happens in a small prototype application that I wrote, not in some kind of monster app where you can blame other components for messing up things. Unfortunately, I cannot share the sample in its original form, as it contains some references to proprietary data. Removing those is not rocket science, but I have other things to attend to.
Bottom line: Infragistics gives you a great tool to quickly write an impressive grid, but then you get stuck with the bugs like that. Just wanted to record it in case I have to explain to someone why exactly I think that Infragistics WPF grid is buggy.
UPD: XamDataGrid version 11.2.2125 for .NET 4 (InfragisticsWPF4.v11.2.dll)