MaskedEdit CellTypes and IncludeLiterals

Hallo!

I have a Problem with MaskedEdit Cells.
I use the Propertie ClipMode= IncludeLiterals and a Mask like "99-999" but only the Style Text Propertie (not the Control Value) has includes Literals (Text="12-345" Value="12345"). I want to store include Literals in the DataTable, any idee for this problem?

best regards
Alexander


2 Replies

HA haneefm Syncfusion Team December 11, 2007 08:55 PM UTC

Hi Alexander,

One way you can do this by handling the Model.SaveCellInfo event of the grid and set the CellValue using the e.Style.Text property. Below are the codes:

this.gridDataBoundGrid1.Model.SaveCellInfo += new GridSaveCellInfoEventHandler(Model_SaveCellInfo);

private bool FakeSaveCellInfoEvent = false;
void Model_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e)
{
if ( !FakeSaveCellInfoEvent && e.Style.CellType == GridCellTypeName.MaskEdit)
{
FakeSaveCellInfoEvent = true;
this.gridDataBoundGrid1.Model[e.RowIndex, e.ColIndex].CellValue = e.Style.Text;
FakeSaveCellInfoEvent = false;
}
}

Best regards,
Haneef



AS Alexander Schlicht December 13, 2007 09:37 AM UTC

Hi Haneef,

hey this works nice!

Thanks for your help,
Alexander

>Hi Alexander,

One way you can do this by handling the Model.SaveCellInfo event of the grid and set the CellValue using the e.Style.Text property. Below are the codes:

this.gridDataBoundGrid1.Model.SaveCellInfo += new GridSaveCellInfoEventHandler(Model_SaveCellInfo);

private bool FakeSaveCellInfoEvent = false;
void Model_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e)
{
if ( !FakeSaveCellInfoEvent && e.Style.CellType == GridCellTypeName.MaskEdit)
{
FakeSaveCellInfoEvent = true;
this.gridDataBoundGrid1.Model[e.RowIndex, e.ColIndex].CellValue = e.Style.Text;
FakeSaveCellInfoEvent = false;
}
}

Best regards,
Haneef




Loader.
Up arrow icon