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.

Refreshing the cell

Thread ID:

Created:

Updated:

Platform:

Replies:

64792 Jul 24,2007 04:43 AM Jul 24,2007 02:32 PM Windows Forms 1
loading
Tags: GridControl
Thanvir Hussain
Asked On July 24, 2007 04:43 AM

Hi,
I have a custom cell renderer which subscribes to some events and in the handler I need to refresh the cell. I do the following to add the handlers
GenNextDateOrTenorModel dtmodel = (GenNextDateOrTenorModel) model;
SyncDatePickerCellRenderer r = (SyncDatePickerCellRenderer)this.m_Grid.CellRenderers["SyncDatePickerCell"];
dtmodel.BaseCCYChanged += new CCYChange(r.CurrencyChangedHandler);
dtmodel.TermCCYChanged += new CCYChange(r.CurrencyChangedHandler);

Now in the handler I can call this.Grid.Refresh()

public void CurrencyChangedHandler(string oldCCY, string newCCY)
{
// this.Grid.RefreshRange(GridRangeInfo.Cells(this.RowIndex, this.ColIndex, this.RowIndex, this.ColIndex));
System.Diagnostics.Trace.WriteLine("Refresh Called");
this.Grid.Refresh();
}

But instead of refreshing the entire Grid I need to refresh that cell alone using the RefreshRange function, but the rowindex and colindex are not set when I come into the handler code. Can you please let me know how to do this?

thanks in advance
thanvir

haneefm [Syncfusion]
Replied On July 24, 2007 02:32 PM

Hi Thanvir,

You can get the RowIndex and ColIndex using the Grid.PointToRowCol method. Below are the code snippet

public void CurrencyChangedHandler(string oldCCY, string newCCY)
{
int row, col;
if(this.Grid.PointToRowCol(System.Windows.Forms.Control.MousePosition , out row, out col) && row == 0 && col > 0)
{
this.Grid.RefreshRange(GridRangeInfo.Cell(row,col));
}
}

Best regards,
Haneef

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.

;