Hi ,
I have taken two different Datagridview in two tabs and trying to fill that data with same datasource . but when I tried to delete some selected rows from one datagridview the other gets udpated automatically , it also deletes the same rows.
Can somebody help me , what I missed ?
Thanks & Regards,
Abhishek Gupta
Loading
Mayur DighePosted Feb 10, 2013, 9:35 AM
You can do it.......Buddy....
You are taking data from SAME Datasource for two DataGridViews......but you want keep one DataGridView unchanged while/after modifying or deleting data from another DataGridView, then you can break this situation.....by just making a mirror Table using DataSet or DataTable.
if You update the datasource after deleting data from one DGV its obvious that it will reflect same to another DGV.
So just first make a Mirror table of your data to be put into DGVs then original table into one DGV and Mirror Table into another DGV.
This will work.......try it...........
Happy Programming.............
Mayur DighePosted Feb 21, 2013, 9:30 AM
Make Update or Modify DataTable.....Object...and also make sure that same object is NOT Binded with DGV (which you want to keep Unchanged after modification).
Abhishek GuptaPosted Feb 19, 2013, 11:56 AM
I put the code to update DVG one on Button 1 click and DVG 2 will update on 2nd button click
. it works fine with first click , but while pressing button one DVG 2 also gets updated automatically .
As I just update the Datatable (which is bound to DVG 2) with button one click .
i think this is the problem ..........
Mayur DighePosted Feb 15, 2013, 10:32 AM
You say..... you load DataTable into 2nd DGV at Button_Click event, & want to update DGV content at another Button_Click event, you just put a code for assign DataSource property of DGV on that 2nd Button, and make sure that same code is NOT repeated at 1st Button_Click event .....Otherwise Problem remain as it is.....
One more thing.....Update DataTable object ONLY at 2nd Button_Click event, Not at 1st Button.
Sorriee.....for late reply....!!!!
Happy Programming..........
Abhishek GuptaPosted Feb 13, 2013, 3:42 AM