I am attempting to set up a datagrid that will 1) display a subset of data
from a SQL Stored Procedure in a different order form how SQL returns it,
and 2) display 3 of the columns using pulldowns. I have gotten code for
both from the www.syncfusion.com site, but am having trouble making them
work. Below is the relevant code:
' Setup the permissions grid
' Fill the dataset of permissions
Dim dt As DataTable = dsUserData.Tabl es(0)
' Remove the table columns we don't want to have in the grid
dt.Columns.Remo veAt(5)
dt.Columns.Remo veAt(5)
dt.Columns.Remo veAt(5)
dt.Columns.Remo veAt(5)
dt.Columns.Remo veAt(5)
dt.Columns.Remo veAt(5)
dt.Columns.Remo veAt(5)
dt.Columns.Remo veAt(5)
dt.Columns.Remo veAt(5)
dt.Columns.Remo veAt(5)
dt.Columns.Remo veAt(0)
dt.Columns.Remo veAt(0)
Dim tableStyle As New DataGridTableSt yle
tableStyle.Mapp ingName = "permission s"
' Setup the Subsystems column
Dim TextCol As New DataGridTextBox Column
TextCol.Mapping Name = dt.Columns(3).C olumnName
TextCol.HeaderT ext = dt.Columns(3).C olumnName
tableStyle.Grid ColumnStyles.Ad d(TextCol)
' Setup the permissions columns
Dim i As Integer
For i = 0 To 2
Dim ComboTextCol As New DataGridComboBo xColumn
ComboTextCol.Ma ppingName = dt.Columns(i).C olumnName
ComboTextCol.He aderText = dt.Columns(i).C olumnName
ComboTextCol.Wi dth = 120
ComboTextCol.Co lumnComboBox.It ems.Clear()
ComboTextCol.Co lumnComboBox.It ems.Add("0")
ComboTextCol.Co lumnComboBox.It ems.Add("1")
ComboTextCol.Co lumnComboBox.It ems.Add("3")
ComboTextCol.Co lumnComboBox.It ems.Add("7")
' ComboTextCol.Co lumnComboBox.It ems.Add("No Access")
' ComboTextCol.Co lumnComboBox.It ems.Add("Guest" )
' ComboTextCol.Co lumnComboBox.It ems.Add("Operat or")
' ComboTextCol.Co lumnComboBox.It ems.Add("Manage r")
tableStyle.Pref erredRowHeight =
ComboTextCol.Co lumnComboBox.He ight + 2
tableStyle.Grid ColumnStyles.Ad d(ComboTextCol)
Next
grdPermissions. TableStyles.Cle ar()
grdPermissions. TableStyles.Add (tableStyle)
grdPermissions. DataSource = dt
' MsgBox(grdPermi ssions.TableSty les(0).MappingN ame)
dsUserData is already setup and is being used to also fill some text boxes
on the form, so I know that it is fine, and I have as part of my project the
DataGridComboBo xColumn.vb class that is defined in the syncfusion web site.
From what I have been able to find, the "Setup Subsystems" section should
make that column be the first in the grid because it is defined first in the
TableStyle, but it is showing up last (as it was in the original dataset).
Also, the 3 column that are setup under "Setup the permissions columns" are
showing up as simple text boxes, not as combo boxes. Can anyone see what I
am doing wrong here?
TIA
Ron L