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.

GridGroupingControl Column - HtmlEncode

Thread ID:

Created:

Updated:

Platform:

Replies:

75360 Jul 23,2008 12:55 AM Jul 25,2008 08:21 AM ASP.NET Web Forms (Classic) 1
loading
Tags: GridGroupingControl
Kallyani Lanje
Asked On July 23, 2008 12:55 AM

Hi,
In GridGroupingControl, Is there any column properties for display the data in HtmlEncode format?.

Example in Gridview:


Thank you







Rajarajeswari S [Syncfusion]
Replied On July 25, 2008 08:21 AM


Hi Kallyani,

Thanks for using Syncfusion products.

In our GridGroupingControl an event called, “QueryCellStyleInfo” which will get raised, for each and every cell gets rendered. There we can make change the style attribute of each and every cell, including the CellValue.

Please refer the below code snippet where “HtmlEncode” is applied for a certain column.

protected void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell )
{
if (e.TableCellIdentity.Column.Name == "String")
{
string text = e.Style.CellValue.ToString();
e.Style.CellValue = Server.HtmlEncode(text);
}
}

}


Please refer the sample from the belwo link which illusatrtes this:

http://www.syncfusion.com/support/user/uploads/HtmlEncode_c7e05679.zip

Please have a look at the above and let me know if you have any other concerns.

Regards,
Raji



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.

;