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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cell Formatting, Forumal Cells, Check Box Cells

Thread ID:

Created:

Updated:

Platform:

Replies:

26916 Apr 4,2005 09:38 AM UTC Apr 4,2005 10:25 AM UTC WinForms 1
loading
Tags: GridControl
Nick Zdunic
Asked On April 4, 2005 09:38 AM UTC

Hi, 1. I have a column using a formula cell. When the cell has focus, the formula appears. How can I stop this occurring. Only the value should ever be displayed. 2. Another column is formatted a checkbox column. Is there some way to have the graphic appear as a green tick when checked, and when unchecked a red cross. Thanks, Nick

Administrator [Syncfusion]
Replied On April 4, 2005 10:25 AM UTC

1) Try handling the CurrentCellStartEditing event and cancel it if it is a FormulaCell.
private void gridControl1_CurrentCellStartEditing(object sender, CancelEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	
	if(this.gridControl1[cc.RowIndex, cc.ColIndex].CellType == "FormulaCell")
	{
		e.Cancel = true;
	}
}
2) The grid either uses the Themed DrawCheckBox or the ControlPaint.DrawCheckBox to draw its checkboxes, so there is no property setting that will allow you to swap out the bitmaps. But there are several ways you can draw your own. One is to derive the CheckBox celltype and override the renderer.DrawCheckBox. Then you could draw what you want. Another option that does not require deriving a cell type would be to handle the DrawCell event. In your handler, you could test e.Style.CellType == "CheckBox" and then draw what you want for the CheckBox setting e.Cancel = true to prevent the grid from overdrawing your work.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;