AD
Administrator
Syncfusion Team
May 19, 2006 12:55 PM UTC
Hi Borja,
You need to handle grid''s CurrentCellValidating event for validating the Control cell type. But it does n''t fire internally. You need to handle CurrentCell.IsModified flag properly. Without setting the CurrentCell.IsModified = true, your saveCellInfo is not called when you leave the cell the control which means your changes were not being saved in the grid. SaveCellInfo event fires the CurrentCellValidating Event. Please try this code in CurrentcellMoving Event.
private void gridDataBoundGrid1_CurrentCellMoving(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellMovingEventArgs e)
{
GridCurrentCell cc =this.gridDataBoundGrid1.CurrentCell;
if(cc.RowIndex == 1 && cc.ColIndex == 1)
{
cc.IsModified = true;
}
}
private void gridDataBoundGrid1_CurrentCellValidating(object sender, System.ComponentModel.CancelEventArgs e)
{
//Validate the comboBox here.
MessageBox.Show(e.ToString());
}
Here is a sample.
http://www.syncfusion.com/Support/user/uploads/dataBoundCombo_a138d1cf.zip
Let me know if you have any more questions.
Regards,
Haneef
BO
Borja
May 22, 2006 07:42 AM UTC
Thank you Haneef, it''s a little bit tricky, but it worked.
I''ve seen the attribute IsModified in other posts, but i haven''t realized its right use.
I have a few more questions, but, probably, it would be better to create new posts (since are not related to this one).
Thank you again.