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.

How to find column and change values in this column?

Thread ID:

Created:

Updated:

Platform:

Replies:

77725 Nov 14,2008 02:58 AM Nov 17,2008 02:29 AM Windows Forms 2
loading
Tags: GridControl
Fabian
Asked On November 14, 2008 02:58 AM

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?



Fabian
Replied On November 14, 2008 03:00 AM

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 02:29 AM

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.

Regards,
Jisha






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.

;