Search code examples
vb.netwinformsdevexpress-windows-ui

devexpress bandedgridview thick border around band in paint event , scrollbar issue


I am using devexpress bandedgridview in windows forms , I wanted to create thick borders around band in bandedgridview, from following links I used solution for this

https://www.devexpress.com/Support/Center/Question/Details/Q339033/bandedgridview-thick-vertical-lines

https://www.devexpress.com/Support/Center/Question/Details/T446766/how-to-set-a-thicker-left-border-of-an-entire-column

In paint event I am drawing verical lines its working , Problem is When I am scrolling columns vertical lines are appearing.

When I scroll columns get hide but vertical lines are still appearing.

How can I skip drawing vertical line in paint event if I am scrolling?


Solution

  • First band in Grid is having FixedStyle property value FixedStyle.Left So, I checked if bounds.Left of next band columns is intersecting with bounds.Right of the first fixed left band rectangle, I skip drawing vertical lines when checkIntersectBand is true

      checkIntersectBand  = CType(IIf((fixedLeftBand.Bounds.Right - bandInfo.Bounds.Left) >= 0, True, False), Boolean)