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

set position of ExpandCollapseColumn

3 Answers 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
kamini
Top achievements
Rank 1
kamini asked on 11 Oct 2013, 11:40 AM
Hi

I have set ExpandCollapseColumn-display=true and have set expand\collapse image. 

Everything is working properly. But this expand column takes zero index by default. I want to set it's position. If i want to have it as the last index column, What I have to do for it..?

Thanks
Kamini

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 11 Oct 2013, 12:17 PM
Hi Kamini,

One approach would be to hide the autogenerated expand column and create your custom GridExpandColumn.

C#:
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
   {
       if (e.Column.UniqueName == "ExpandColumn")
       {
           e.Column.Display = false;
       }
   }

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" OnColumnCreated="RadGrid1_ColumnCreated" . . >
    <MasterTableView >
        <Columns>
           . . . . 
            <telerik:GridExpandColumn ButtonType="ImageButton" CollapseImageUrl="../Image1.bmp"
                ExpandImageUrl="../Image2.bmp">
            </telerik:GridExpandColumn>
        </Columns>
        <DetailTables>
            <telerik:GridTableView>
                <ParentTableRelation>
                  . . . .
                </ParentTableRelation>            
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
</telerik:RadGrid>

Thanks,
Princy
0
kamini
Top achievements
Rank 1
answered on 11 Oct 2013, 12:44 PM
Hi Princy

Thanks for replying.

your given solution works fine but by doing so, another problem arise is when i expand it, the other columns' positions get changed. 

I can see the space before DetailTable and MasterTableView Columns' position does not match with header position.

Do you have any solution to fix this issue.?

Thanks
Kamini
0
Eyup
Telerik team
answered on 16 Oct 2013, 09:57 AM
Hello Kamini,

Can you please send us a very basic runnable web site demonstrating the issues? Thus, we will be able to figure out your specific scenario and suggest a proper solution.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
kamini
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
kamini
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or