Hi,
Sorry, I think you have got me wrong.
Our application is designed on a MVC architecture. So for every cell we have our own model which maintains the state of the cell. Now if I need to push the data from my model into the cell or refresh the cell when the my model data changes, I need to subscribe to the event raised by my coustom model.
I do the following to set the model to each of the cell.
SyncStyleProperties sp;
sp = new SyncStyleProperties(gridControl1[1, 1]);
gridControl1[1, 1].CellType = "FoxDatePickerCellModel";
gridControl1[1, 1].CellValue = defaultVal ;
sp.Model = new DateOrTenorModel("Test1");
sp.Model.Value = defaultVal;
Now this DateOrTenorModel will raise a event called CurrencyPairChanged which my cell have to subscribe and refresh itself. Please let me know where the cell can subscribe to the event.
I have attached a sample project for your reference which uses a custom date cell model which changes to red when sat or sun are selected.
Regards
thanvir
>Hi Thanvir,
1. Whether I should be able to subscribe the the event from the model from within the custom cell renderer, because now I am creating the customproperties in the form and attaching it to the cell.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
You can subscribe the any of the events from the GridModel within custom cell renderer. See the below forum thread for more details.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=641842.which will be the appropriate method to call to refresh the cell, once I subscribe to the events fired by the
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
You can try calling the Refresh method after handling the event in custom cell renderer of the grid and let me know if this helps.
grid.Refresh() //For refreshing the whole table.
grid.RefreshRange(GridRangeInfo.Cell(2,2)) //For refreshing the range of cells in a grid.
Best regards,
Haneef
DatePickerDemo.zip