Skip to content

SyncfusionExamples/how-to-format-the-doubletextbox-cell-in-winforms-gridcontrol

Repository files navigation

How to Format the DoubleTextbox Cell in WinForms GridControl?

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.

GridControl with formatted DoubleTextbox

About

This example demonstates how to format the doubletextbox cell in winforms gridcontrol

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6

Languages