So I got to enable an UltraDropDown in grid. But the dropdownlist is in grid format. I would like to have normal dropdownlist. I tried ComboBox with style of DropDownList but since this is Windowns.Form, it doesn't implement IValueList. So instead of mocking with styles, hidding columns, etc, is it possible to derive a new control class from ComboBox and implement IValueList?
http://forums.infragistics.com/forums/t/22599.aspx
Above link is ok but the width of the dropdownlist doesn't look good and it just doesn't have normal ddl look.
Thank you.
You can use a ValueList.
HOWTO:What is the best way to place a DropDown list in a grid cell?
Mike,
So I tried ValueList. Visually it works like a dropdownlist. But with example given, the ValueList is, again, global to the grid. So I need further help. Here is what I have so far.
Private Sub UltraGridTest_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Handles UltraGridTest.InitializeRow
'''' some e.Row.Cells appearance setup Dim ddl As ValueList
Dim strTest As String = "TestValue" & e.Row.Cells("TestID").Value.ToString()
If (Not Me.UltraGridTest.Layouts(0).ValueLists.Exists(strTest)) Then ddl = Me.UltraGridTest.Layouts(0).ValueLists.Add(strTest)
For Each obj As TestObject In Me.GetTestObject(e.Row.Cells("TestID").Value, e.Row.Cells("TestID2").Value, e.Row.Cells("TestID3").Value) ddl.ValueListItems.Add(obj.MyID, obj.MyName) Next
End If
End Sub
As you can see I need ValueList unique to each row with parameters from other columns. Currently I'm stuck with getting ValueList for entire grid so that I can uniquely identify each of them. The Layout(0) is throwing out error with invalid index. How do I check for existance of each ValueList and then add as necessary?
Thanks again.
Hi,
Oh, okay. I didn't notice anything in your original post about needing a different ValueList on each row.
What you would do in that case is use the InitializeRow event. This event fires for each row in the grid and also when any value in the row changes. So it's ideally suited to applying appearances or doing calculations on a cell based on the other values in the same row. And it should also be ideal for changing the ValueList of a cell based on other values in the same row.
You can examine the row and any of it's cells and then assign a ValueList to the Cell, rather than to the entire column.
It also sounds like you might want to look at this article:
Creating a dropdown list in a grid cell whose list values are dependent on another cell - Windows Forms - Infragistics Community
Ops, I found out. I'm now using DisplayLayout.
Sorry for the late response. It took a detour to make it work with ValueList.
How do I access Layout.ValueList from InitializeRow event? I used Me.UltraGridTest.Layouts(0).ValueList and it throws "out of index" error.
Thanks.