Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating a master detail format
I have a list of courses, students enroll into,and their corresponding payments structures (2 datalists: 1 for pending payments, 1 for Payment History)

I have the list of courses enrolled in, in a gridview. And a button at the end of each row to dispplay the corressponding payment structure.

I want to click on the button and display the payment structure within the gridview itself, below the row selected.

Basically, i want to know how to add an empty row without any columns (like a footer) below the selected row in gridview. SO that I can then use templates and place my controls in it.

I do not want to place the datalist controls in columns, I want it to be completely under the row selected. Help please!
Posted
Updated 26-Aug-10 13:18pm

The only way to do this that I can think of, is to write a lot of javascript to insert the row you want under the row in the table ( which is how it is rendered at the end of the day ), on the client side. The gridview will not support this, in any server side code I can think of. In a lot of ways, a repeater is a better option here, it gives you a lot more control for this sort of custom action, but, of course, you then lose the features of the gridview.
 
Share this answer
 
follow these steps please:
1- set a value for the CommandName for your button in the gridview
2- in the TemplateField define the EditTemplate for the columns and place your datalist in the EditTempalte
3- in the GridViewRowCommand event handler type in your business logic in order to load the datalists with data for the selected Row, then show the datalist for that row and set the EditIndex property to be the selected index from the grid in order to show the datalist for that row.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900