In RadGrid1_InfrastructureExporting function , I m not able to apply styling on partial text of a particular cell.
Ex - if cell[1,1] = hello world. How to make "hello" as bold.
1 Answer, 1 is accepted
0
Vessy
Telerik team
answered on 31 Jan 2020, 08:02 AM
Hi Ananya,
The InfrastructureExporting function you can style the whole cell content, but the easiest way to style part of the cell text is to use a template column, exporting it to XLX file with a similar setup:
protectedvoidRadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
(sender as RadGrid).DataSource = GetData();
}
private DataTable GetData()
{
DataTable dt = new DataTable();
dt.Columns.Add("Id");
dt.Columns.Add("ProductName");
dt.Columns.Add("Count");
for (int i = 0; i < 15; i++)
{
dt.Rows.Add("Id_" + i, "Product name " + i, i + 400);
}
return dt;
}
Please, give solution a try and let us know should we can help you any further on this matter.
Regards,
Vessy
Progress Telerik
Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers.Learn More.