Hi there,
I'm using a ultrawingrid in one of my windows project and what's I'm trying to do is to be abled to freeze the fist two columns of the grid on a horizontal scroll. I use the following code :
e.Layout.Bands[0].Columns["hrpd_iNo"].Header.Fixed = true;
e.Layout.Bands[0].Columns["bxpd_xDesc"].Header.Fixed = true;
This code works only if I set the ultragridband's UseRowLayout property to false.
1) Is there a way to make this code works even if the UserRowLayout property is true?
2) I'm trying to export the same grid to EXCEL by using UltragridExcelExporter object; and my app juste freeze in the export() method.... Is it because I'm using the RowLayout in my grid also?
Thanks for your help,
Seraphin
umeninnovation said:1) Is there a way to make this code works even if the UserRowLayout property is true?
No. RowLayouts and Fixed headers are mutually exclusive. You can Submit a feature request to Infragistics
umeninnovation said:2) I'm trying to export the same grid to EXCEL by using UltragridExcelExporter object; and my app juste freeze in the export() method.... Is it because I'm using the RowLayout in my grid also?
No, you can export a grid using a RowLayout, that should not be a problem. I don't know why it's freezing on you. Are you using the latest Hot Fix? Can you duplicate the problem in a small sample project?
What if you have two fields in a group? Can you make the group fixed?
Yes. In fact, if you are using groups, then you can only fix groups, you cannot fix individual columns, since the columns have to stay in the group.
So how do you do it? I have 2 groups. I'd like to freeze one group( the first 4 columns) but that functionailty seems to conflict with using RowLayoutInfo to manage my column headers. Below is a pic of the header structure I want. The second pic shows the groups that I want. Notice the only run-time difference is the selection state of the Use Row Layout checkbox. I have seen hints and implications that this can be done, but no sample code. I can provide code for my example if it would help sort all of this out. Thx!
Pic 1: UseRowLayout = true; Column headers "stacked" a "visual" groups.
Pic 2: UseRowLayout = false; Columns correctly frozen, but lost the headers.
digitalwraith said:So how do you do it? I have 2 groups. I'd like to freeze one group( the first 4 columns) but that functionailty seems to conflict with using RowLayoutInfo to manage my column headers.
That's correct. RowLayouts and Fixed Header are mutually exclusive features. You cannot fix coumns or groups when using RowLayouts.
Perhaps you could use a ColScrollRegion, instead?
In your last comment, you seem to imply that I could fix the columns via grouping which is why I asked.
I'll look into ColScrollRegion.
Thx,
Ivan
Hi Ivan,
Sorry for the confusion. You can fix groups, but only in the standard mode, not in RowLayout mode.
My guess is that you are using CLR2 and these are new language features in CLR3/CLR4.
Cast<> should be LINQ. You could also try OfType<>. Both are in teh System.Linq namespace, the System.Core assembly.
Cast
http://msdn.microsoft.com/en-us/library/bb341406.aspx
OfType
http://msdn.microsoft.com/en-us/library/bb360913.aspx
Hopefully, that helps with part of your issue.
For the DataFormat: "The name 'DataFormat' does not exist in the current context"
And for: band.Columns.Cast<UltraGridColumn>()
Error 26 'Infragistics.Win.UltraWinGrid.ColumnsCollection' does not contain a definition for 'Cast' and the best extension method overload 'System.Data.EnumerableRowCollectionExtensions.Cast<TResult>(System.Data.EnumerableRowCollection)'...
What were the errors?
Ivan,
Thanks for that code snippet. I copied it into my code but got an error on the reference for DataFormat and 'band.Columns.Cast<UltraGridColumn>()'.
Hopefully this post is still active. Thanks in advance, Paul