how to display data in grid without sending the data in the database
-
In a web based application i have some textboxes and on the button click the data from the textboxes should be displayed in a gridview or some other conrol where the data can be displayed, modified such that the data be sent back to the textboxes for modifying and back into the gridview .Another button for deleting the data and finally on the click of a button that is outside the gridview the data from it should go into the database. I was able get the data into the gridview from the textboxes to the grid and back using the select "textbox1.text" as data1,"textbox2.text"as data2 etc.and was able to modify the data.but for deleting the row i was not able to trace which row is getting deleted and am not able to sent the data to the database on the button click outside the gridview.What should I do? is there some way i can use the gridview itself for the same or i should use some other conrol ?
-
In a web based application i have some textboxes and on the button click the data from the textboxes should be displayed in a gridview or some other conrol where the data can be displayed, modified such that the data be sent back to the textboxes for modifying and back into the gridview .Another button for deleting the data and finally on the click of a button that is outside the gridview the data from it should go into the database. I was able get the data into the gridview from the textboxes to the grid and back using the select "textbox1.text" as data1,"textbox2.text"as data2 etc.and was able to modify the data.but for deleting the row i was not able to trace which row is getting deleted and am not able to sent the data to the database on the button click outside the gridview.What should I do? is there some way i can use the gridview itself for the same or i should use some other conrol ?
You can use a list of objects as a datasource. You don't need to use a database.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
In a web based application i have some textboxes and on the button click the data from the textboxes should be displayed in a gridview or some other conrol where the data can be displayed, modified such that the data be sent back to the textboxes for modifying and back into the gridview .Another button for deleting the data and finally on the click of a button that is outside the gridview the data from it should go into the database. I was able get the data into the gridview from the textboxes to the grid and back using the select "textbox1.text" as data1,"textbox2.text"as data2 etc.and was able to modify the data.but for deleting the row i was not able to trace which row is getting deleted and am not able to sent the data to the database on the button click outside the gridview.What should I do? is there some way i can use the gridview itself for the same or i should use some other conrol ?
Why dont u store the IDs of the deleted records and during saving the grid to DB delete the records from DB using thoseIDs.
-
Why dont u store the IDs of the deleted records and during saving the grid to DB delete the records from DB using thoseIDs.
thanks for the reply.. if i used 2 link button and both have the same command name select on the selected index changed of the gridview i am not able to trace which button has been clicked if the delete or the modify.more over if i use the command name update for the delete button and call the GridView1_RowUpdating event i cannot retain the the gridview1.selectedrow.cells[1].text. for deleting where i update the delete status to be Yes. As it is a web application on the button click outside the grid cannot retain the gridview1.SelectedRow.cells[0].text cannot be retreived and it throws an enception. what should i do is there anything optional to a gridview. Please reply soon
-
thanks for the reply.. if i used 2 link button and both have the same command name select on the selected index changed of the gridview i am not able to trace which button has been clicked if the delete or the modify.more over if i use the command name update for the delete button and call the GridView1_RowUpdating event i cannot retain the the gridview1.selectedrow.cells[1].text. for deleting where i update the delete status to be Yes. As it is a web application on the button click outside the grid cannot retain the gridview1.SelectedRow.cells[0].text cannot be retreived and it throws an enception. what should i do is there anything optional to a gridview. Please reply soon
I tried your case,deleting the rows by clicking the delete button in each row.then i saved the PK of each row and finally during saving delete those rows by using the IDs. I just put a column for ID which has the commandargument set to id,on delete event i was getting the IDs by this int rowIndex = e.RowIndex; LinkButton lnk = (LinkButton)GridView1.Rows[rowIndex].FindControl("lnkID"); Is it the case that u are searching or anything else.
-
I tried your case,deleting the rows by clicking the delete button in each row.then i saved the PK of each row and finally during saving delete those rows by using the IDs. I just put a column for ID which has the commandargument set to id,on delete event i was getting the IDs by this int rowIndex = e.RowIndex; LinkButton lnk = (LinkButton)GridView1.Rows[rowIndex].FindControl("lnkID"); Is it the case that u are searching or anything else.
-
am sorry for the trouble am new to asp.net ,but as the data in the grid is not from the database but from the textboxes in the form.as the data is not actually in the database i cannot delete the row by using a query.That row has to be out of the grid as soon as i pess the delete button,add on the click of a button that is outside the gridview,i want all the data to go into the database.ie am using the gridview so that the user can modify any entry that he made in the textboxes and delete the rows that he wants and send it to the database later..