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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to find column and change values in this column?

Thread ID:





77725 Nov 14,2008 07:58 AM UTC Nov 17,2008 07:29 AM UTC WinForms 2
Tags: GridControl
Asked On November 14, 2008 07:58 AM UTC

Hello there

I got a little problem with a grouping grid (version 4.4).
What I want to accomplish:
Use a combobox to select a cell value and via code insert a second value into another cell.

We have some old code which inherits the grouping grid and tries to add this functionality:

for(int i=0;i < this.TableDescriptor.Columns.Count;i++)
if (this.TableDescriptor.Columns[i].Name == "comboBoxColumn")
colIndex = i + 1 + this.TableDescriptor.GroupedColumns.Count;

this.TableControl.Model[this.TableControl.CurrentCell.RowIndex,intBrennstoff].CellValue = "NewValue";

This only works when the visible columns are in the same order as in the TableDescriptor.Columns collection.
Otherwise the indexes of the two collection are different and the code tries to write into the wrong column.

I can't set the cell value through TableDescriptor.Columns and I can't find the right column through TableControl.Model...

Any idea how I can work around this problem?

Replied On November 14, 2008 08:00 AM UTC

Sorry, the last code line should look like this:
this.TableControl.Model[this.TableControl.CurrentCell.RowIndex, colIndex].CellValue = "NewValue";

Jisha Joy [Syncfusion]
Replied On November 17, 2008 07:29 AM UTC

Hi Fabian,

Thank you for posting query to us.

This can be achieved by setting the value by means of Table.CurrentRecord.SetValue method. Please refer the code:

this.gridGroupingControl1.Table.CurrentRecord.SetValue("ColumnName", value);

Please let me know if this helps.



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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon