Hi,
I want to hide the header seperator between columns. Please see the image for more information.
I want to remove this divider. Please reply. Thanks in advance.
It's impossible for me to guess how to remove that line without knowing what property settings you are using in order to achieve the look you have here.
It looks like you have set UseOsThemes to false, but that by itself would not explain why there is no border at the top of the column headers or why the dividing line doesn't go all the way to the top.
It's probably some combination of HeaderStyle and BorderStyleHeader and possibly some other properties that you have set. Or maybe you got this by loading a Style Library (isl) file?
These are my grid layout settings:
layout.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset; // gives nice border layout.ScrollBounds = ScrollBounds.ScrollToFill; // scrolls so bottom is end layout.ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle.Immediate; // immediate scroll layout.Override.AllowDelete = DefaultableBoolean.False; // disables user input layout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.True; layout.BorderStyle = Infragistics.Win.UIElementBorderStyle.None; layout.Override.BorderStyleHeader = Infragistics.Win.UIElementBorderStyle.Solid;
layout.Override.HeaderAppearance.BorderColor = System.Drawing.Color.Black; // set up header layout.Override.HeaderAppearance.TextHAlign = HAlign.Center; layout.Override.HeaderAppearance.TextVAlign = VAlign.Middle; layout.Override.HeaderAppearance.BackColor = System.Drawing.Color.White; layout.Override.HeaderStyle = HeaderStyle.Standard;
layout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False; layout.Override.ActiveRowAppearance.BackColor = Color.White; // White selected row layout.Override.ActiveRowAppearance.ForeColor = Color.Black; // Selected and non seleted should be same layout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.None; layout.Override.SelectTypeCol = Infragistics.Win.UltraWinGrid.SelectType.None; layout.Override.HeaderAppearance.BackColor = Color.White; layout.Override.HeaderAppearance.ForeColor = Color.Black; layout.Override.HeaderAppearance.BackColor2 = Color.White; layout.Override.CellClickAction = CellClickAction.RowSelect; // when user clicks grid then row is selected. layout.Override.AllowColSwapping = Infragistics.Win.UltraWinGrid.AllowColSwapping.NotAllowed; layout.Override.AllowColSizing = Infragistics.Win.UltraWinGrid.AllowColSizing.None; layout.Override.AllowColMoving = Infragistics.Win.UltraWinGrid.AllowColMoving.NotAllowed; layout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
Hope this gives a idea Mike???
I copied this code into the InitializeLayout event of a grid and I'm not getting the same results as you show in your screen shot here. In mine, I get a solid border on all 4 sides of the headers and also all 4 sides of the cells. I am attaching a screen shot here.
Are you sure you are not also loading a Style Library in your application?
Are you trying to only remove the divider line from the headers? Or do you want no vertical borders in between the cells, also?
Hi Mike .. Thanks for the replies.. I was able to resove the issue.. This was the code i used:
//Draw grid header line
e)
{
Infragistics.Win.
));
)
System.Drawing.
;
try
grayPen =
.Gray);
headerRect = uie.Rect;
(headerRect.X, headerRect.Bottom);
(left.X + headerRect.Width, left.Y);
e.Graphics.DrawLine(grayPen, left.X, left.Y, right.X, right.Y);
}
finally
grayPen.Dispose();
//End of inner if condition
//End of Outer if Condition
// End of Method
Hope this helps anybody!!!!
If this question is urgent, then please answer my questions so I can help you.
Without knowing exactly what is causing that line and what you want to remove, it's really hard for me to help you. There are an infinite variety of ways your grid could be set up and how you remove those lines depends on why they are there in the first place.
You might be able to do this with property settings like BorderStyleHeader. Setting this to None will remove all of the borders for the column headers, but that may depend on the HeaderStyle and whether or not you are using themes.
Even if it's not possible to get what you want using grid properties, you could certainly achieve what you want using a DrawFilter.
In my simple sample project which I attached above, I was able to get this to work with a DrawFilter like so:
public class MyDrawFilter : IUIElementDrawFilter { #region IUIElementDrawFilter Members bool IUIElementDrawFilter.DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams) { // Draw the header borders excluding the right and left. Border3DSide border3DSide = drawParams.Element.BorderSides & ~(Border3DSide.Left | Border3DSide.Right); drawParams.DrawBorders(drawParams.Element.BorderStyle, border3DSide); // Return true to tell the grid not to draw the borders. return true; } DrawPhase IUIElementDrawFilter.GetPhasesToFilter(ref UIElementDrawParams drawParams) { HeaderUIElement headerUIElement = drawParams.Element as HeaderUIElement; if (headerUIElement != null && headerUIElement.Header is Infragistics.Win.UltraWinGrid.ColumnHeader) { return DrawPhase.BeforeDrawBorders; } return DrawPhase.None; } #endregion }
You assign the DrawFilter to the grid like this:
this.ultraGrid1.DrawFilter = new MyDrawFilter();
I want to remove only the divider line Mike .. PLz help.. I am stuck and its urgent :(