Posted 26 February 2018, 5:08 am EST
Hi I am trying to implement two features with the c1TrueDBGrid. I want to retain the formatting (column widths) of the grid and I also want to show the record number in the C1DbNavigator1. In the first instance the data loads fine and the Navigator shows the correct number of records while also showing the correct information. Clicking on a row in the grid will display the corresponding number in the Navigator and clicking on the navigator will move the highlight in the grid to the correct row.
However, the grid loses its formatting.
In the second scenario, the grid retains its layout but the Navigator does nothing other than display that there is one record and that the row is positioned at record 1.
I know I must be missing something simple, but I have spent hours going around in circles on this. So any information on where I am going wrong will be appreciated.
'The common code for loading the data is s…
Dim sql As String = "select top 50 br_cd as brncode,br_name as bname from branches "
Dim da As SqlDataAdapter = New SqlDataAdapter(sql, strSQLConnectionString)
Dim ds As DataSet = New DataSet
da.Fill(ds, “myTable”)
'Common Code Ends…
(1)
Navigator works but holdfields does not
C1TrueDBGrid1.DataSource = ds.Tables(0)
C1DbNavigator1.DataSource = C1TrueDBGrid1.DataSource
(2) However holdfields works but navigator does not
C1TrueDBGrid1.SetDataBinding(ds, "myTable", True) C1DbNavigator1.DataSource = C1TrueDBGrid1.DataSource End Sub Thanks in advance Morke