This is a migrated thread and some comments may be shown as answers.

Export to Word Problem....

4 Answers 30 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
raaj
Top achievements
Rank 1
raaj asked on 12 May 2010, 12:46 PM
Team,

Screetshot is Attached, I just want to remove the underline from first and second column. Also I want to change the font color to black.
Pls. help me.

Thanks
Rajesh n.

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 12 May 2010, 01:53 PM
Hello Rajesh,

I recommend you set ExportOnlyData="true" to remove the hyperlinks. You can then apply underline (text-decoration: underline) style to the header cells of the desired columns - see below:

As to the background color, please examine the following link:
Word/Excel export (HTML-based) (Using ItemCreated/ItemDataBound section)

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Princy
Top achievements
Rank 2
answered on 12 May 2010, 01:57 PM
Hi Rajesh,

Try the following code snippet in order to format the exported data.

C#:
 
    protected void Button1_Click(object sender, EventArgs e) 
    { 
        GridHeaderItem headerItem = (GridHeaderItem)RadGrid1.MasterTableView.GetItems(GridItemType.Header)[0]; 
        headerItem.Style.Add("text-decoration""underline"); 
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            item.Style.Add("color""red"); 
        }         
        RadGrid1.MasterTableView.ExportToWord(); 
    } 


Also go through the following documentation on customizing the exported file.
Word/Excel export (HTML-based)

Thanks,
Princy.
0
raaj
Top achievements
Rank 1
answered on 12 May 2010, 02:50 PM
Thank a lot Team. Since am new to this controls. am posting lots of questions to you.
I'm wondering about your support at once.

Thanks once again

Rajesh n.
0
raaj
Top achievements
Rank 1
answered on 12 May 2010, 03:02 PM
Princy,

It's not removing the underlines from Header and first 2 columns. further not changing color too. but rest of the datas except first and second columns colors are changing.. Pls. give me some other help.

thanks
Rajesh N.
Tags
General Discussions
Asked by
raaj
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Princy
Top achievements
Rank 2
raaj
Top achievements
Rank 1
Share this question
or