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.
Unfortunately, activation email could not send to your email. Please try again.

Updating the cell from External Source

Thread ID:

Created:

Updated:

Platform:

Replies:

64242 Jul 17,2007 08:01 AM Jul 19,2007 03:23 AM Windows Forms 3
loading
Tags: GridControl
Thanvir Hussain
Asked On July 17, 2007 08:01 AM

Hi,

I have attached each cell custom properties with my own model as we are using a MVC architecture in our application. I am able to access my model from the custom cell renderer and update it when ever the cell value changes. But I also want the cell to be updated whenever my model is changed from some external source. My model will raise events whenever something has changed and the view has to be refreshed.

I want to know
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.
2.which will be the appropriate method to call to refresh the cell, once I subscribe to the events fired by the

thanks
thanvir

haneefm [Syncfusion]
Replied On July 17, 2007 05:11 PM

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=64184

2.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

Thanvir Hussain
Replied On July 18, 2007 05:20 AM

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=64184

2.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

Jeba S [Syncfusion]
Replied On July 19, 2007 03:23 AM

Hi Thanvir,

Thank you for your sample.

After the cellmodel has been created, you can try code such as :

FoxDatePickerCellRenderer r = (FoxDatePickerCellRenderer)this.gridControl1.CellRenderers["FoxDatePickerCellModel"];

to get the renderer. Using this renderer you can use the required delegate event handler of the custom control.

Kindly let us know if this helps.

Best Regards,
Jeba.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;