True DBGrid for WinForms - GrapeCity.
![](/uploads/1/2/7/3/127366814/100951634.jpg)
![True True](/uploads/1/2/7/3/127366814/399644984.png)
C1 True DBGrid question
C1 True DBGrid question
I know some of you use this control.I'm testing out C1's grid. I want to take a database and add an unbound column. Simple right?
![Apex true dbgrid Apex true dbgrid](http://helpcentral.componentone.com/docs/c1truedbgrid/ImagesExt/image27_13.png)
No. It seems all of their tutorials use the drag and drop version to set up the dataset. Winms. LOL
I want to do it in code which does not work.
Can someone please take a look for me?
CODE
Open the connection...
sSQL = 'select a,b,c from Agency'
Dim myDataAdapter As New SqlDataAdapter(sSQL, myConnection)
Dim myDataSet = New DataSet
myDataAdapter.Fill(myDataSet, 'agency')
C1TrueDBGrid1.DataSource = myDataSet
C1TrueDBGrid1.DataMember = 'agency'
'This all works by itself
sSQL = 'select a,b,c from Agency'
Dim myDataAdapter As New SqlDataAdapter(sSQL, myConnection)
Dim myDataSet = New DataSet
myDataAdapter.Fill(myDataSet, 'agency')
C1TrueDBGrid1.DataSource = myDataSet
C1TrueDBGrid1.DataMember = 'agency'
'This all works by itself
Now I read:
The UnboundColumnFetch event is raised when a bound needs to display the value of a cell in an unbound column as specified by the Row and Col arguments. For a bound grid, any column with an empty DataField property and a non-empty Caption property is considered an unbound column.
So I added a column in the visual property editor.
CODE
Private Sub C1TrueDBGrid1_UnboundColumnFetch(ByVal sender As System.Object, ByVal e As C1.Win.C1TrueDBGrid.UnboundColumnFetchEventArgs) Handles C1TrueDBGrid1.UnboundColumnFetch
e.value = 'gary'
End Sub
e.value = 'gary'
End Sub
Nothing. In fact the column does not even show up. I think the unbound column conflits with the columns coming off the database, since I did not have to set them up.
Is this right?
Thanks
(So far Infragistics grid is much easer to use and program).
![](/uploads/1/2/7/3/127366814/100951634.jpg)