Hi Tuan,
Thank you for your interest in Syncfusion products.
If
you want to validate the user input for Int32 in a grid, you can use the ‘Int32.TryParse()’ method. It Converts
the string representation of a number to its 32-bit signed integer equivalent. Please
refer the below code,
Code Snippet[C#]:-
this.gridGroupingControl1.TableModel[5, 3].CellType = GridCellTypeName.TextBox;
this.gridGroupingControl1.TableModel[5,
3].Text = "123456789012";
String
s = (this.gridGroupingControl1.TableModel[5,
3].Text).ToString();
int
count = s.Length;
String
sd = this.gridGroupingControl1.TableModel[5,
3].Text;
int
number2;
bool
result = Int32.TryParse(this.gridGroupingControl1.TableModel[5, 3].Text, out number2);
if(result
== false)
{
for(int i = count-1 ;i > 9 ;i--)
{
sd = sd.Remove(i);
this.gridGroupingControl1.TableModel[5,
3].Text = sd;
}
MessageBox.Show("Not enter more than Int32 Value");
}
this.gridGroupingControl1.TableDescriptor.Columns["I3"].Appearance.AnyRecordFieldCell.MaxLength
= sd.Length;
Please let us know if you have any concern.
Regards,
Muthukumar K
Attachment:
setMaxValue_19aa960b.zip