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

how to re-order Edit Column in RAD Grid Control

2 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
saad
Top achievements
Rank 1
saad asked on 27 Sep 2008, 04:17 PM
i am new to RAD Controls and i want to know how can i re-order the edit column in RAD Grid? it is by default set to Extreme Right. i want to bring to extreme left.
Thank U

2 Answers, 1 is accepted

Sort by
0
Chase Florell
Top achievements
Rank 1
answered on 28 Sep 2008, 06:33 AM
Yeah this is easy. 

first set (AutoGenerateColumns="false")
then build your columns yourself

                <PagerStyle Mode="NextPrevAndNumeric" /> 
                <MasterTableView TableLayout="Auto" DataKeyNames="ID">  
                    <RowIndicatorColumn> 
                        <HeaderStyle Width="15px" /> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="15px" /> 
                    </ExpandCollapseColumn> 
                    <Columns> 
                    <telerik:GridEditCommandColumn datafield="id" HeaderText="Edit" UniqueName="Edit" Visible="true" /> 
                        <telerik:GridBoundColumn DataField="Title" HeaderText="Page Title" UniqueName="Title" Visible="true" /> 
                        <telerik:GridBoundColumn DataField="MenuName" HeaderText="Menu Name" UniqueName="MenuName" Visible="true" /> 
                        <telerik:GridTemplateColumn DataField="DateCreated" HeaderText="Date Created" UniqueName="DateCreatedDisplay">  
                            <ItemTemplate> 
                                <asp:Label ID="lblDateCreated" runat="server" Text='<%# FormatDate(DataBinder.Eval(Container.DataItem, "DateCreated")) %>' /> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                    </Columns> 
                </MasterTableView> 

as an example.
0
Princy
Top achievements
Rank 2
answered on 29 Sep 2008, 04:38 AM
Hello Saad,

You can swap the columns using their UniqueName properties in the PreRender event of the grid as shown below:
cs:
  protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.SwapColumns("NumericColumn", "TextColumn"); 
    } 
You can also go through this link which explains about reordering columns.

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