Hi,
I am using a DGBG, which has one column as comboxbox type, when I select a value from this combo box, I would want to update another cell in the grid, however i am unable to get new selected value from the combobox. I am code I am using is as follows :
private void dgrdPartyAssoc_CurrentCellCloseDropDown(object sender, Syncfusion.Windows.Forms.PopupClosedEventArgs e)
{
GridCurrentCell cc = this.dgrdPartyAssoc.CurrentCell;
try
{
if (cc.ColIndex == SlaveColumn)
{
MessageBox.Show(dgrdPartyAssoc[1, 4].Text);
DataRow[] drc = dsParty.Tables[6].Select("[ASSOCIATED_PARTY_NAME] ='" + dgrdPartyAssoc[cc.RowIndex, SlaveColumn].Text + "'");
dgrdPartyAssoc[cc.RowIndex, 5].Text = drc[0][4].ToString();
dgrdPartyAssoc.Refresh();
}
}
catch (Exception ee)
{
}
}
Thanks in advance.
Raul Dsouza
HA
haneefm
Syncfusion Team
June 1, 2007 03:19 PM UTC
Hi Rahul,
To get the new value, you use grid.CurrentCell.Renderer.ControlText.
Best regards,
Haneef
RA
Raul
June 1, 2007 04:24 PM UTC
I am getting the updated text, however on this event I would want to set the text of a particular cell, which is not bieng set. Kindly help.The code i am using is as follows :
GridCurrentCell cc = this.dgrdPartyAssoc.CurrentCell;
try
{
if (cc.ColIndex == SlaveColumn)
{
DataRow[] drc = dsParty.Tables[6].Select("[ASSOCIATED_PARTY_NAME] ='" + dgrdPartyAssoc.CurrentCell.Renderer.ControlText.ToString() + "'");
dgrdPartyAssoc[cc.RowIndex, 5].Text = drc[0][4].ToString();
dgrdPartyAssoc.Refresh();
}
}
Thanks,
Raul
HA
haneefm
Syncfusion Team
June 1, 2007 09:25 PM UTC
Hi Rahul,
You can try this code.
dgrdPartyAssoc.Model[cc.RowIndex, 5].Text = drc[0][4].ToString();
Best regards,
Haneef
RA
Raul
June 4, 2007 07:27 AM UTC
Hi,
I am unable to see the changes on the grid, do I need to do some accept changes ?
DD
Dan Dorey
June 4, 2007 07:25 PM UTC
Hey, I had a similar problem.
Try keying off the CurrentCellEditingComplete event and then see if the new value has been updated in the grid.
Not sure if this even will fire right after you pick something from the drop down however.
>Hi,
I am unable to see the changes on the grid, do I need to do some accept changes ?
HA
haneefm
Syncfusion Team
June 4, 2007 07:45 PM UTC
Hi,
You can cell the EndEdit Method(before calling this , you need to call the CurrentCell''s Edit method) to push all data to underlying datasource in the grid. Here is a code snippet.
For GridDataBoundGrid:
>>>>>>>>>>>>>>>>>>>>>>
this.gridDataBoundGrid1.CurrentCell.EndEdit();
this.gridDataBoundGrid1.Binder.EnableEdit();
this.gridDataBoundGrid1.Refresh()
For GridGroupingControl:
>>>>>>>>>>>>>>>>>>>>>>
e.TableControl.CurrentCell.EndEdit(); //saves the currentcell
e.TableControl.Table.EndEdit();
e.TableControl.Refresh();
Best regards,
Haneef
RA
Raul
June 5, 2007 08:00 AM UTC
Hi Haneef,
I still nt getting the updated value in the grid, I am using the following code :
DataRow[] drc = dsRole.Tables[0].Select("[ASSOCIATED_PARTY_NAME] ='" + dgrdPartyAssoc.CurrentCell.Renderer.ControlText.ToString() + "'");
dgrdPartyAssoc.Model[cc.RowIndex, 5].Text = drc[0][4].ToString();
this.dgrdPartyAssoc.CurrentCell.EndEdit();
this.dgrdPartyAssoc.Binder.EnableEdit = true;
dgrdPartyAssoc.Refresh();
Thanks,
Raul Dsouza
HA
haneefm
Syncfusion Team
June 5, 2007 06:53 PM UTC
Hi Rahul,
Please try to provide us some more information on this issue. I tried to reproduce the issue, but couldn't. kindly provide us a minimal sample to reproduce the issue or modify any of our browser sample accordingly. This will help us to analyse the issue further.
Best regards,
Haneef
RA
Raul
June 7, 2007 08:43 AM UTC
Hi Haneef,
I am using the following Code :
private void dgrdPartyAssoc_CurrentCellCloseDropDown(object sender, Syncfusion.Windows.Forms.PopupClosedEventArgs e)
{
GridCurrentCell cc = this.dgrdPartyAssoc.CurrentCell;
try
{
if (cc.ColIndex == SlaveColumn)
{
dgrdPartyAssoc.Model[cc.RowIndex, 5].Text = "Raul"; // Simplified it
this.dgrdPartyAssoc.CurrentCell.EndEdit();
this.dgrdPartyAssoc.Binder.EnableEdit = true;
dgrdPartyAssoc.Refresh();
}
}
catch (Exception ee)
{
}
}
My requirement is,
I have DGBG which has a master and Slave combobox, Depending On selection of a particular value in Master Combo box, I populate the Slave Combox Box, and on selection of a value of Slave Combobox I need to display a mappping value(For example "Raul") in a cell in the same row of the grid.
in the above code the text "Raul" is nt getting displayed in the grid.
Thanks,
Raul
RA
Raul
June 7, 2007 05:14 PM UTC
Hey Ahneef, Its working Fine Nw.
Thanks,
Raul Dsouza