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

RadGrid not hiding expand column after changing of column position.

1 Answer 15 Views
Grid
This is a migrated thread and some comments may be shown as answers.
subrat
Top achievements
Rank 1
subrat asked on 14 Nov 2014, 12:07 PM
I have a radgrid where I hide the expand column using the code mentioned in the link below.
http://www.telerik.com/help/aspnet-ajax/grid-hide-expand-collapse-images-when-no-records-in-self-referencing-hierarchy.html

This works fine and hide the expand button correctly.
The problem arises when I move the columns.
On moving a column to a different position the grid reloads and then the Expand button appears.

Why is this happening? How can i solve the issue.
One strange thing I have observered is that on moving the columns around the page postback and the grid_PreRender event fires before the grid_NeedDataSource. I think PreRender event should fire after NeedDataSource event. Can this be the cause of this issue? How can I solve it?

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 19 Nov 2014, 07:33 AM
Hi Subrat,

Thank you for contacting us.

A possible solution is to call Rebind() before executing the method which hides the expand/collapse images. Please check out the following code snippet.
protected void RadGrid1_PreRender(object sender, System.EventArgs e)
{
    RadGrid1.Rebind();
    RemoveExpandIconWhenNoRecords(RadGrid1.MasterTableView);
}

Another possible solution is to enable the client reordering by setting ReorderColumnsOnClient to true in the ClientSettings. This way when you reorder a column no postback will be perform.

I hope this information helps.

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
subrat
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or