In the grid designer I have created 2 layouts and saved them while in the designer.
In the VB .net code how do I tell the grid to use one of the layouts I saved?
Something like this:
Me.UltraGrid1.DisplayLayout.Bands(0).RowLayouts("My Row Layout Name").Apply()
Coded this:
Grid1.SetDataBinding(Ds, Nothing, True) Grid1.DisplayLayout.Bands(0).RowLayouts("License").Apply()
Got this error:
{"Object reference not set to an instance of an object."} on the 2nd line for the rowlayouts.
Not sure what part of this is missing. If i take out the rowlayout line the grid loads as expected.
The layout "License" is in the designer code
What event is this code in?
Did you check to see if Grid1.DisplayLayout.Bands(0).RowLayouts("License") is null?
I have a sub "SetGrid" that loads the record set etc and sets the grid. The very first time the setgrid is call this works. The next time, it fails. Both time the rowlayout returns the same info:
?Grid1.DisplayLayout.Bands(0).RowLayouts("License"){Infragistics.Win.UltraWinGrid.RowLayout} CardView: False CardViewStyle: MergedLabels {0} ColumnInfos: {Infragistics.Win.UltraWinGrid.RowLayoutColumnInfosCollection} Disposed: False ForceApplyResources: Nothing Key: "License" RowLayoutLabelPosition: Default {0} RowLayoutLabelStyle: Separate {0} Tag: Nothing
Well, if the RowLayout is not null, then I don't know wha's causing the error.It might help if I could see the call stack.
If you don't already have it, you should try getting the latest Hot Fix and see if this is an issue that is already fixed.
If that does not help, I recommend that you create a small sample project demonstrating the error and Submit an incident to Infragistics Developer Support
Hi,
No, I don't think so. A RowLayout is not really a maintained settings, it's really just a process. The RowLayout properties are applied to the band. You could, after all, change the properties of the band after you apply a rowlayout and that does not affect the store RowLayout.
You can, of course, keep track of when you apply the RowLayout so you know which is the last one you applied. But that does not guarantee that the current layout has not changed.
Mike, is it possible to tell which RowLayout is currently applied? i.e determine whether a particular RowLayout is the currently applied RowLayout or not?