Solved

ExtendedDataGrid datasource problem

Posted on 2004-04-22
4
320 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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 document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

785 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