H
Hemang Shah
I think what i'm trying to do is passing by value.
Here is the scenario:
Main Form - which calls a Search form.
- I pass Mainform as a reference so that I can pass data between the two.
Code:
public frmSearch(Form1 f)
{
InitializeComponent();
frmMain = new Form1();
frmMain = f;
dvSearch = new System.Data.DataView();
dvSearch = frmMain.dvClient;
this.BindingContext = frmMain.BindingContext;
dgvSearchDisplay.DataSource = dvSearch;
}
I have a dataView on the main form called (dvClient)
I have a datagrid on the SearchForm which I want to filter / sort without
affecting the main form.
So I create a copy of the dataview from main form into a dataview called
dvSearch.
But now when I apply a row filter to this dvSearch, the main form is getting
affected to.
The reason why making a copy of the dataview is important because I want to
retain the currencymanager value.
So that once a record is selected in the datagrid in the searchform, the
fields are updated on the main form.
Hope this explains what I'm trying to achieve.
Thanks
Here is the scenario:
Main Form - which calls a Search form.
- I pass Mainform as a reference so that I can pass data between the two.
Code:
public frmSearch(Form1 f)
{
InitializeComponent();
frmMain = new Form1();
frmMain = f;
dvSearch = new System.Data.DataView();
dvSearch = frmMain.dvClient;
this.BindingContext = frmMain.BindingContext;
dgvSearchDisplay.DataSource = dvSearch;
}
I have a dataView on the main form called (dvClient)
I have a datagrid on the SearchForm which I want to filter / sort without
affecting the main form.
So I create a copy of the dataview from main form into a dataview called
dvSearch.
But now when I apply a row filter to this dvSearch, the main form is getting
affected to.
The reason why making a copy of the dataview is important because I want to
retain the currencymanager value.
So that once a record is selected in the datagrid in the searchform, the
fields are updated on the main form.
Hope this explains what I'm trying to achieve.
Thanks