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

[Solved] Export Right Align

1 Answer 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 28 May 2009, 05:53 PM
I am creating a custom control for RadGrid to Export PDF.  I am trying to figure out how to determine if the field is right aligned or not in the ItemCreated.  Is there a way to tell if the GridTemplateColumn is set to ItemStyle-HorizontalAlign="Right"?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 May 2009, 04:03 AM
Hello Robert,

You can try out the following code to check if a column is right aligned:
c#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem dataItem = (GridDataItem)e.Item; 
            GridColumn col = (GridColumn)RadGrid1.MasterTableView.GetColumn("ColumnUniqueName"); 
            if (col.ItemStyle.HorizontalAlign == HorizontalAlign.Right) 
            { 
                //code here 
            } 
        } 
    } 

Thanks
Princy.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or