hello all
i am developing windows application and in a form i have 2 panel one with datagridview1 named dg1 and second with datagrideview2 named dg2 and dg1 is databound so while i click on any cell of dg1 that row will transfer to gd2 and get removed from dg1 same functionality i want in revers order like if i click on any cell on dg2 that row is transfert to dg1 and removed from dg2 i used following code
private void Results_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
DataGridViewRow _row = new DataGridViewRow();
_row = this.Results.CurrentRow;
fill.Rows.Add(this.Results.CurrentRow.Cells["Code"].Value , this.Results.CurrentRow.Cells["DiagnosisID"].Value , this.Results.CurrentRow.Cells["id"].Value , this.Results.CurrentRow.Cells["ShortDescription"].Value );
this.Results.CurrentRow.Visible = false;
}
private void fill_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
DataGridViewRow _row = new DataGridViewRow();
_row = this.fill.CurrentRow;
this.fill.CurrentRow.Visible = false;
Results.Rows.Add(this.fill.CurrentRow.Cells["Code"].Value, this.fill.CurrentRow.Cells["DiagnosisID"].Value, this.fill.CurrentRow.Cells["id"].Value, this.fill.CurrentRow.Cells["ShortDescription"].Value);
}
it transfert row from dg1 to dg2 but not allow to visible false or remove
and while click on the dg2 row does not transfer to dg1 it gives some error Like "you can not add row programically in databound gridview "
so please any one have any idea about this so please help me asap
and
thanks in advance