Saturday, March 24, 2012

Need an idea for clientside-loaded control container

I am working on an Expandable Row Extender that ideally youwould apply on a gridview (or any other databound control that renders a table)to give it an expandable row functionality. However, I want to do as much aspossible in client side (I've seen the approach of adding an item in thedataset, override onitembound to draw it accordingly and then rebind the datato the control to redraw it, and place it all in an update panel but I don'tlike this approach - obvious reasons). Nor do I like the idea of having every"details" row rendered and hidden.

I kind of like how this feels:http://www.codeproject.com/aspnet/MasterDetail.asp and I very much like how asimilar implementation on www.titlez.com.

That being said, I am trying to make the control as genericas possible (and as easy to use as possible), therefore I think the easiest foranybody to use for the details row would be a usercontrol (so that you can useyour own control, which eventually you might reuse as a webpart as well).

Here is where I need the idea: how to dynamically render thecontrol triggered from the client side (to render it in the expanded row).

The trivial solution would be to use an iframe and load aweb form that would load the control, but there is something that doesn't feelright about this approach.

Any ideas?

I think you can embed user controls to a GridView and implement a inline GridView similar to the demo in www.titlez.com.Besides,maybe a third party user control can be used in a GridView,specially about Chart/Graph controls.
Try to take a look at Ajax website - http://Ajax.asp.net.There are a lot of useful Ajax controltoolkit which can help you to implement it and get a nice web page.

Hi Jasson and thank you for your reply.

I know you can embed user controls in a gridview but what I am trying toachieve is a control that does as much as possible on client side (so when youwould expand a row I wouldn't want to hit the server to add a control in thegrid and rebind the grid, even if this would be in an updatepanel especially asyou might have some time-consuming info in the details row and if you wouldhave several open at the same time this architecture would severely affectperformance. Nor do I want to pre-render everything in one go and initiallyhide the rows for the same reason). Also I am not interested at this time aboutthe graphs and other nice things in those rows, I am just down to the very ideaof the extender control. I am well aware of the ajax controls toolkit and what I am doing isan extender using the same framework, actually extending the extenderbase inthe toolkit.

What I have done so far uses IFrames to render the details row and lets youdefine a usercontrol that will be rendered in the expanded row. It goes througha complicated process of autogenerating a form to host the control at runtime.I was looking for ideas of how to do this without IFrames, using somethingsimilar to an updatepanel that would be able to add the user control atruntime.

Hope this makes sense ..


If you would like to achieve a control as much as possible on the client side,javascript is the unique selection.Ajax control toolkit gives us a good direction to this,however,it can not implement what we need now.I believe it can be done in the near future.I agree with you that if we load too many user controls at runtime in the server side and embed them in a complicated control such as Grivew,DetailsView or FormView,it will affect the server performance. Do you mind MagicAjax which also provides a Ajax framework for us to do further development?MagicAjax is open source and we can extend it to meet our requrements.I don't know if you are inerested in it.

Try to take a look at this reading about MagicAjax for your reference -http://www.c-sharpcorner.com/UploadFile/mosessaur/magicajax02112006060506AM/magicajax.aspx?ArticleID=ddd4757e-7ab7-49da-a3f2-d88b340230c3

Wish this can give you some ideas.


Thanks for sharing the idea. I am afraid I am familiar with MagicAjax as well but I don't see it solving this particular issue. MagicAjax is actiong more like the UpdatePanel control in Ms. Ajax. That wouldn't work without rebinding the grid on the server which wouldn't be any faster. Further more, MagicAjax stores everything on the session so it might bring even more concerns.

No comments:

Post a Comment