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

Sudden failure of RadGrid detail dropdown

3 Answers 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Boris
Top achievements
Rank 1
Boris asked on 07 Jun 2013, 03:44 PM
This is perhaps a bit too proactive but I feel I need to cover all the bases.

I've been working for months on a Dot Net 4.0 C# app using a RadGrid.  

This has a fairly conventional Header Detail arrangement.  This has been working perfectly for months.  Every time I click on the > arrow I get the usual list of details or the no records message.  Either way the detail section is displayed.

Now, all of a sudden, under one specific unique conditions, which so far as the grid is concerned, is just a routine limiting of records from the database itself, the little > buttons are failing.  No dropdown display at all, not even the no records message.  It's as if they're disabled. Also the DetailTableDataBind is not even being called.

What could conceivably cause this?  (I don't even know how to disable them.  The question has never come up.)

3 Answers, 1 is accepted

Sort by
0
Boris
Top achievements
Rank 1
answered on 07 Jun 2013, 07:54 PM
I've found the cause of the crash by accident, and it's not much help.  My grid also has a RadToolTipManager popup and as it turns out, that's failing too with a PageRequestManagerServerErrorException: Failed to load viewstate.

As it so happens this page's master page also dynamically loads a pair of hyperlinks at the top of the page (No connection whatever to the RadGrid).  Under the current conditions its always the same two links every time.  I've disabled their viewstates as implied by some of the on-line references and still it's no good.  If I comment out this code entirely, the problem goes away.  
I'm going to post the code here.  Suggestions?

                    System.Web.UI.HtmlControls.HtmlTableCell cell1;
                    HyperLink hl;
                    cell1 = (System.Web.UI.HtmlControls.HtmlTableCell)this.FindControl("mnuMainMenu");
                   
                   (where tu is an IQueryable collection)

                    foreach (var x in tu)
                    {
                        // this does a lookup for a t record.
                        t = dataSourceMethod(Id);                     
                        if(t.field1 != null && t.field1 != "")
                        {
                            hl = new HyperLink();                           
                            hl.Text = t.field1;
                            hl.NavigateUrl = t.field2;
                            hl.Style.Add("padding-right", "15px");
                            hl.Style.Add("color", "blue");                           
                            hl.EnableViewState = false;
                            hl.ID = t.field1;
                            hl.ViewStateMode = ViewStateMode.Disabled;
                            cell1.Controls.AddAt(0, hl);
                        }
                       
                    }

                    hl = new HyperLink();
                   
                    hl.Text = "All";
                    hl.NavigateUrl = "Page1.aspx?s=";
                    hl.Style.Add("padding-right", "15px");
                    hl.Style.Add("color", "blue");                    
                    hl.EnableViewState = false;
                    hl.ID = "AddAll";
                    hl.ViewStateMode = ViewStateMode.Disabled;
                    cell1.Controls.AddAt(0, hl);   
0
Kostadin
Telerik team
answered on 12 Jun 2013, 08:18 AM
Hi Boris,

Could you please elaborate a little bit more on your scenario? Sending us your code declaration and the related code behind will help us to pinpoint the reason for that behavior. Note that failed Viewstate load is caused by dynamically adding controls in Page_Load method. It is more likely that server-side code causes the issue and not the declaration of the controls. As far as I can see you are adding the HyperLink controls dynamically into the cell and when a the page starts loading the Viewstate those controls could not be found. I would suggest you to try add the HyperLink earlier in the page live cycle, for instance on Page_Init event handler.

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Boris
Top achievements
Rank 1
answered on 12 Jun 2013, 12:25 PM
There's nothing more to elaborate.  I've told everything I know.  

This entire issue is now moot because I've been told to remove those same hyperlinks.  No more problem.

(However your tip about using Page_Init might come in handy later, if I ever have to do something similar.  Thanks.)


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