INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Show or hide new row in the middle of a gridview?

Show or hide new row in the middle of a gridview?

(OP)
I have an extranet page where a user will click on the part number being displayed in a gridview and I want to show them the detail for that part number between the row they clicked on and the next row down. What is the best way to do that: Update panels, CSS with a simple show/hide, some other new way I am not aware of? And then, is there any decent sample code for any suggested solutions?

Thanks,
Willie

RE: Show or hide new row in the middle of a gridview?

I am confused on what you want to do. You have a gridview that has a part number column in it. That is a link to the detail of that part. So I would assume that would show the detail of the part number clicked?
It is hard for me to viualize what you are describing and why you would want to do it? Can you explain a little further?

RE: Show or hide new row in the middle of a gridview?

(OP)
We have a customer that is both a customer and a vendor (they supply the material, we create the product and send it back to them). This customer needs to be able to see not only what we have on hand, but what jobs that will cover and when we will need more of each particular material. To this end we have a portal (or extranet) where this customer can login and see their entire list of materials. When they then click on a material (the part number earlier) they will see the full detail of jobs requiring that material, how much material we have, how much each job needs and when we will run out with out current inventory.

CODE

Fabric P/N 	Description 	Qty Alloc To Wip 	Qty On Hand 	UOM 	Future Free 	Add/View Status 	Fabric Scan
 160103150AMI 	 "ADB" LEATHER 	 18.15 	 124 	 SQF 	 105.85 	Add / View Status 	 
 160103160AMI 	 "ADJ" LEATHER 	 0 	 20 	 SQF 	 20 	Add Status 	 
 160103200AMI 	 "ADM" LEATHER 	 0 	 457 	 SQF 	 457 	Add Status 

and then expanded for one material

CODE

160103150AMI 	 "ADB" LEATHER 	 18.15 	 124 	 SQF 	 105.85 	Add / View Status 	 
Buyer Name	Po#	Description	Delivery Date	F/G Part #	Qty To Make	Qty Required	Running Summary
M.SOMENAME	10102029 	SEAT KIT 	5/28/2013	2D7004-71ADB 	5	14.5	14.5
M.SOMENAME	10441450 - AFTERMARKET 	COVER ASSY 	6/4/2015	2D7017-14ADB 	1	6.15	20.65
M.SOMENAME	10437916 - AFTERMARKET 	COVER ASSY 	6/5/2015	2D7071-11ADB 	2	12	32.65

Fabric Receipts
EntryDate	PO	Qty
3/19/2015	RTC 608 	-35.000
1/12/2015	10371219 	350.000 

Is that a little more clear now? If you have suggestions for another way to handle this I would be happy to hear them.

Thanks,
wb

RE: Show or hide new row in the middle of a gridview?

Ok so the top block of "code" you are showing what you currently have in your gridview, correct?
So now, if the user clicks on a link in the "Fabric P/N" column (i.e. "160103150AMI"), then you want to see the expanded view in your second "code" block? Is that correct?

RE: Show or hide new row in the middle of a gridview?

(OP)
Yes, that is correct and I always want the second block to show up directly below the first block, like it was inserted in there.

Thanks,
Willie

RE: Show or hide new row in the middle of a gridview?

There are a couple of options.
If you have a 3rd party control, like Telerik controls, they make this easy with their RadGridView.

If you just want to use the stock gridview, you can have a template column and put another gridview in it (so it would be nested)
On rowdatabound, you use FindControl() and bind that grid. (Or you can just use a div or repeater or whatever control you like)

Also, on rowdatabound, you use FindControl() to find the link and attach a javascript "onclick" event to it to call a function.
That function will just show that control using javascript or JQuery(my preference)

RE: Show or hide new row in the middle of a gridview?

(OP)
I got this working using nested gridviews. Thank you for the help!

wb

RE: Show or hide new row in the middle of a gridview?

Yep, that would be a good way to go. Repeaters or listviews are good too if you need to have it look a certain way because
you can generate any HTML layout you want.

Glad to help.

RE: Show or hide new row in the middle of a gridview?

(OP)
I did get this working with nested gridviews, thanks for your help!

wb

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close