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. ComboBox not autoresizing on rebind of datasource

ComboBox not autoresizing on rebind of datasource

Scheduled Pinned Locked Moved C#
helpquestionworkspace
5 Posts 2 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.
  • P Offline
    P Offline
    Paul B
    wrote on last edited by
    #1

    Hey all, Got an interesting problem where I'm using a cascaded combobox type setup, with the second combobox's IntegralHeight property set to true so that it should resize itself relative to the contents of the items list. However, it's not doing this and I'm stumped. I don't think I should have to go ownerdraw in order for this to work, so can anyone suggest a reason why it might not be working? FYI I am rebinding the combobox datasource to a datatable each time the "master" combobox value changes.

    C 1 Reply Last reply
    0
    • P Paul B

      Hey all, Got an interesting problem where I'm using a cascaded combobox type setup, with the second combobox's IntegralHeight property set to true so that it should resize itself relative to the contents of the items list. However, it's not doing this and I'm stumped. I don't think I should have to go ownerdraw in order for this to work, so can anyone suggest a reason why it might not be working? FYI I am rebinding the combobox datasource to a datatable each time the "master" combobox value changes.

      C Offline
      C Offline
      CodingYoshi
      wrote on last edited by
      #2

      If you set the DropDownHeight property, this resets the IntegralHeight to false. Make sure you have not done so.

      CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07

      P 1 Reply Last reply
      0
      • C CodingYoshi

        If you set the DropDownHeight property, this resets the IntegralHeight to false. Make sure you have not done so.

        CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07

        P Offline
        P Offline
        Paul B
        wrote on last edited by
        #3

        Yep, double-checked that I haven't. Any other ideas?

        C 1 Reply Last reply
        0
        • P Paul B

          Yep, double-checked that I haven't. Any other ideas?

          C Offline
          C Offline
          CodingYoshi
          wrote on last edited by
          #4

          What about if you set the DropDownHeight after it is bound?

          CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07

          P 1 Reply Last reply
          0
          • C CodingYoshi

            What about if you set the DropDownHeight after it is bound?

            CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07

            P Offline
            P Offline
            Paul B
            wrote on last edited by
            #5

            I've checked the code for any instances where the DropDownHeight is being set, and there aren't any - neither in the *.designer.cs or the main class *.cs file... which according to MSDN means that the width should resize if IntegralHeight is set to true (which is apparently the default but I'm setting it manually just in case). Is there nothing like a Refresh() or Invalidate() that I can call to force it to re-evaluate it's contained items automatically? I really don't want to have to resort to OwnerDrawn to sort this out...

            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