J
Jim Ptak via .NET 247
I am desperate for help. I am at a loss. I have a dataset with 4columns in it. The first column is an actual column from adatabase table. The last three columns are hard codded values of0. I am using this dataset to populate a datagrid. The datagridhas a datagridtablestyle that has all four columns with the lastthree being DataGridBoolColumn's. This works great when I hit aSQL Server database. When I hit an Oracle database thecheckboxes are always grey and checked as if they are recievinga null value. I am beating my head against the wall. If anyonehas an answer please help. I have provided all pertinent codebelow.
In the OnLoad event of my control which has the datagrid on it Iput the DataGridTableStyle on the datagrid.
' Add a GridTableStyle
Dim tsSecurity As New DataGridTableStyle
tsSecurity.MappingName = "OBVIENT.OBV_WEB_PARTS"
tsSecurity.RowHeadersVisible = False
' Add a GridColumnStyle
Dim tcWebPart As New DataGridTextBoxColumn
tcWebPart.MappingName = "PRT_NAME"
tcWebPart.HeaderText = "Web Part"
tcWebPart.Alignment = HorizontalAlignment.Left
tcWebPart.ReadOnly = True
tcWebPart.Width = 175
tsSecurity.GridColumnStyles.Add(tcWebPart)
Dim tcAccess As New DataGridBoolColumn
tcAccess.MappingName = "ACCESSWP"
tcAccess.HeaderText = "Access"
tcAccess.Alignment = HorizontalAlignment.Center
tcAccess.AllowNull = False
tcAccess.ReadOnly = True
tcAccess.NullValue = False
tcAccess.TrueValue = True
tcAccess.FalseValue = False
tcAccess.Width = 75
tsSecurity.GridColumnStyles.Add(tcAccess)
Dim tcViewNotes As New DataGridBoolColumn
tcViewNotes.MappingName = "VIEWNOTES"
tcViewNotes.HeaderText = "View Notes"
tcViewNotes.Alignment = HorizontalAlignment.Center
tcViewNotes.AllowNull = False
tcViewNotes.ReadOnly = True
tcViewNotes.NullValue = 0
tcViewNotes.TrueValue = 1
tcViewNotes.FalseValue = 0
tcViewNotes.Width = 75
tsSecurity.GridColumnStyles.Add(tcViewNotes)
Dim tcEditNotes As New DataGridBoolColumn
tcEditNotes.MappingName = "EDITNOTES"
tcEditNotes.HeaderText = "Edit Notes"
tcEditNotes.Alignment = HorizontalAlignment.Center
tcEditNotes.AllowNull = False
tcEditNotes.ReadOnly = True
tcEditNotes.NullValue = 0
tcEditNotes.TrueValue = 1
tcEditNotes.FalseValue = 0
tcEditNotes.Width = 75
tsSecurity.GridColumnStyles.Add(tcEditNotes)
In the event where I bind my datagrid I have the following:
' Build the query with place holders for thepermissions.
strQuery = "SELECT PRT_NAME,0 ACCESSWP,0 VIEWNOTES,0EDITNOTES FROM OBVIENT.OBV_WEB_PARTS WHERE 1=1 "
adaptor = New OleDbDataAdapter(strQuery, oConn)
adaptor.Fill(dsAny, "OBVIENT.OBV_WEB_PARTS")
dgWebParts.DataSource =dsAny.Tables("OBVIENT.OBV_WEB_PARTS")
allowNewFalse(dgWebParts, BindingContext)
This works great against SQL Server and the check boxes performas expected. In Oracle the check boxes are always greyed out andchecked. Any help would be greatly appreciated.
In the OnLoad event of my control which has the datagrid on it Iput the DataGridTableStyle on the datagrid.
' Add a GridTableStyle
Dim tsSecurity As New DataGridTableStyle
tsSecurity.MappingName = "OBVIENT.OBV_WEB_PARTS"
tsSecurity.RowHeadersVisible = False
' Add a GridColumnStyle
Dim tcWebPart As New DataGridTextBoxColumn
tcWebPart.MappingName = "PRT_NAME"
tcWebPart.HeaderText = "Web Part"
tcWebPart.Alignment = HorizontalAlignment.Left
tcWebPart.ReadOnly = True
tcWebPart.Width = 175
tsSecurity.GridColumnStyles.Add(tcWebPart)
Dim tcAccess As New DataGridBoolColumn
tcAccess.MappingName = "ACCESSWP"
tcAccess.HeaderText = "Access"
tcAccess.Alignment = HorizontalAlignment.Center
tcAccess.AllowNull = False
tcAccess.ReadOnly = True
tcAccess.NullValue = False
tcAccess.TrueValue = True
tcAccess.FalseValue = False
tcAccess.Width = 75
tsSecurity.GridColumnStyles.Add(tcAccess)
Dim tcViewNotes As New DataGridBoolColumn
tcViewNotes.MappingName = "VIEWNOTES"
tcViewNotes.HeaderText = "View Notes"
tcViewNotes.Alignment = HorizontalAlignment.Center
tcViewNotes.AllowNull = False
tcViewNotes.ReadOnly = True
tcViewNotes.NullValue = 0
tcViewNotes.TrueValue = 1
tcViewNotes.FalseValue = 0
tcViewNotes.Width = 75
tsSecurity.GridColumnStyles.Add(tcViewNotes)
Dim tcEditNotes As New DataGridBoolColumn
tcEditNotes.MappingName = "EDITNOTES"
tcEditNotes.HeaderText = "Edit Notes"
tcEditNotes.Alignment = HorizontalAlignment.Center
tcEditNotes.AllowNull = False
tcEditNotes.ReadOnly = True
tcEditNotes.NullValue = 0
tcEditNotes.TrueValue = 1
tcEditNotes.FalseValue = 0
tcEditNotes.Width = 75
tsSecurity.GridColumnStyles.Add(tcEditNotes)
In the event where I bind my datagrid I have the following:
' Build the query with place holders for thepermissions.
strQuery = "SELECT PRT_NAME,0 ACCESSWP,0 VIEWNOTES,0EDITNOTES FROM OBVIENT.OBV_WEB_PARTS WHERE 1=1 "
adaptor = New OleDbDataAdapter(strQuery, oConn)
adaptor.Fill(dsAny, "OBVIENT.OBV_WEB_PARTS")
dgWebParts.DataSource =dsAny.Tables("OBVIENT.OBV_WEB_PARTS")
allowNewFalse(dgWebParts, BindingContext)
This works great against SQL Server and the check boxes performas expected. In Oracle the check boxes are always greyed out andchecked. Any help would be greatly appreciated.