Articles in this section
Category / Section

How to hide the currentcell border in header cells?

1 min read

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

Showing hide the current cell border while click a header cell

C#

//Form1()
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;
      }
  }

 

VB

'Form1()
AddHandler 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
 

 

Screenshot

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 sign in to leave a comment
Access denied
Access denied