Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Using large lookup table

Using large lookup table

Scheduled Pinned Locked Moved C#
csharpwinformstutorialquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndrusM
    wrote on last edited by
    #1

    I'm creating C# MONO/.NET 2 Winforms application. I need to enter part names but store part ids in orders table. I set Combobox Datasource to parts table. Since parts table is very big, it takes a lot of time to load the data source. How to use lookup table when lookup table is large ? Is it possible to use virtual combobox or some other control?

    Andrus

    C S 2 Replies Last reply
    0
    • A AndrusM

      I'm creating C# MONO/.NET 2 Winforms application. I need to enter part names but store part ids in orders table. I set Combobox Datasource to parts table. Since parts table is very big, it takes a lot of time to load the data source. How to use lookup table when lookup table is large ? Is it possible to use virtual combobox or some other control?

      Andrus

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Use a hashtable. How big are we talking ?

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      A 1 Reply Last reply
      0
      • C Christian Graus

        Use a hashtable. How big are we talking ?

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        A Offline
        A Offline
        AndrusM
        wrote on last edited by
        #3

        Thank you. I asked for a WinForms control like which shows first 10 parts whose name starts with entered name. User can scroll and see next or previous 10 part names. In this case combobox should ask next 10 rows from server etc. Total table size is from 100 .. 500000 record depending on the user and it is not reasonable to load it as combobox lookup table during combobox creation like ms doc sample recommends. Hashtable is not UI control and cannot used for this. This should be common requirement. Where to find code which implements this ?

        Andrus

        C 1 Reply Last reply
        0
        • A AndrusM

          Thank you. I asked for a WinForms control like which shows first 10 parts whose name starts with entered name. User can scroll and see next or previous 10 part names. In this case combobox should ask next 10 rows from server etc. Total table size is from 100 .. 500000 record depending on the user and it is not reasonable to load it as combobox lookup table during combobox creation like ms doc sample recommends. Hashtable is not UI control and cannot used for this. This should be common requirement. Where to find code which implements this ?

          Andrus

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Ah, OK. I thought you wanted to look up values and then display them.

          AndrusM wrote:

          This should be common requirement.

          I don't think it is. I know that comboboxes offer auto complete, perhaps you can find something there ? I'm not sure if it works with a callback, or just a data source.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

          A 1 Reply Last reply
          0
          • A AndrusM

            I'm creating C# MONO/.NET 2 Winforms application. I need to enter part names but store part ids in orders table. I set Combobox Datasource to parts table. Since parts table is very big, it takes a lot of time to load the data source. How to use lookup table when lookup table is large ? Is it possible to use virtual combobox or some other control?

            Andrus

            S Offline
            S Offline
            ShermansLagoon
            wrote on last edited by
            #5

            To me it sounds like you should have a BackgroundWorker that will load the data in small pieces and then add them (when possible, or by request) to the combo box. I am wondering weather you really need a combo box though.. Wouldn't a ListView be better?

            Internet - the worlds biggest dictionary

            A 1 Reply Last reply
            0
            • C Christian Graus

              Ah, OK. I thought you wanted to look up values and then display them.

              AndrusM wrote:

              This should be common requirement.

              I don't think it is. I know that comboboxes offer auto complete, perhaps you can find something there ? I'm not sure if it works with a callback, or just a data source.

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

              A Offline
              A Offline
              AndrusM
              wrote on last edited by
              #6

              for auto-complete combobox need to read whole lookup table in init which is not reasonable for large tables. I'm looking for a virtual combobox control which reads data from sql server only when user actually needs it.

              Andrus

              1 Reply Last reply
              0
              • S ShermansLagoon

                To me it sounds like you should have a BackgroundWorker that will load the data in small pieces and then add them (when possible, or by request) to the combo box. I am wondering weather you really need a combo box though.. Wouldn't a ListView be better?

                Internet - the worlds biggest dictionary

                A Offline
                A Offline
                AndrusM
                wrote on last edited by
                #7

                Backgroundworker is too complicated for this task. Usually user type first characters of name and want to see 10 matching character. It is best that control reads data only from server when user requestes autocomplete or opens dropdown menu. ListView takes a lot of screen space. I need singe-line width field, autocomplete and selection from dropdown table. I think that combobox nearest to those requirements

                Andrus

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups