I would like to implement a grid where the columns appear only once in one of two ColScrollRegions:
Col 1,2 in ColScrollRegion0 and Col 3, in ColScrollRegion1.
Belonging to some former post I have to set the column header ExclusiveColScrollRegion property to the desired ColScrollRegion.
But it doesn't work: the col 1-3 appear still in both ColScrollRegions and the ExclusiveColScrollRegion property remains null after assignment.
Here is the code
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
{
.....
UltraGridLayout layout = e.Layout;
ColScrollRegion colScrollRegion2 = new ColScrollRegion(1);
layout.ColScrollRegions.Add(colScrollRegion2);
UltraGridBand band = layout.Bands[0];
band.Columns[0].Header.ExclusiveColScrollRegion = layout.ColScrollRegions[0];
band.Columns[1].Header.ExclusiveColScrollRegion = layout.ColScrollRegions[0];
band.Columns[2].Header.ExclusiveColScrollRegion = layout.ColScrollRegions[1];
....
}
Whats wrong, thanks for a hint.
kagel
What do you mean by: "the ExclusiveColScrollRegion property remains null after assignment."
Are you saying that you are setting this property and then examining the value immediately after you set it and it's returning null? I have no explanation for that and I've never heard of anything like that happening before. Maybe something else in your code is removing the ColScrollRegions and then re-adding them later on.
My best guess is that something that is happening in your code after this code is executed must be blowing these settings away. Maybe you are loading a layout into the grid?
Frankly, ColScrollRegions are something of an obsolete concept, anyway. This functionality was essentially replace by fixed headers.
Hi Mike,
>>>Are you saying that you are setting this property and then examining the value immediately after you set it and it's returning null?
exactly, I mean that the Property ExclusiveColScrollRegion shouldn't be null after it has been set to something which isn't null ???
col.Header.ExclusiveColScrollRegion = e.Layout.ColScrollRegions[0]; >>> ColScrollRegions[0] != null, ExclusiveColScrollRegion = null after this line !???
That sounds strange. If the Property ExclusiveColScrollRegion wouldn't have a setter the compiler would tell it to me.
Anyway, you can set what ever you want but ExclusiveColScrollRegion is always null.
The code snippet I found in the net regarding ExclusiveColScrollRegion seem to work, and are similar, why ?
>>>Maybe something else in your code is removing the ColScrollRegions and then re-adding them later on
Indeed it could be, but I find it strange that the ExclusiveColScrollRegion is not set before, and I reckon thats the unique reason why later the column appears twice as if nothing had been done regarding the ExclusiveColScrollRegion
>>> Frankly, ColScrollRegions are something of an obsolete concept, anyway:
If used the fixed header feature before in my user controls, but be want now to switch to this colscrollregion feature because we are looking for a feature to display the column in the distinct scrollable regions. Thats why we checked out the ColScrollRegions.
We don't think the feature is completely obsolete,
I beleieve the fixed headers has not exactly the same purpose, and can't be taken as "successor" of ColScrollRegions
Can you provide a tiny code snippet using ColScrollRegions that works well, (Something like, two ColScrollRegions, one column in each region ?) maybe I missed a detail ?
Thanks
Kagel
Hi Kagel,
I took a look at the ExclusiveColScrollRegion property and it will return null if you are using RowLayouts because ExclusiveColScrollRegion is not supported in RowLayout Mode.
Are you setting RowLayoutStyle to ColumnLayout or GroupLayout?
The property will also return null if you are using AutoFitStyle or the band is set to display in CardView.
indeed I suspect something like this. Unfortunately
in my code sample I have set
1 ColumnLayout
2 no cardview
3 no autofitstyle
Are there other proerties which could lead to a ExclusiveColScrollRegion = null?
Best regards
Hi,
Those are the only three that would cause the property to return null.
Just in case it's not clear, the ColumnLayout is what's causing it in this case. ExclusiveColScrollRegions are not support when using RowLayouts. So that means ColumnLayout or GroupLayout.