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.

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 11:28 AM Dec 17,2006 11:18 PM Windows Forms 1
loading
Tags: GridControl
Vladymyr Olennykov
Asked On December 15, 2006 11:28 AM

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 17, 2006 11:18 PM

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.

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.

;