Morning all,
Strange one here. I would like to use the grid for a list of rpt filters that the user can choose from.
Theres about 40 of the buggers. Some are simple text/numeric values user types in. But a few are Drop down lists the user can choose a value from. Thing is these lists have different values depending on the filter they choose to work on.
So ? is can I have a column where the drop down combobox in the cell can have different values depending on the row we are on.
Hope that makes sense.
Thanks
Deasun.
Hi Deasun,
Yes. You can set teh ValueList property on the cell instead of on the column.
Or, you can use a single UltraDropDown control as the ValueList for the column, but then use ColumnFilters to dynamically filter out the values based on the current row.
Thanks for the reply.
I don't think I made myself fully clear. In the column that would have the drop down combo boxes in it. the list of items would not be the same for each cobobox. They don't all have the same items listed for the same source.
What I take from what your saying is the combox list would have all the possible items and you'd then filter out the ones you don't want to appear depending on the row your on, correct?
Would this be done in the row init event?
What would the VB code look like for: "You can set teh ValueList property on the cell instead of on the column. "
I think I have the solution!
Private Sub uwGrid_RptFilters_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Handles uwGrid_RptFilters.InitializeRow
Me.Cursor = Cursors.WaitCursor
Try
Case "DDL"
If (e.Row.Cells("Value/Choices").Tag = "GotList") Then
Else
objDDL = objTools.DBuwEdComboInit(objDDL, ("EXEC " & e.Row.Cells("ChoicesSource").Text), "test", "Me")
e.Row.Cells("Value/Choices").Tag = "GotList"
End If
Case Else
End Select
End Try
End Sub
This fills in each DDL combobox with its individual items list. And should only do it once for each item on first init of grid.
Yes, this is essentially the approach I meant when I suggested setting the ValueList on the Cell instead of the Column.
I would recommend using the ValueList property of the Cell and attachhing a ValueList to it. This will be much more efficient thn creating multiple UltraComboEditor controls.
This article may provide more information: HOWTO:What is the best way to place a DropDown list in a grid cell?
Also, it's probably a good idea to re-use the same ValueList for any cell that has the same list of options, rather than creating a new list for every cell.