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

Have to click twice on ExpandCollapse button

3 Answers 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 2
Dan asked on 14 Apr 2010, 04:48 PM
This is odd. I just upgraded my web project from the old RadControls for ASP.NET to the latest ASP.NET AJAX controls.  I have several hierarchy grids that use the HideExpandColumnRecursive method.  These worked fine under the old controls.

With the new controls, the ExpandCollapse button hides as it should when there are no child records in the 2nd level.

But, if there are child records, then the ExpandCollapse button is visible.  When I click on it,
The column containing the buttons narrows, the button icon narrows, but nothing else happens.
On a second click the child grid opens as expented, and the button column remains narrowed.
On subsequent button clicks, the child grid opens and closes ok.

If I refresh the page, then once again two clicks are needed to expand the row.

Has anyone else run into this?  Thanks.

Dan

3 Answers, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 2
answered on 15 Apr 2010, 02:51 PM
Bug or not?  Here's what I found out about this problem.

The double click problem I described above happens when I define the ExpandCollapseColumnType in the code-behind, thus:

<

 

telerik:RadGrid ID="rgData" Skin="Simple" runat="server" AllowSorting="True" AutoGenerateColumns="False"

 

 

AllowPaging="True" GridLines="None" Width="99%" Font-Size="Medium" AllowExpandCollapse="true">

 

 

<MasterTableView HierarchyDefaultExpanded="false" HierarchyLoadMode="ServerBind">

 

protected

 

void Page_Load(object sender, EventArgs e)

 

{

 

rgData.MasterTableView.ExpandCollapseColumn.ButtonType =

GridExpandColumnType.PushButton;

Whereas, this code works with no problem:

 

<

 

telerik:RadGrid ID="rgData" Skin="Simple" runat="server" AllowSorting="True" AutoGenerateColumns="False"

 

 

 

AllowPaging="True" GridLines="None" Width="99%" Font-Size="Medium" AllowExpandCollapse="true">

 

 

 

<MasterTableView HierarchyDefaultExpanded="false" HierarchyLoadMode="ServerBind" ExpandCollapseColumn-ButtonType="PushButton">

protected void Page_Load(object sender, EventArgs e)

 

{
rgData.MasterTableView.ExpandCollapseColumn.ButtonType = GridExpandColumnType.PushButton;

Looks like a bug to me.
Dan

 

0
Accepted
Iana Tsolova
Telerik team
answered on 16 Apr 2010, 03:58 PM
Hello Dan,

I followed your steps and I was able to replicate the issue. In order to set the ExpandCollapseColumn.ButtonType, I suggest that you handle the RadGrid_PreRender event where the columns is already created as below instead of setting it on Page_Load:

Copy Code
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    RadGrid1.MasterTableView.ExpandCollapseColumn.ButtonType = GridExpandColumnType.PushButton;
}

Check it out and let me know if it works for you.

Additionally, to avoid duplicate post, please post your answer or questions in the other thread you have open with the same subject.

Greetings,
Iana
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Dan
Top achievements
Rank 2
answered on 16 Apr 2010, 06:21 PM
Yes, setting it in the grid prerender also works, although the effect where the ExpandCollapse column and icons being narrow persists when using this method.

Thanks,
Dan
Tags
Grid
Asked by
Dan
Top achievements
Rank 2
Answers by
Dan
Top achievements
Rank 2
Iana Tsolova
Telerik team
Share this question
or