Expand/Collapse Datagrid

S

sirfunusa

Does anyone have sample code for an expanding parent/child datagrid.
Like a treeview control with the "+/-" signs. ASP.NET 1.1

thanks

Jeff
 
S

sirfunusa

Yes, I've seen this, but I don't want to include a user control or DLL
in our project. I was looking for a simpler implementation.
 
A

Adam Clauss

sirfunusa said:
Does anyone have sample code for an expanding parent/child datagrid.
Like a treeview control with the "+/-" signs. ASP.NET 1.1

thanks

Jeff

The implementation Ken mentioned looks a lot cleaner than what I have.
All the logic of my implementation is server-side. I am not binding to a
dataset, but rather a list of business objects.

Basically, I am including a "hidden" datagrid in the template for the last
column of the parent grid. This grid's Visible flag is toggled whenever the
user clicks the expand/collapse button (itself a separate column in the
parent grid). The 'hidden' grid is separated from the actual content of
that last column by a line break (<br>), which gives the appearance of the
table "expanding" when that grid suddenly becomes visible.

I cannot provide source to what I have done due to restrictions of the
project, so I hope between the information I have given and Ken's example
you can figure something out. If I was using datasets, Ken's example looks
to be a pretty good implementation.
 
T

tdavisjr

Well,

Its difficult to understand your objection to using this component. The
sort of thing you are asking for is not built-into ASP.NET. So, to get
this behavior you have to create a custom control or manipulate the
Datagrid in some way and do all the hard work yourself. The good thing
is someone has already done all the hard work that is necessary to get
this done and was gracious enough to release the source code for all to
use. So, if you don't want to include a .dll or a usercontrol in your
project, then take the source code that was provided, included it in
your project and modify it till your heart is content, or, look at the
source code and use it as an example of how you want to go about
created this functionality yourself. And, if I am not mistaken, you
did ask in your question if there is some sample code that shows how to
do it. Well, you have it right in front of you.
 
S

sirfunusa

No. That grid it completely over-engineered. I spent 2 days looking at
it. I don't use bad or overly-complex/black-box code blindly. We need
to support it too, in case users want to modify the functionality.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top