Updating expression fields in GridGroupingControl

Hi,

I''m trying to do something fairly basic, but can''t find the documentation on how to do it.

I''m using a GridGroupingControl (bound to an underlying DataTable), and I''d like to have certain columns on a row update depending on values entered into another column. In the attached screenshot, I can modify the target %. The progress bar depends on a calculation involving that target % (so I''m using an ExpressionFieldDescriptor), and I''d like it to reflect the new values whenever the target % is changed.

In the account targets groupbox above the grid, I have three textboxes which show a sum of the values in the grid. These numbers should also change whenever a target % is modified in the grid.

What listeners or other method calls do I need to set up for this? And why don''t the epxression fields automatically pick up the changes in the grid?

If you have a working code example or can point me to where this is already explained, I''d appreciate it.

Thanks,
Michael

GGCExpressions.zip

2 Replies

AD Administrator Syncfusion Team September 19, 2006 10:05 AM UTC

Hi Michael,

The reason is that you are not setting the ProgressBar.ProgressValue property in a ProgressBar cell. The ExpressionFields does set the CellValue depending on values entered into required column in a Table (It doesn''t set the ProgressBar.Progress property). For changing the ProgressBar cell display value, you need to set the ProgressBar.ProgressValue property in the QueryCellStyleInfo. Below is a code snippet.

private void gridQueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if( e.TableCellIdentity.Column != null && e.TableCellIdentity.Column.Name == "Expression" && e.Style.CellType == "ProgressBar")
{
if( e.Style.CellValue != null)
{
int progressValue = int.Parse(e.Style.CellValue.ToString());
e.Style.ProgressBar.ProgressValue = progressValue;
}
}
}

Sample : http://www.syncfusion.com/Support/user/uploads/ExpressionProgressBar_38d946a4.zip

Let me know if you are looking something different.

Best Regards,
Haneef


ML Michael Lorenz September 19, 2006 11:04 PM UTC

Hi Haneef,

That was pretty much it, yeah. Your clarification also helped me get rid of another weird behaviour, where only alternate rows were getting updated properly. ;-)

Thanks a lot,
Michael

Loader.
Up arrow icon