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

HierarchyLoadMode=ServerBind Causes Visual Errors on RadGrid within UpdatePanel

2 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kaleb
Top achievements
Rank 1
Kaleb asked on 27 Feb 2013, 08:30 PM
Afternoon,

The problem I am having is that I have  a hierarchical radgrid inside of an updatepanel, with the grid set to HierarchyLoadMode="ServerBind".  When I have the grid start out with expanded rows, images that are loaded into the grid are inserted properly as follows:

The grid puts "true" or "false" into the cells, and then in ItemDataBound those values are removed for a checkmark or an x (for true or false, respectively).  When the page posts back, some of the grids update to show images, other do not.

The reason that I am doing HierarchyLoadMode=ServerBind is because I need to get a total count of the items that will be in the grid, and I get that count by going across the items in the grid and for each that is a chlid item I increment a count.  If there is a handier way to do that, I would also be amenable to switching HierarchyLoadMode to ServerOnDemand or something.  I need a count of the items in the grid and it has to be correct regardless of the expand/collapsed state of the items.  When I had ServerOnDemand and the rows started collapsed (a requirement), the count of the child items came to 0 each time, even if there were items in the grid.  I currently get the count of the items in the Page_PreRender event, when all the grid bindings have been completed.

Any ideas?  Can I count the items in the grid in some other way than going across rows in Page_PreRender? If not, is there a way I can set the AJAX to load images in upon expansion of the rows, as is currently not happening?

Thanks very much,

Kaleb

EDIT:  The update panel has UseChildrenAsTriggers="true" and UpdateMode="always"

2 Answers, 1 is accepted

Sort by
0
Kaleb
Top achievements
Rank 1
answered on 28 Feb 2013, 06:08 PM
Still waiting for some guidance on this.

 I have set the HierarchyLoadMode to ServerOnDemand since I worked out a different way to determine the number of items in the grid, but the problem is now that the images load on row expand, but if I cause a postback on the page from anything other than that row (by sorting, filtering, what have you), the images are lost after the partial postback.

There are three grids on the page, each within their own UpdatePanel (UpdateMode="Always" and ChildrenAsTriggers="True").

What can I do to get the radgrid to retain the images on postback?  All other grid data is retained properly.

It is worth mentioning again that the images are loaded into the grid by an event called in the ItemDataBound.  This might be the source of the problem in getting the images to persist (they're loaded in dynamically, that is), but I have EnableColumnViewState="True" for both the MasterTableView and the child grid GridView.

Any suggestions?
0
Radoslav
Telerik team
answered on 04 Mar 2013, 03:14 PM
Hi Kaleb,

Based on the provided information it is hard to say what is caused the described issue at your end. Could you please elaborate a bit more on your scenario? Do you use RadGrid hierarchy with Templates or with DetailTables?
Also how do you add the images? Are they declared initially or you insert them into the grid items dynamically?

Also it will be helpful if you could post you aspx page with the related code behind file. Thus we will be able to gather more details about your scenario and provide you with more to-the-point answer.

Looking forward for your reply.

Greetings,
Radoslav
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
Kaleb
Top achievements
Rank 1
Answers by
Kaleb
Top achievements
Rank 1
Radoslav
Telerik team
Share this question
or