0

I have a comboboxcell it works just fine . I got the value from a database. The Problem is there is around 100 rows but all are different value. So when i click the combobox it drops a long list. Is there a way to make the list look short but the amount of values display is still 100. here is my comboboxcell code.

    Dim c3 As New DataGridViewComboBoxColumn()

    c3.HeaderText = "Stripes"
    c3.DataSource = BndSrc

    c3.Name = "Stripes"

    c3.DataPropertyName = "Stripes"
    c3.DisplayMember = "Stripes"
    c3.ValueMember = "Stripes"

    c3.DisplayStyleForCurrentCellOnly = False
    c3.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing
    c3.FlatStyle = FlatStyle.Standard
    c3.SortMode = DataGridViewColumnSortMode.Automatic

    Me.DataGrid.Columns.Add(c3)
shaik ibrahim
  • 187
  • 6
  • 11
  • 31

1 Answers1

0

I think you shoud use c3.maxdropdownitems

See http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcolumn.maxdropdownitems.aspx

Raimond Kuipers
  • 1,146
  • 10
  • 18
  • I am aware of that it works but the thing is i stil want them to choose from the 100 drop down values. Is it possible to use a listview as a drop down or a listbox???? because my form size is small and is not re sizable so if the user clicks the drop down it will be longer than the form – shaik ibrahim Jun 21 '13 at 07:53
  • maxdropdownitems only shortens the dropdownbox. all item are still in the dropdown and can be reached through scrolling as far as i know. – Raimond Kuipers Jun 21 '13 at 09:36
  • Perhaps you should set the maxdropdownitems after the binding? – Raimond Kuipers Jun 24 '13 at 06:33
  • did that didnt work. for normal combobox its actually set integral hight to false how ever there is no funtion here in datagrid – shaik ibrahim Jun 24 '13 at 06:43