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

Sorting columns of a Detail Table

2 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jean-Marc
Top achievements
Rank 1
Jean-Marc asked on 13 Jul 2012, 01:30 PM
On RadGrid1_DetailTableDataBind event I bound my detail table to a dataset based on parent grid key value
detail table has AutoGenerateColumns="True" and so can be a different set of colums

I need, then, to reorder colums working with their OrderIndex properties

I don't know where to place this feature (reorder)
I tried this 
For Each col As GridColumn In RadGrid1.MasterTableView.DetailTables(0).RenderColumns
                LogManager.WriteToDebugLog("c:\log\", "col.UniqueName " & col.OrderIndex & " " & col.UniqueName)
Next

on RadGrid1_PreRender and on RadGrid1_DetailTableDataBind events with no luck, the autogenerated columns are not yet there.

Do you know what event allows me to see detail tables columns?

Thank you

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 13 Jul 2012, 02:09 PM
Hello,

Can you try accessing the AutoGenerateColumns in DetailTables in the PreRender event of RadGrid as follows.

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        foreach (GridColumn col in RadGrid1.MasterTableView.DetailTables[0].AutoGeneratedColumns)
        {
          //can access AutoGeneratedColumns here..
        }
    }

Please provide your code if it doesn't helps.

Regards,
Princy.
0
Jean-Marc
Top achievements
Rank 1
answered on 13 Jul 2012, 03:26 PM
Yes you are right
Tags
Grid
Asked by
Jean-Marc
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jean-Marc
Top achievements
Rank 1
Share this question
or