DataView and its DataSource
-
Hi friends, I have a page with a dataview binded to a datatable. I want to delete all the rows with a checkbox marked on it. The problem is that in the button's OnClick event the DataSource property of the DataView is NULL. I cant have access to it in order to know the IDs of the marked rows. How can I do this? Thanks averyone
-
Hi friends, I have a page with a dataview binded to a datatable. I want to delete all the rows with a checkbox marked on it. The problem is that in the button's OnClick event the DataSource property of the DataView is NULL. I cant have access to it in order to know the IDs of the marked rows. How can I do this? Thanks averyone
You need to cache the datatable because in every post back the datatable will be cleared.
Thomas
-
Hi friends, I have a page with a dataview binded to a datatable. I want to delete all the rows with a checkbox marked on it. The problem is that in the button's OnClick event the DataSource property of the DataView is NULL. I cant have access to it in order to know the IDs of the marked rows. How can I do this? Thanks averyone
In which event you are binding the DataView?
Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group
-
Hi friends, I have a page with a dataview binded to a datatable. I want to delete all the rows with a checkbox marked on it. The problem is that in the button's OnClick event the DataSource property of the DataView is NULL. I cant have access to it in order to know the IDs of the marked rows. How can I do this? Thanks averyone
just declare your DataTable as static , and get data in DataTable like.. public Static DataTable dt = new DataTable(); if(!IsPostBack) { dt = //some binding code... } now you will not lost data from datatable.. bye have a nice day. Chirag Patel
-
just declare your DataTable as static , and get data in DataTable like.. public Static DataTable dt = new DataTable(); if(!IsPostBack) { dt = //some binding code... } now you will not lost data from datatable.. bye have a nice day. Chirag Patel