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.
Unfortunately, activation email could not send to your email. Please try again.

MaskedEdit CellTypes and IncludeLiterals

Thread ID:

Created:

Updated:

Platform:

Replies:

70432 Dec 11,2007 07:38 AM Dec 13,2007 04:37 AM Windows Forms 2
loading
Tags: GridControl
Alexander Schlicht
Asked On December 11, 2007 07:38 AM

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


haneefm [Syncfusion]
Replied On December 11, 2007 03:55 PM

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


Alexander Schlicht
Replied On December 13, 2007 04:37 AM

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




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.

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.

;