I am having the data filled in my Datagrid and whenever I tried to fill some other data into that Datagrid, the older rows are not getting clear. How to Clear them Can anyone help me
I have tried the Code below and still unsuccessfull
DataGrid1.DataSource = nothing; DataGrid1.DataBind(); |

Refreshing Rows in DataGrid
blacitect
Is it possible for you to tell us more detail about what you are trying to do
and how did u trigger to update the data grid (e.g. by button click).
It seems to me that you are trying to update the data grid without post back to the server. (which of course data grid won't be refreshed unless u are using AJAX)
Hope it helps,
Ivan Wong
smak
Have you remove the selected rows from the DataSet1
Could you please post the code that you use to remove the selected rows
it seems to me that the DataGrid has been refreshed, with the same data, that's why "seems" like not refreshing at all.
Hope it helps,
Ivan Wong
Osama Alborbar
DataSet.Clear()
DataSet.AcceptChanges()
lanfong
Hope it helps,
Ivan Wong
mikemhc
DataGrid1.DataSource = DataSet1;
DataGrid1.DataBind();
After Posting to the Server, Suppose the User Selects two Rows and and Checks the Checkbox over there and Clicks on a Button . Then I will delete the two rows from the database and again fills the remaining 8 rows to Datagrid from the Database. Before filling the Datagrid ,I ll refresh the DataGrid.DataSource property with Nothing and binds it.
i.e as below
DataGrid1.DataSource = Nothing;
DataGrid1.DataBind();
and Fills up the Data to DataGrid
DataGrid1.DataSource = DataSet1;
DataGrid1.DataBind();
JIMMY-D-
can you type the code over here
Regards
Heemanshu
Jonathan Green
Instead of setting the datasource=nothing you call the clear method .od dataset and refill the dataset and bind it.
DataSet1.Clear();
SQLDataAdapeter1.Fill(DataSet1);
DataGrid1.DataSource = DataSet1;
DataGrid1.DataBind();
DataSet.Clear remove all the previous data from the dataset
Regards
Heemanshu
RMS rookie
The problem got cleared with that
DataSet1.Clear();
DataSet1.AcceptChanges();
Thanks & Regards
Venny