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

Centering Button Column in Default Skin

1 Answer 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rich
Top achievements
Rank 1
Rich asked on 10 Mar 2009, 05:29 PM
How do I set, GridButtonColumn to ItemStyle-HorizontalAlign="Center", in the default skin file?

Thanks,
Rich

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Mar 2009, 06:17 AM
Hi Rich,

You can try setting the HorizontalAlign of the GridButtonColumn either in the aspx page or in the code behind as shown below.

ASPX:
 
 
<telerik:GridButtonColumn Text="Delete" ButtonType="ImageButton" ItemStyle-HorizontalAlign="Center"  ImageUrl="~/Images/Image1.gif"  UniqueName="DeleteColumn" HeaderText="DeleteColumn"  > 
                      </telerik:GridButtonColumn> 


Or

CS:
 
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
 
        foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns) 
        { 
            if (col.UniqueName == "Select"
            { 
                col.ItemStyle.HorizontalAlign = HorizontalAlign.Center; 
            } 
        } 
         
        
    } 


Thanks
Shinu

Tags
Grid
Asked by
Rich
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or