I want to show vertical grid lines in my win grid but i dont want to show horizontal lines
add the following class
private class NoRowBorders_DrawFilter : Infragistics.Win.IUIElementDrawFilter
{
public bool DrawElement(Infragistics.Win.DrawPhase drawPhase, ref Infragistics.Win.UIElementDrawParams drawParams)
try
switch (drawPhase)
case DrawPhase.BeforeDrawBorders:
return true;
case DrawPhase.AfterDrawElement:
CellUIElement aCellUIElement = (CellUIElement)drawParams.Element;
drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Right, Rectangle.Inflate(aCellUIElement.Rect, 0, 1));
}
return false;
catch (Exception ex)
public Infragistics.Win.DrawPhase GetPhasesToFilter(ref Infragistics.Win.UIElementDrawParams drawParams)
if (drawParams.Element is CellUIElement)
return DrawPhase.AfterDrawElement | DrawPhase.BeforeDrawBorders;
return DrawPhase.None;
and to use it :
GridItems.DrawFilter = new NoRowBorders_DrawFilter();
GridItems.DisplayLayout.Override.BorderStyleCell = Infragistics.Win.UIElementBorderStyle.None;
GridItems.DisplayLayout.Override.BorderStyleRow = Infragistics.Win.UIElementBorderStyle.None;
Hi
I have the same requirement to make only vertical lines for the columns of band(1) infragistics grid.And it is well working with above given code
drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Left, Rectangle.Inflate(aCellUIElement.Rect, 0, 1));
I am using the code to make borders at the left of each column.This is will borders at the left of each column and there won't be borders at the right of last column.The required behaviour is like there should be borders at the last column too.
Is there any possible way to know whether the cell element belongs to last coulmn of the grid?
Thanks,
Jithu
Thanks Hady,
Can you tell how to draw borders on contextMenuStrip item click by using this