HA
haneefm
Syncfusion Team
January 3, 2008 06:52 PM UTC
Hi Prabhjeet,
The GridStyleInfo.MaxLength properly is only used with the TextBox cell type.
For other cell types, you would have to handle things yourself. A straight-forward way of doing this is to handle the TableControlCurrentCellKeyPress event and set e.Inner.Handled if the current string is to long. Below is a code snippet.
private void gridGroupingControl1_TableControlCurrentCellKeyPress(object sender, GridTableControlKeyPressEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
if (cc.Renderer.ControlText.Length > 100)
{
e.Inner.Handled = true;
}
}
Let me know if something like this will not work for you.
Best regards,
Haneef