By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,680 Members | 1,666 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,680 IT Pros & Developers. It's quick & easy.

Expand/Collapse Datagrid

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

thanks

Jeff

Apr 6 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Denis Bauer does that in his HierarGrid and the source code is available:

http://www.denisbauer.com/ASPNETCont...ierarGrid.aspx

Ken
Microsoft MVP [ASP.NET]

"sirfunusa" <si*******@hotmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Does anyone have sample code for an expanding parent/child datagrid.
Like a treeview control with the "+/-" signs. ASP.NET 1.1

thanks

Jeff

Apr 6 '06 #2

P: n/a
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.

Apr 6 '06 #3

P: n/a
"sirfunusa" <si*******@hotmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
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.

--
Adam Clauss
Apr 6 '06 #4

P: n/a
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.

Apr 6 '06 #5

P: n/a
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.

Apr 6 '06 #6

P: n/a
http://tinyurl.com/e953d

Don Quijote de Nicaragua

"Adam Clauss" <ca*****@tamu.edu> escribió en el mensaje
news:12*************@corp.supernews.com...
"sirfunusa" <si*******@hotmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
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.

--
Adam Clauss

Apr 6 '06 #7

P: n/a
Our company has not moved to ASP.NET 2.0 yet

Apr 7 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.