in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

.NET slow compared with VB6

Last post 09-21-2007 6:46 PM by C1_GregL. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-17-2007 5:25 AM

    .NET slow compared with VB6

    Hi

    Im converting a VB6 application to .NET.  The VB6 app used a VideoSoft Flexgrid control and my VB.NET app uses the Component One Flexigrid.

    When I click a cell in the left most column of my order form I want the drop down to show two columns 'ProductId' and 'Description'.  When I have selected the product I want only the productId displayed in the cell.

    The VB6 app reads from an Access db where as the VB.NET app reads from SQL Server 2005.  The tables have exactly the same info in them (copied from Access to SQL).

    The problem is the VB6 (what the users are used to) shows the list within a second, the VB.NET waits about 7 seconds before the list is shown.

    The code I am using to set up the grid is:

    flgOrders.Cols.Item(PRODUCT_COLUMN).Width = 75
    flgOrders.Item(0, PRODUCT_COLUMN) = "Product Id"

    Dim map As C1.Win.C1FlexGrid.MultiColumnDictionary
    Dim cols() As String = {"ProductId", "Description"}
    map = New C1.Win.C1FlexGrid.MultiColumnDictionary(Me.CreamDS.Product, "ProductId", cols, 0)

    flgOrders.Cols(PRODUCT_COLUMN).DataMap = map

    This actual loading doesnt take a long time, it is showing the products that is unacceptable.

    Can somebody please let me know if there is a better way.

    Thanks

    Darren

     

  • 08-22-2007 4:55 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 515

    Re: .NET slow compared with VB6

    Hi,

    I'm a bit confused, are you loading the drop down (as a grid) or the grid that contains the dropdown?

    You can bind to a datasource code free with .NET. Have you tried setting the datasource property to a datasource that's set up with the two columns you need?

    >>This actual loading doesnt take a long time, it is showing the products that is
    >>unacceptable.

    Is this the dropdown that takes too long?

    Also, setting the FlexGrid.Redraw property to false before populating the grid, and then back to true afterwards is another way to increase performance.


    Regards,
    Greg L
  • 09-07-2007 7:05 AM In reply to

    Re: .NET slow compared with VB6

    Im loading the drop down that shows when I click a cell in the grid.

    So you're saying instead of reading the columns from the products table, create a new table with just the productid and description columns in.  Then bind this to the control?

    Yeah its tha amount of time it takes from clicking in a cell to the drop down showing that is unacceptable.

  • 09-21-2007 6:46 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 515

    Re: .NET slow compared with VB6

    Have you tried using a combo box as the dropdown?  ComponentOne has a C1Combo control that allows you to easily bind it to a data source and it can have multiple columns like a list or a grid.

    Then you can simply set the C1Combo as the column editor for any column in your FlexGrid.  I've attached a sample that demonstrates this.  This may be a faster solution for you than using a grid for the drop down. 

     

    Regards,
    Greg L

    Filed under: , ,
Page 1 of 1 (4 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.