Solved

ExtendedDataGrid datasource problem

Posted on 2004-04-22
4
319 Views
Last Modified: 2010-05-18
I am trying to use the third party extendeddatagrid component.  I am using this with vb.net.  I have it working succesfully with an IList, but I am unable to get it to work with an oledb datasource.  It doesn't seem my datasource no matter what I try.  What am I missing?  Any help would be greatly appreciated.  Here is the code I'm using under button1 that works:

Dim SqlString As String

        Dim DS As New DataSet
        Dim ConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\awv binder\DATA\extdatgrid.mdb"
        Dim MyConn As OleDb.OleDbConnection = New OleDb.OleDbConnection(ConnStr)

        SqlString = "SELECT * From customer"

        Dim MyDataAdapter As New OleDb.OleDbDataAdapter(SqlString, MyConn)

        MyDataAdapter.Fill(DS, "customer")

        Dim c1 As New Customer

        c1.Name = DS.Tables("customer").Rows(0).Item("Name")
        c1.Importance = DS.Tables("customer").Rows(0).Item("Importance")
        c1.Description = DS.Tables("customer").Rows(0).Item("Description")

        Dim cust() As Customer = {c1}
        ExtendedDataGrid2.DataSource = cust

        Dim t1 As ProgressBarColumnControl = New ProgressBarColumnControl
        Dim t2 As MultiLineTextBox = New MultiLineTextBox

        Dim ts1 As Leadit.ExtendedDataGrid.ExtendedDataGridTableStyle = New Leadit.ExtendedDataGrid.ExtendedDataGridTableStyle

        ts1.MappingName = ExtendedDataGrid2.DataSource.GetType.Name

        Dim NameCol As DataGridTextBoxColumn = New DataGridTextBoxColumn
        NameCol.MappingName = "Name"
        NameCol.HeaderText = "Name"
        NameCol.Width = 75
        NameCol.ReadOnly = True
        ts1.GridColumnStyles.Add(NameCol)

        Dim ImportanceCol As Leadit.ExtendedDataGrid.ExtendedDataGridControlColumn = New Leadit.ExtendedDataGrid.ExtendedDataGridControlColumn
        ImportanceCol.Control = t1.GetType()
        ImportanceCol.MappingName = "Importance"
        ImportanceCol.HeaderText = "Importance"
        ImportanceCol.Width = 75
        ts1.GridColumnStyles.Add(ImportanceCol)

        Dim DescriptionCol As Leadit.ExtendedDataGrid.ExtendedDataGridControlColumn = New Leadit.ExtendedDataGrid.ExtendedDataGridControlColumn
        DescriptionCol.Control = t2.GetType()
        DescriptionCol.MappingName = "Description"
        DescriptionCol.HeaderText = "Description"
        DescriptionCol.Width = 200
        'DescriptionCol.ReadOnly = True
        ts1.GridColumnStyles.Add(DescriptionCol)

        ts1.PreferredRowHeight = 40
        ExtendedDataGrid2.TableStyles.Add(ts1)

Here is the code under button1 that doesn't work:

Dim SqlString As String

        Dim DS As New DataSet
        Dim ConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\awv binder\DATA\extdatgrid.mdb"
        Dim MyConn As OleDb.OleDbConnection = New OleDb.OleDbConnection(ConnStr)

        SqlString = "SELECT * From customer"

        Dim MyDataAdapter As New OleDb.OleDbDataAdapter(SqlString, MyConn)

        MyDataAdapter.Fill(DS, "customer")

        Dim c1 As New Customer

        c1.Name = DS.Tables("customer").Rows(0).Item("Name")
        c1.Importance = DS.Tables("customer").Rows(0).Item("Importance")
        c1.Description = DS.Tables("customer").Rows(0).Item("Description")

        'Dim cust() As Customer = {c1}
        ExtendedDataGrid2.DataSource = DS
        ExtendedDataGrid2.DataMember = "customer"

        Dim t1 As ProgressBarColumnControl = New ProgressBarColumnControl
        Dim t2 As MultiLineTextBox = New MultiLineTextBox

        Dim ts1 As Leadit.ExtendedDataGrid.ExtendedDataGridTableStyle = New Leadit.ExtendedDataGrid.ExtendedDataGridTableStyle

        ts1.MappingName = "customer"
        'ExtendedDataGrid2.DataSource.GetType.Name()

        Dim NameCol As DataGridTextBoxColumn = New DataGridTextBoxColumn
        NameCol.MappingName = "Name"
        NameCol.HeaderText = "Name"
        NameCol.Width = 75
        NameCol.ReadOnly = True
        ts1.GridColumnStyles.Add(NameCol)

        Dim ImportanceCol As Leadit.ExtendedDataGrid.ExtendedDataGridControlColumn = New Leadit.ExtendedDataGrid.ExtendedDataGridControlColumn
        ImportanceCol.Control = t1.GetType()
        ImportanceCol.MappingName = "Importance"
        ImportanceCol.HeaderText = "Importance"
        ImportanceCol.Width = 75
        ts1.GridColumnStyles.Add(ImportanceCol)

        Dim DescriptionCol As Leadit.ExtendedDataGrid.ExtendedDataGridControlColumn = New Leadit.ExtendedDataGrid.ExtendedDataGridControlColumn
        DescriptionCol.Control = t2.GetType()
        DescriptionCol.MappingName = "Description"
        DescriptionCol.HeaderText = "Description"
        DescriptionCol.Width = 200
        'DescriptionCol.ReadOnly = True
        ts1.GridColumnStyles.Add(DescriptionCol)

        ts1.PreferredRowHeight = 40
        ExtendedDataGrid2.TableStyles.Add(ts1)

Please Help!

0
Comment
Question by:brettawv
  • 3
4 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 10892486
I would try this through a test form in the designer, by creating an OleDbDataAdapter on the form, and doing it through the designer to see if it is possible, and then determining what the flow is to make that work.

Bob
0
 

Author Comment

by:brettawv
ID: 10892573
Sorry I've only been using vb.net for a couple of months.  Can you give me an example.
0
 

Author Comment

by:brettawv
ID: 10893160
I set it up through the forms designer and it still doesn't work.
0
 

Author Comment

by:brettawv
ID: 10893640
OK I got it to work, however it doesn't show up until I click on a grid cell.  Is there a way to have them show up when the grid is filled.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
coded character set iptc field within a jpeg 1 70
Word Directory is not in the drop down list 4 25
Runtime Error 2 28
Connection String 16 43
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now