Articles in this section
Category / Section

How to hide the currentcell border in header cells?

1 min read

In order to hide the current cell border while clicking on a HeaderCell, the DrawCurrentCellBorder event can be used. For better understanding, please refer to the image below.


Showing hide the current cell border while click a header cell


this.gridControl1.DrawCurrentCellBorder += new GridDrawCurrentCellBorderEventHandler(gridControl1_DrawCurrentCellBorder);

void gridControl1_DrawCurrentCellBorder(object sender, GridDrawCurrentCellBorderEventArgs e)
  {

     //Chekcing whether currentcell is header cell
     if (e.Style.CellType == "Header")
     {
          //Canceling the currentcell border
          e.Cancel = true;
      }
  }
AddHandler Me. gridControl1.DrawCurrentCellBorder, AddressOf gridControl1_DrawCurrentCellBorder
 
Private Sub gridControl1_DrawCurrentCellBorder(ByVal sender As Object, ByVal e As GridDrawCurrentCellBorderEventArgs)
      'Chekcing whether currentcell is header cell
      If e.Style.CellType Is "Header" Then
          'Canceling the currentcell border
          e.Cancel = True
      End If
End Sub

The screenshot below displays the cell without borders.


Showing unhide the current cell border



Sample:

CS: CurrentCell_Border_CS

VB: CurrentCell_Border_VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied