GridView with Add New Row functionality
-
Hello Everybody, I have a Gridview in which I need a add new row functionality. My Gridview is generated dynamically I want the functionality like in the last column of the gridview there is a button/Image,when I click on it a new row should added to the gidview along with all the data in the row as the 1st row content. Name Year Address CheckBox Add Ashok 2008 CP + Rahul 2007 Delhi + Plz help me out
A key to every Solution
-
Hello Everybody, I have a Gridview in which I need a add new row functionality. My Gridview is generated dynamically I want the functionality like in the last column of the gridview there is a button/Image,when I click on it a new row should added to the gidview along with all the data in the row as the 1st row content. Name Year Address CheckBox Add Ashok 2008 CP + Rahul 2007 Delhi + Plz help me out
A key to every Solution
AS@13 wrote:
My Gridview is generated dynamically
Is ASP.NET maintaining viewstate for this ? In which event are you creating this ?
AS@13 wrote:
t a new row should added to the gidview along with all the data in the row as the 1st row content.
I presume you are binding GridView with a datatable. When new row is requested, add a new row to datatable and bind it to gridview.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
AS@13 wrote:
My Gridview is generated dynamically
Is ASP.NET maintaining viewstate for this ? In which event are you creating this ?
AS@13 wrote:
t a new row should added to the gidview along with all the data in the row as the 1st row content.
I presume you are binding GridView with a datatable. When new row is requested, add a new row to datatable and bind it to gridview.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
Thanks, But then there is a problem.. I have to save all the data input by the user in previous rows in somewhere and bind to the gidview again at the every click of the Add button as my DataTable is disposed when page is send to the browser. Plz tell me better idea or some modification in this.. Happy Coding.
A key to every Solution
-
Thanks, But then there is a problem.. I have to save all the data input by the user in previous rows in somewhere and bind to the gidview again at the every click of the Add button as my DataTable is disposed when page is send to the browser. Plz tell me better idea or some modification in this.. Happy Coding.
A key to every Solution
You can keep your datatable in Session/ViewState. This allows you to persist it's data on post backs.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions