We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Cell Buttons

Hi - I'm attemting to implement cell buttons in the way that the CellButtons sample does, with the exception that my derived cell renderer inherits from GridStaticCellRenderer, not GridTextBoxCellRenderer (I made this choice because I only want a button in the cell, no text, but I'm open to suggestions). It works for the most part, except that I want the area inside the cell but outside the bounds of the button (i.e. the area in your example where the words "Browse me" appear) to be inert - i.e. not give the cell focus when clicked. Currently when I click in this area, the cell becomes current, with the single pixel black focus rectangle. I've added e.Style.ReadOnly = True to the code for Public Overrides Sub OnPrepareViewStyleInfo of my derived GridTextBoxCellRenderer, but to no avail, and I didn't want to set ShowCurrentCellBorderBehavior for the whole grid, just this column of buttons. Any ideas? Thanks

1 Reply

AD Administrator Syncfusion Team November 19, 2002 05:05 PM

You can try handling the DrawCurrentCellBorder event and cancel it if the cell is your button.
private void gridControl1_DrawCurrentCellBorder(object sender, GridDrawCurrentCellBorderEventArgs e)
{
	if(gridControl1[e.RowIndex, e.ColIndex].CellType == "EllipsisText")
		e.Cancel = true;
}

Loader.
Live Chat Icon For mobile
Up arrow icon