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. Windows Forms
  4. How to Display the Value in the DataGridViewComboBox without having the Item [modified]

How to Display the Value in the DataGridViewComboBox without having the Item [modified]

Scheduled Pinned Locked Moved Windows Forms
csharphelptutorial
8 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.
  • S Offline
    S Offline
    Soma Shekhar
    wrote on last edited by
    #1

    Hi, I am new to the Visual C#, I have an application where I need to create the Combobox cells in the DatagridViewcolumn. I am able create the Comboboxes dynamically by replacing the DataGridviewTextBoxColumn Cell. The static Data to be updated in the ComboBox is from the dbc File, which can have any number of items. Here let us take 2 items from the dbc file, there is another source in the same datagrid from different column which data should be reflected in the ComboBox Cell but the items shall not be added, the only value shall be displayed in the combobox cell. Please help me:confused:.

    modified on Tuesday, August 19, 2008 2:21 PM

    S 1 Reply Last reply
    0
    • S Soma Shekhar

      Hi, I am new to the Visual C#, I have an application where I need to create the Combobox cells in the DatagridViewcolumn. I am able create the Comboboxes dynamically by replacing the DataGridviewTextBoxColumn Cell. The static Data to be updated in the ComboBox is from the dbc File, which can have any number of items. Here let us take 2 items from the dbc file, there is another source in the same datagrid from different column which data should be reflected in the ComboBox Cell but the items shall not be added, the only value shall be displayed in the combobox cell. Please help me:confused:.

      modified on Tuesday, August 19, 2008 2:21 PM

      S Offline
      S Offline
      Soma Shekhar
      wrote on last edited by
      #2

      Is there a way to Filter the DataGridViewComboBoxCell Items from the Display. Please give any clues.

      SomaShekhar

      L 1 Reply Last reply
      0
      • S Soma Shekhar

        Is there a way to Filter the DataGridViewComboBoxCell Items from the Display. Please give any clues.

        SomaShekhar

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #3

        Soma Shekhar wrote:

        Is there a way to Filter the DataGridViewComboBoxCell Items from the Display.

        Yes

        Soma Shekhar wrote:

        Please give any clues.

        You can filter the DataSource[^]

        led mike

        S 1 Reply Last reply
        0
        • L led mike

          Soma Shekhar wrote:

          Is there a way to Filter the DataGridViewComboBoxCell Items from the Display.

          Yes

          Soma Shekhar wrote:

          Please give any clues.

          You can filter the DataSource[^]

          led mike

          S Offline
          S Offline
          Soma Shekhar
          wrote on last edited by
          #4

          mike Thanks for your help. Using DataSource, DisplayMember, and ValueMember we can Filter. I have an application where I have a NumericUpDownCell in the Column1 and ComboBox Cell in Column2 both are created Run time. I need to Display what ever the value updating in the NumericUpDownCell in the ComboBox Cell, but when user selects the ComboBox Cell in the Drop Down view only the item from the File needs to be displayed how can I acheive this. Example : I need to Display 0 to 254 in ComboBox Cell when updating the NumericUpdown. When user selects the ComboBox I need to show only 255 rest of the values shall not be shown in the Drop Down list. Please provide a snippet of VC# code :) .

          SomaShekhar

          L 1 Reply Last reply
          0
          • S Soma Shekhar

            mike Thanks for your help. Using DataSource, DisplayMember, and ValueMember we can Filter. I have an application where I have a NumericUpDownCell in the Column1 and ComboBox Cell in Column2 both are created Run time. I need to Display what ever the value updating in the NumericUpDownCell in the ComboBox Cell, but when user selects the ComboBox Cell in the Drop Down view only the item from the File needs to be displayed how can I acheive this. Example : I need to Display 0 to 254 in ComboBox Cell when updating the NumericUpdown. When user selects the ComboBox I need to show only 255 rest of the values shall not be shown in the Drop Down list. Please provide a snippet of VC# code :) .

            SomaShekhar

            L Offline
            L Offline
            led mike
            wrote on last edited by
            #5

            Soma Shekhar wrote:

            Using DataSource, DisplayMember, and ValueMember we can Filter.

            No. Using whatever you used for the DataSource you filter the items.

            led mike

            S 1 Reply Last reply
            0
            • L led mike

              Soma Shekhar wrote:

              Using DataSource, DisplayMember, and ValueMember we can Filter.

              No. Using whatever you used for the DataSource you filter the items.

              led mike

              S Offline
              S Offline
              Soma Shekhar
              wrote on last edited by
              #6

              Hi mike, My application is some thing like threre are 2 datagridviews 1 with main data and the second displays the if any sub items in the main item. sub items can be value range, few selections, true or false type. In the second gridview I have NumericUpDownCell, ComboBox Cell. In the Sub Items there are only 2 values for the comboBox but the range of values can be 0 to 255, so when user selects ComboBox I need to display 0 ("Initial Value") and 255 ("Invalid Value"). When NumericUpdOwn is selected I have to increment/decrement values range from 0 to 255 and the 1 to 254 shall display in the ComboBox. I have done some mimik based on your input but differently. When ComboBox is selected I have removed the rest of the items, if there is no event selectionchanged I have restored the item, but it causes a blank ComboBox for a short duration.

              SomaShekhar

              L 1 Reply Last reply
              0
              • S Soma Shekhar

                Hi mike, My application is some thing like threre are 2 datagridviews 1 with main data and the second displays the if any sub items in the main item. sub items can be value range, few selections, true or false type. In the second gridview I have NumericUpDownCell, ComboBox Cell. In the Sub Items there are only 2 values for the comboBox but the range of values can be 0 to 255, so when user selects ComboBox I need to display 0 ("Initial Value") and 255 ("Invalid Value"). When NumericUpdOwn is selected I have to increment/decrement values range from 0 to 255 and the 1 to 254 shall display in the ComboBox. I have done some mimik based on your input but differently. When ComboBox is selected I have removed the rest of the items, if there is no event selectionchanged I have restored the item, but it causes a blank ComboBox for a short duration.

                SomaShekhar

                L Offline
                L Offline
                led mike
                wrote on last edited by
                #7

                I'm having a difficult time understanding what your requirements are. For this reason I cannot suggest a specific solution. However in general, for cases that might require more complicated behavior a custom column might be a good solution.

                led mike

                S 1 Reply Last reply
                0
                • L led mike

                  I'm having a difficult time understanding what your requirements are. For this reason I cannot suggest a specific solution. However in general, for cases that might require more complicated behavior a custom column might be a good solution.

                  led mike

                  S Offline
                  S Offline
                  Soma Shekhar
                  wrote on last edited by
                  #8

                  Mike, Thanks for your guidence, I will check it out, mean while what i did was I have added a Item when the value is changed in the Numericupdowncell and removed when combobox is selected. Now it is working fine.

                  SomaShekhar

                  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