I'm converting a project from VB6 to VB.net. I use to use the 'UltraGrid' and ran into trouble where in VB.NET the cells in an axUltraGrid can't be edited. So I am attempting to replace with UltraWinGrid.
However I'm having issues binding my data to the grid. All data binding happens in code so to there are no form objects for datasources or any of that jazz.
==
dim adors as new adodb.recordset
adors.open "SELECT * FROM Accounts", CONN
ultragrid1.datasource = adors
===
What I get is a grid showing me the adodb properties. I tried messing with Infragistics.Win.UltraWinDataSource.UltraDataSource and System.Windows.Forms.BindingSource attaching them to the adors, without success.
Any suggestions / pointers?
Hi,
The DataBinding model in DotNet is different than in VB6. You need to bind the grid to a DataSource that implements the IBindingList or IList interface.
If you are getting your data from SQL, then the standard would be to use a DataSet or DataTable, which are the most common data source objects used in the DotNet Framework.
Thanks. I got it working, like you suggested I used System.Data.SqlClient.SqlDataAdapter
Now for multi-band 'Heirical' recordsets, I am using the System.Data.OleDb.OleDbConnection / System.Data.OleDb.OleDbDataAdapter.
A few initial problems. The band names went from the table name to 'table' + 'table' + 'table'.
so if I have a 3 dimensional shape (select * from tblMyTable1 .... relate tblMyTable2.... relate tblMyTable3.. my band name is nolonger
With .Bands.Item("table3") but is now
With .Bands.Item("tabletblMyTable1tblMyTable2tblMyTable3")
Very annoying.
And secondly it appears all band columns are the same width. If I resize the 2nd bands 2nd column it resizes all 2nd columns. Is there a property to 'break this up' that I am overlooking?