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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can I get cell type(int64, short, string for example) from GridGrouping Control event TableControlCurrentCellErrorMessage

Thread ID:

Created:

Updated:

Platform:

Replies:

53570 Dec 15,2006 04:28 PM UTC Dec 18,2006 04:18 AM UTC WinForms 1
loading
Tags: GridControl
Vladymyr Olennykov
Asked On December 15, 2006 04:28 PM UTC

I try
//--
private void _gridGrouping_TableControlCurrentCellErrorMessage(object sender, GridTableControlCurrentCellErrorMessageEventArgs e)
{
private void _gridGrouping_TableControlCurrentCellErrorMessage(object sender, GridTableControlCurrentCellErrorMessageEventArgs e)
{
GridTableControl gridTableControl = _gridGrouping.GetTableControl("GENERIC_ITEM");

Type cellType = gridTableControl.CurrentCell.Renderer.CurrentStyle.CellValueType;
string errMessage = GetCellErrorMessage(e.TableControl.CurrentCell, cellType.GetType());

if (errMessage.Length > 0)
{
e.Inner.Cancel = true;
MessageBox.Show(errMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
e.Inner.Cancel = false;
}

}

I try but my table controls in my GridGroupingControl variable

Administrator [Syncfusion]
Replied On December 18, 2006 04:18 AM UTC

Hi Vladymyr,

Use the Style.CellValueType property to get the type of the cell values in a Grid. Here is a below code snippet to show this.

private void grid_TableControlCurrentCellErrorMessage(object sender, GridTableControlCurrentCellErrorMessageEventArgs e)
{
//Get the CurrentCell value type in a grid.
GridCurrentCell cc = e.TableControl.CurrentCell;
GridStyleInfo style = cc.Renderer.CurrentStyle;
Type type = style.CellValueType as Type;
e.Inner.Cancel = true;
MessageBox.Show("CurrentCell Type : " + type.ToString() , "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}

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.

Warning Icon 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.Close Icon

;