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

Problem adding values to a column

Thread ID:





53088 Dec 7,2006 11:28 PM UTC Dec 8,2006 02:43 PM UTC WinForms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On December 7, 2006 11:28 PM UTC

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 09:55 AM UTC

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 02:43 PM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the 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