I need to execute a sql statement based on the boolean value in the column, ExemptSuperviors, however the value is not being written to the grid. Hence, I am not getting the value for the sql statement. How can I resolve this issue, please.
Even the boolean value cannot be displayed, I do need it for the sql statement.
I have:
' ExemptSupervior
.Columns.Add(New Infragistics.WebUI.UltraWebGrid.UltraGridColumn)
With .Columns(.Columns.Count - 1).Hidden = False.Header.Caption = "ExemptSupervior".Width = 25.IsBound = True.BaseColumnName = "ExemptSupervior".Key = "ExemptSupervior"End With
Along with:If e.Row.Cells(e.Row.Cells.IndexOf("ExemptSupervisor")).Value = "-1" Then <= Level of error
If (e.Row.Cells(e.Row.Cells.IndexOf("LunchTime")).Value = "3") Then do some stuff Else If (e.Row.Cells(e.Row.Cells.IndexOf("LunchTime")).Value = "6") Then do some other stuff End
At this point, I'm passing this thread over to Developer Support to provide you with further aid. Everything that's been described so far should likely have worked, to the best of my knowledge, and it will take further research to determine why things aren't working. Developer Support will create a support case for you and contact you through that case.
Nothing works.
Good News! (sort-of)
Using Microsoft's AdventureWorks database, the replacement for Northwind, using a table which has Boolean values resulted in the UltraWebGrid dataobject writing "True' and "False".
The downside is the datatype used within AdventureWorks is not an option within SQL Server 2005, which is "UnknownType".
Hmm, the actual values within the column is True and False, not "0" or "1", which I currently have. I will change the "0" and "1" to "True" and "False" to View the output.
TY
WebGrid should already be doing this. It implicitly provides checkboxes for colums that use the System.Boolean data type, without needing any specific code to do so. I'm suspecting that there's something about the data structure itself that is keeping the grid from identifying your column as a boolean.
Can you reproduce this behavior in a sample that we can run and debug? I suggest using the Products table using the Northwind sample database, since it has a Discontinued column which is a "bit" datatype in SQL Server.
Happy Easter!
I am looked at this problem and found out the following: when I used the GridView object the Boolean value appeared as a checkbox so that I can grab that value to use in a conditional statement. However with the UltraWebGrid no value is reflected; the column is blank.
Only from within Sql Server Query Analyzer, the "-1" value appears.
So, I am thinking that there is a major difference between how Visual Studio's GridView object and infragistics UltraWebGrid object interprets Boolean values. The goal is to have the UltraWebGrid recognize Boolean values.