Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a Radgrid with a RadComboBox in a templateColumn. My other columns are AutoGenerated. By default the template column comes as the first column in the grid. If I leave it like that, it will work just fine. But whenever I change the index of it (and it actually moves), the RadComboBox in the first 9 rows stops working. From row 10 until the last it works again. I also tried with Autogenerate= false. Same issue.

The code is use to change the index is in the aspx.cs file, gets called on PreRender Event and looks like this


C#
GridColumn c = RadGrid1.MasterTableView.GetColumnSafe("Temp");
        if (c != null)
        {
            int total = RadGrid1.MasterTableView.RenderColumns.Count() - 2;
            for (int i = total; i >= 2; i--)
            {
                RadGrid1.MasterTableView.RenderColumns[i + 1].OrderIndex = i - 1;
            }
            c.OrderIndex = total + 1;
        }
        RadGrid1.MasterTableView.Rebind();
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900