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.

Problem adding values to a column

Thread ID:





53088 Dec 7,2006 06:28 PM Dec 8,2006 09:43 AM Windows Forms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On December 7, 2006 06:28 PM

I want to do something like the following so I can use an unbound column to hold the row number for a DataSet.Tables["table"].rows.count iteration. I need to use this column as a key source in QueryCellInfo handler. Can you help me please?

for(int i=1; i{
this.myGrid[i, 1].CellValue = i; ?????

Administrator [Syncfusion]
Replied On December 8, 2006 04:55 AM

Take a look at the Grid\Samples\DataBound\MultiHeader sample. It adds an unbound checkbox on the left side and an unbound column on the right side.

The steps are:

1) Add a GridBoundColumn in the GridBoundColumns collection (or Binder.InternalColumns if you have not explicitly added GridBoundColumns). In the sample, search for "Unbound" to see this code.

2) Add some datastructure to hold the data that is to occupy this column. The sample uses a HashTable unboundValues. But you can use any structure you desire.

3) Handle the GridDataBoundGrid.Model.QueryCellInfo event to provide the values to the grid from your second DataTable for your unbound column. See ModelQueryCellInfo in the sample.

4) Handle the GridDataBoundGrid.Model.SaveCellInfo event to save the values from the unbound column to the Hashtable (or whatever object you are using to hold the unbound values). See ModelSaveCellInfo in the sample.

Administrator [Syncfusion]
Replied On December 8, 2006 09:43 AM

Thank you - that put me in the right direction.


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.