Solved

ExtendedDataGrid datasource problem

Posted on 2004-04-22
4
318 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
Comment Utility
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
Comment Utility
Sorry I've only been using vb.net for a couple of months.  Can you give me an example.
0
 

Author Comment

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

Author Comment

by:brettawv
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

11 Experts available now in Live!

Get 1:1 Help Now