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 to get row type?

Thread ID:

Created:

Updated:

Platform:

Replies:

118127 Feb 3,2015 08:51 AM Feb 5,2015 04:45 AM Windows Forms 3
loading
Tags: GridGroupingControl
Ramin Alirezaee
Asked On February 3, 2015 08:51 AM

Hi.
I want to get current type of selected row.
for example in CurrentCellStartEditing event, I want to allow editing in filter row and cancel editing when row type is normal.
thanks.

Neelakandan Kannan [Syncfusion]
Replied On February 4, 2015 12:36 PM

Hi Ramin,

 

Thank you for using Syncfusion products.

 

If you want to restrict the cell editing when CurrentCellStartEditing event, you can enable Cancel property based on your condition. Please make use of below code,

 

Code Snippet:

void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)

{

if (style.TableCellIdentity.TableCellType != GridTableCellType.FilterBarCell)

{

If(//Specify your needed condition)

{

e.Inner.Cancel = true;

}

else

{

e.Inner.Cancel = false;

}

}

}

 

Please let me know if you have any concerns.

 

Regards,

Neelakandan


Ramin Alirezaee
Replied On February 4, 2015 05:19 PM

Hi.
Thanks for your attention.
Everything is Okay.
There was only one problem, style was not declared.
I've added the following line to the first line of your code.

GridTableCellStyleInfo style = this.gridGroupingControl1.Table.GetTableCellStyle(e.TableControl.CurrentCell.RowIndex, e.TableControl.CurrentCell.ColIndex);

Thank you.

Neelakandan Kannan [Syncfusion]
Replied On February 5, 2015 04:45 AM

Hi Ramin,

Regret for the inconvenience caused.

You can get style of the current cell by using GetTableViewStyleInfo method. Please make use of below code,

Code Snippet:

void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)

{

GridTableCellStyleInfo style = this.gridGroupingControl1.TableControl.GetTableViewStyleInfo(e.TableControl.CurrentCell.RowIndex, e.TableControl.CurrentCell.ColIndex);

if (style.TableCellIdentity.TableCellType != GridTableCellType.FilterBarCell)

{

e.Inner.Cancel = true;

}

else

{

e.Inner.Cancel = false;

}

}

Please let me know if you have any concerns.

Regards,

Neelakandan



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.

;