Get Column Name In CommentTipShowing

Hi.

I can get the name of the column of the selected cell in the QueryCellStyleInfo event through 
e.TableCellIdentity.Column.Name
but it does not work for event CommentTipShowing though I can see that it should work through
e.Style.TableCellIdentity.Column.Name.

Would you please tell me how to do that for event CommentTipShowing?

Many thanks.


2 Replies

PP Paulo P March 15, 2018 10:20 PM UTC

Hi again.

Just to tell that I was able to overcome the situation with
                GridTableCellStyleInfo style = myGrid.TableControl.Model[e.RowIndex, e.ColIndex];
                string colname = style.TableCellIdentity.Column.Name;
Not sure if this is the best way, but it works. 

Please let me know if you think there is a better solution.

Many thanks.



SN Sindhu Nagarajan Syncfusion Team March 16, 2018 11:57 AM UTC

Hi Paulo, 
 
Thanks for contacting Syncfusion support.  
 
 
Yes, you were right. If you want the column name in CommentTipShowing event, you can get the column name from GridStyleInfo. Also, you can get the column name using below suggestions. please make use of the below code, 
 
Code Example 
private void TableControl_CommentTipShowing(object sender, CommentTipShowingEventArgs e) 
{ 
     //Suggestion1 
     GridTableCellStyleInfo style = gridGroupingControl1.TableControl.GetTableViewStyleInfo (e.RowIndex, e.ColIndex); 
     string colname = style.TableCellIdentity.Column.Name; 
     //Suggestion2 
     int colIndex = this.gridGroupingControl1.TableDescriptor.ColIndexToField(e.ColIndex); 
     string name = this.gridGroupingControl1.TableDescriptor.Columns[colIndex].Name; 
} 
 
Please let us know if you have any other queries. 
 
Regards, 
Sindhu  


Loader.
Up arrow icon