Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
290
How to Show/Capture Boolean Value in UltraWebGrid?
posted

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

 

 

 

Parents
No Data
Reply
  • 45049
    Suggested Answer
    posted

    I'm assuming that your "ExemptSupervisor" column becomes a Boolean value in your data source, which is likely why it's appearing as a checkbox.  Assuming that this is the case, then you simply need to cast the value of your cell from an Object to a Boolean:

    If CType(e.Row.Cells.FromKey("ExemptSupervisor").Value, Boolean) = False Then '<= Level of error

    By the way, if you need your column to be stored in ViewState, I also suggest you add it to your grid in a different manner, as illustrated here:

     ' ExemptSupervior 
    Dim colExempt As New Infragistics.WebUI.UltraWebGrid.UltraGridColumn(True)

    .columns.Add(colExempt)

    With colExempt
    .Hidden =
    False
    .Header.Caption =
    "ExemptSupervior"
    .Width = 25
    .IsBound =
    True
    .BaseColumnName =
    "ExemptSupervior"
    .Key =
    "ExemptSupervior"
    End With

Children