我正在尝试根据同一行上的flexgrid中的值填充组合框。但是它会在flexgrid上每行更改。我需要填充基于该行和列的组合框。有什么帮助吗?
答案 0 :(得分:0)
据我所知你的问题你需要在你的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()
我希望这会对你有所帮助