there are a number of little tweaks I would like to make to how a WinGrid looks, but I cannot figure out how to do them. Here is the screen shot of what I have so far:
Here is what I would like to change:
Band[0]
Band [1]
Hello,
This little boxes are the RowSelectors you can dispatch them with this property: ultraGrid1.DisplayLayout.Override.RowSelectors = DefaultableBoolean.False;
In order to make Name expand to the full width you can set this: ultraGrid1.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns; After which you can set the MIn/MaxWidth of # in order to prevent it from resizing
You can eliminate the space between the bands with: ultraGrid1.DisplayLayout.InterBandSpacing = 0;
There isn't a property that disables the whole band but one way to do this is like so:
private void ultraGrid1_AfterCellActivate(object sender, EventArgs e){ if (ultraGrid1.ActiveCell.Band.Index == 1) { //ultraGrid1.PerformAction(UltraGridAction.PrevCell); //ultraGrid1.ActiveCell = null; } }
private void ultraGrid1_AfterRowActivate(object sender, EventArgs e){ if (ultraGrid1.ActiveRow.Band.Index == 1) { //ultraGrid1.PerformAction(UltraGridAction.PrevRow); //ultraGrid1.ActiveRow = null; }}
Hope this helps.
Sincerely,
Petar Monov
Developer Support Engineer,
Infragistics, Inc
(Verify answer if satisfied)
Peter,
I assume that one must remove the comments from the two events :) If I understand the code snipets correctly, you are simply making the last row that was selected, selected again, and than removing the selection. Is there an issue of nothing was selected to begine with?
With respect to the ultraGrid1.DisplayLayout.InterBandSpacing = 0; It does what I want, except the black line at the top of the first row in a band[1] set and at the bottom of the same set doubles up the thickness. Is there any way to resolve that but still keep the lines when there is no band[0] under band[1]?
Sam
Hi Sam,
You need to remove the comment only from one of the rows in each event. I have simply given you two different approaches.
I can't actually understand which border is botherring you. Try out setting the row's Appearance.BorderColor property. If it doesnt help please send a ascrrenshot to help me understand.
Petar Monov"]I can't actually understand which border is botherring you. Try out setting the row's Appearance.BorderColor property. If it doesnt help please send a ascrrenshot to help me understand.
My pleasure:
(I just noticed something else, the very first row of Band[0] has it's top black line cut off by the headers "Index" and "Option", too)
You can chose which particular borders to visualize (left , top, right, bottom) by using IUIElementDrawFilter which is kinda a complicated. I suggest setting these proerties:
ultraGrid1.DisplayLayout.Override.BorderStyleCell = Infragistics.Win.UIElementBorderStyle.RaisedSoft;ultraGrid1.DisplayLayout.Override.RowAppearance.BorderColor = Color.White;ultraGrid1.DisplayLayout.Override.BorderStyleRow = Infragistics.Win.UIElementBorderStyle.None;
and you'll get:
Regards Petar.