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

Grouping grid - FormatCellText

Thread ID:

Created:

Updated:

Platform:

Replies:

26502 Mar 23,2005 06:59 PM UTC Mar 23,2005 11:34 PM UTC WinForms 1
loading
Tags: Grouping
Shipra Gupta
Asked On March 23, 2005 06:59 PM UTC

Hello, I am using the following code in Format Cell Text event handler, to change the text of the cell depending on the column index. This code has a problem if the user moves the columns around and the column index changes. How can I get the column name? I couldn''t find any function in the help. Thanks Shipra public void Scenario_FormatCellText(object sender, GridCellTextEventArgs e) { if(e.Style.CellIdentity.ColIndex == 2) { if(e.Style.Text == "1") { e.Text = "True"; e.Handled = true; } }

Administrator [Syncfusion]
Replied On March 23, 2005 11:34 PM UTC

Try casting the style to a GridTableCellStyleInfo. Then you can access the column name to test for a particular column by name instead of column position. GridTableCellStyleInfo style = e.Style as GridTableCellStyleInfo; Console.WriteLine(style.TableCellIdentity.Column.MappingName);

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

;