We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridControl, MonthCalendar, BindingContext

I have multiple cells in a GridControl that are of type MonthCalendar. Certain of these are assigned the same DateTime object in the CellValue, and if one is changed, the others with the same value should also change. (But ideally these latter would not fire a SaveCellInfo event.) I have made one attempt to make this happen by creating a new BindingContext(), then assigning it to the CellModel.BindingContext for all related cells. However, this had no effect. Any suggestions?

1 Reply

AD Administrator Syncfusion Team June 17, 2003 07:50 AM UTC

Because of the Control sharing architecture used by the grid cells (ie, there is 1 MonthCalendar control shared among all cells of MonthCalendar type), I don't think 'Control.BindingContext functionality' will work here. Instead, I would try to use the grid's QueryCellInfo and SaveCellInfo events to bind all the cells to the common value. Here is how you might go about. Choose one of the cells to be the master cell (the one that will actually hold the value) and think of the other cells as being slave cells. In QueryCellInfo, if e.RowIndex and e.ColIndex point to one of your slave cells, set e.Style.CellValue = grid[masterRow, masterCol].CellValue. In SaveCellInfo, if e.RowIndex and e.ColIndex point to one of your slave cells, set grid[masterRow, masterCol].Cellvalue = e.Style.CellValue. I think this should do it though I did not actually try it to see if I missed anything.

Loader.
Up arrow icon