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

[Solved] RadGrid Broken after Update from Q3-2012 to Q1-2013

2 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason Jones
Top achievements
Rank 1
Jason Jones asked on 02 Apr 2013, 04:09 PM
I spend all morning updating resources in my app and debugging. And after I finally got my project to successfully rebuild, I have a very dynamic RadGrid that has two problems.

Now keep in mind the code has not changed and it has always worked fine. I don't know if these issues are related or not.  I can provide code, but I didn't make any changes. I did run the Telerik Upgrade Wizard, but I don't think it would have changed lines of code in my apps. 

1. I dynamically set images and Hyperlinks in a Hyperlink column.  After the updated my images are not showing. And my assigned URL/Links are not updating.

2. When a filter is changed, the results are not being updated.  The page refreshes the records load but the filter criteria is not behaving. I put a postback button in to try to catch the problem and I can't figure it out. Eventually if I postback the filter is passed and loaded.  

Is there anything anyone can recommend to check or try?  I'm about to do a system restore and revert back to my old 2012 version, I'm kinda freaking out because I have a lot of work that is not functioning now and I need to do an update on the production code.

Thanks
Jason  

2 Answers, 1 is accepted

Sort by
0
Jason Jones
Top achievements
Rank 1
answered on 02 Apr 2013, 05:06 PM
So found some more specific details on my problem with the Images and a Fix

The RadGrid has two columns that are "hidden" but based on their values will determine what image is displayed.  The problem is in the CS file where I have a condition. 

if (GIS.Text == "Y")
{
    hyplnkGis.ImageUrl = "/images/Map.png";
    hyplnkGis.NavigateUrl = "http://mydomain.com/GISPermit/Permits.html?mcdnum=" + MCDNUM.Text;
    hyplnkGis.Target = "_blank";
}
 
else
{
    hyplnkGis.ImageUrl = "/images/NO.png";
    hyplnkGis.Visible = Convert.ToBoolean("False");
}
 
if (SCANNED.Text == "Y")
{
    hyplnkScanned.ImageUrl = "/images/PDF.png";
    hyplnkScanned.NavigateUrl = "http://mydomain.com/GISPermit/Permits/" + MCDNUM.Text + ".pdf";
    hyplnkScanned.Target = "_blank";
    hyplnkScanned.ToolTip = "PDF:" + MCDNUM.Text + ".pdf";
}
 
else
{
    hyplnkScanned.ImageUrl = "/images/" + SCANNED.Text + "-NO.png";
    hyplnkScanned.ToolTip = "THIS IS A TEST-" + SCANNED.Text;
    hyplnkScanned.Visible = Convert.ToBoolean("False");
}

I found that the Values from the GIS and SCANNED were not being populated. So I turned on the "Visible" and "Display" properties to TRUE to see what was going on and then my images worked again. I don't want these columns showing in my Grid So I change Display to FALSE and VISIBLE to TRUE and now it is behaving as it should. I had these both to FALSE in my old code, but after the upgrade, it broke.

I Still have a small problem with the Filter. After one is applied, the postback event does not grab the changes. I had to create a button that's only function was to postback in order to update the FilterExpression and SortExpression Variables that I use. SO I have a "fix"

On the postback/Pageload event I suck the Filter Expressions...  my code and notes below.

if (Page.IsPostBack)
            {
 
                string FilterExpression = RadGrid1.MasterTableView.FilterExpression;
                string SortExpression = RadGrid1.MasterTableView.SortExpressions.GetSortString();
 
 
... bla bla conditions and such .....
 
Then I save the Filter expression in a Session variable
 
            System.Web.HttpContext.Current.Session["PERMITREPORTSQL"] = FilterExpression;
            
This session variable is called and used by the Report.  But the report is not getting the update Session variables, without another postback.  It is as if the report is loading THEN the Session variable is updated, but as you can see the report is called AFTER the session variable is set.
 
            ReportViewer2.Report = new PermitReport2("ACTIVE");


 
0
Maria Ilieva
Telerik team
answered on 05 Apr 2013, 10:34 AM
Hello,

I would suggest you to review the blog post below which elaborates on the most probable reason for the described behavior:

http://www.telerik.com/community/forums/aspnet-ajax/grid/breaking-change-hidden-column-cell-text-is-not-persisted-in-viewstate.aspx

I hope this helps.

All the best,
Maria Ilieva
the Telerik team
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 their blog feed now.
Tags
Grid
Asked by
Jason Jones
Top achievements
Rank 1
Answers by
Jason Jones
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or