This example demonstrates how to format the doubletextbox cell in WinForms GridControl.
By default, the value "0" will be displayed as "0.00" in the DoubleTextBox cell. To customize the display format of cell value, use the DisplayText property in DrawCellDisplayText event.
//Event Subscription
gridControl1.DrawCellDisplayText += GridControl1_DrawCellDisplayText;
//Event Customization
private void GridControl1_DrawCellDisplayText(object sender, GridDrawCellDisplayTextEventArgs e)
{
if(e.Style.CellType== CustomCellTypes.DoubleTextBox.ToString() && e.DisplayText== "0.00")
{
e.DisplayText = "0";
}
}The screenshot below illustrates the format of grid cells.
