JJ
Jisha Joy
Syncfusion Team
March 6, 2009 09:39 AM UTC
Hi David,
To add a column which is not bound to the datasource, you need to add the column as an unbound column.
To add an unbound column see the following code,
this.gridGroupingControl1.TableDescriptor.UnboundFields.Add("print");
Then to provide values to the bounded column by handling the QueryValue event. Please see the code:
this.gridGroupingControl1.TableDescriptor.QueryValue += new FieldValueEventHandler
(unboundField_QueryValue);
private void unboundField_QueryValue(object sender, FieldValueEventArgs e)
{
int RecordIndex
=this.gridGroupingControl1.Table.PrimaryKeySortedRecords.IndexOf(e.Record);
if (e.Field.Name == "print" && RecordIndex>=0)
{
e.Value= "value";
}
}
Please let me know if this helps.
Regards,
Jisha