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

Using SwapColumns for Autogenerated columns in Prerender causing Itemdatabound to execute twice

1 Answer 29 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
cns
Top achievements
Rank 1
cns asked on 06 Aug 2015, 03:36 AM

Hi,

I am using autogenerated columns for my grid in which I need to swap columns. I have used "SwapColumns" in my "prerender" function. The problem is that my itemdatabound executes before (which is correct) and even after the prerender call has been made. I have checked and the issue is not because of a null datatable. Please could you provide me a solution for this as this problem was not encountered before.

 

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 10 Aug 2015, 10:58 AM
Hi,

Try swapping the columns using the PageLoad event like this:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       If RadGrid1.MasterTableView.AutoGeneratedColumns.Length > 2 Then
           RadGrid1.MasterTableView.SwapColumns("columnName1", "columnName2")
       End If
   End Sub


Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
cns
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or