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

Change cell value on load

Thread ID:





99457 May 22,2011 10:30 AM UTC May 23,2011 08:35 AM UTC ASP.NET Web Forms (Classic) 1
Tags: GridGroupingControl
Asked On May 22, 2011 10:30 AM UTC


I am loading my data in GrdiGroupingControl which is working fine. However, in one of the columns I would like to trim the values when the page loads. somthing like below:

if the actual value from database is: ABCD:EFGH, then i would like to display only EFGH.

Could you please advice how to do this?


Sridhar N [Syncfusion]
Replied On May 23, 2011 08:35 AM UTC

Hi Navin,

Thanks for your interest in Syncfusion products.

Query #1"Change cell value on load"

Your requirement can be achieved by changing the value of cell using CellValue in QueryCellStyleInfo event. Please refer the below code snippet.

[Codebehind - C#]

void ggc_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
if (e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell)
if (e.TableCellIdentity.Column.MappingName == "Group")
string cellval = e.Style.CellValue.ToString();
// Trim the value.
cellval = cellval.TrimStart('A');
cellval = cellval.TrimStart('B');
cellval = cellval.TrimStart('C');
cellval = cellval.TrimStart('D');
cellval = cellval.TrimStart(':');
//Change the value using CellValue
e.Style.CellValue = cellval;

For your convenience, we have created sample and the same can be downloaded from the following link.


Please let me know if you have any other questions or concerns.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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