C1FlexGrid Combobox



我正在尝试根据同一行上的flexgrid中的值填充组合框。但是,它会在弹性网格上的每一行发生变化。我需要根据该行和列填充一个组合框。有什么帮助吗?

据我了解您的问题,您需要在 C1FlexGrid 中放置一个组合框,组合框列表的下拉列表包含每一行元素。将此代码放在要将数据加载到组合框中的位置

Dim dtMap As Specialized.ListDictionary = New Specialized.ListDictionary()
Dim tmpStyle As CellStyle
dtMap.Clear()
For j As Integer = 1 To fgMain.Rows.Count - 1
    For i As Integer = 0 To fgMain.Cols.Count - 1
        dtMap.Add(i , C1FlexGrid1(j ,i))
    Next
Next
tmpStyle =C1FlexGrid1.Styles.Add("Name")
' integer is data type of data selected into ur combobox. here it's the type of i 
' cause i is the key of value in dtMap "every item n ListDictionary dtMap contains key and value"
'so u just change this i and integer to what u need
tmpStyle.DataType = GetType(Integer)
tmpStyle.DataMap = dtMap
C1FlexGrid1.Cols(2).Style = tmpStyle
DbReader.Close()
MyCmd.Dispose()

我希望这对你有帮助

最新更新