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. Image for the cookie policy date

How to check the entered value in current cell is either character value or integer value in gridgrouping control of syncfusion

Hi,
I am using Gridgrouping control.
I have Parent-Child Relationship in the control.
I want to change values in Quantity column


when i enter the characters in the cell of quantity column i want to give message please enter only integer value.
How to check the entered value in current cell is either character value or integer value


Thank you and Regards,
Supriya

1 Reply

MK Muthukumar Kalyanasundaram Syncfusion Team February 24, 2015 06:21 PM UTC

Hi Supriya,

 

Thank you for your interest in Syncfusion products.

 

If you want to check the entered value in currentcell is either character or integer value for particular column in a grid, you can use “TableControlCurrentCellEditingComplete” event. Please refer the below code,

 

Code:

this.gridGroupingControl1.TableControlCurrentCellEditingComplete += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlEventHandler(gridGroupingControl1_TableControlCurrentCellEditingComplete);

 

void gridGroupingControl1_TableControlCurrentCellEditingComplete(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlEventArgs e)

{

GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;

if (cc.ColIndex == 5) // check for particular column

{

string str = this.gridGroupingControl1.TableModel[cc.RowIndex, cc.ColIndex].Text;

int Num;

bool isNum = int.TryParse(str, out Num);

if (isNum) // integer value

MessageBox.Show("Integer Value as :" + Num.ToString());

else // character value

MessageBox.Show(" Enter integer value");

}

}

 

Please let us know if you have any concerns.

 

Regards,

Muthukumar K


Attachment: Check__Char_or_Number_value_d92fb609.zip

Loader.
Up arrow icon