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

List of elements for styling RadGrid

3 Answers 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
DragonBall
Top achievements
Rank 1
DragonBall asked on 16 Jan 2009, 01:00 PM
Can anybody help me the list of elemets for styling the Radgrid e.g. (color,text-align,background-color)

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 16 Jan 2009, 01:01 PM
Hi Manuel,

Please be a little more specific - what are you trying to do?

Best wishes,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
DragonBall
Top achievements
Rank 1
answered on 17 Jan 2009, 12:55 AM

i will use it for radgrid export to pdf. the styles are the one that i needed.

e.g.

 item.Style["font-size"] = "8pt";
item.Style["font-family"] = "Cursive";
item.Style["color"] = "brown";
item.Style["background-color"] = "white";
item.Style["height"] = "30px";

0
Shinu
Top achievements
Rank 2
answered on 19 Jan 2009, 05:49 AM
Hi Manuel,

Hope you trying to export Grid to PDF with styles applied. If so try the following approach and see if it is helpful.

ASPX:
 <CommandItemTemplate> 
        <asp:Button ID="Button1" runat="server"   CommandName="Export" OnClick="Button1_Click" Text="Button" /> 
   </CommandItemTemplate> 

CS:
  bool isPdfExport = false
    protected void Button1_Click(object sender, EventArgs e) 
    { 
        RadGrid1.ExportSettings.OpenInNewWindow = true
        RadGrid1.ExportSettings.IgnorePaging = true
        RadGrid1.MasterTableView.ExportToPdf(); 
    } 
    
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName =="Export"
        { 
            isPdfExport = true
            RadGrid1.ExportSettings.IgnorePaging = true
        } 
    } 
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (isPdfExport && e.Item is GridDataItem) 
        { 
            GridDataItem Item = (GridDataItem)e.Item; 
 
            Item.Style["font-size"] = "8pt"
            Item.Style["font-family"] = "Cursive"
            Item.Style["color"] = "brown"
            Item.Style["background-color"] = "white"
            Item.Style["height"] = "30px"
             
        } 
    } 


Thanks
Shinu
Tags
Grid
Asked by
DragonBall
Top achievements
Rank 1
Answers by
Dimo
Telerik team
DragonBall
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or