Using a DataMap is great when every row in a column uses the same data. This is an example of what I've typically used when loading the grid:
strSql = "SELECT * FROM Employee ORDER BY FullName "
sqlCom = New SqlCommand(strSql)
sqlCom.Connection = SQLCon
sqlSearch = sqlCom.ExecuteReader()
Dim empMap As Specialized.ListDictionary = New Specialized.ListDictionary()
If sqlSearch.HasRows Then
While sqlSearch.Read()
empMap.Add(sqlSearch!EmployeeID, sqlSearch!FullName)
End While
vsFlexGrid.Cols("Employee").DataMap = empMap
End If
sqlSearch.Close()
However, how do you handle rows that have different combobox data for the same column? For example, I have two columns: Department and Employee. When you pick a Department all the associated Employees with that specific Department should be loaded into the Employee column’s combobox on that specific row. Another row may have a completely different set of employees. How do I set and retrieve the associated Employee IDs using a DataMap in this type situation while keeping the text portion visible when I move off that row? I imagine I need to use BeforeEdit in some fashion for this to work correctly but am not sure how to go about this.
Any help would be much appreciated. Thanks....