I am having trouble checking a checkbox with VB.NET and RadGrid. So far I have been able to confirm that the value is indeed 1, but when I go to have the program check the box, it doesn't show anything.
My VB.NET code looks like this:
Protected Sub myRadGrid_RowDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGrid.ItemDataBound
If e.Item.ItemType = DataControlRowType.DataRow Then
If (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "InLocation")) Then
Dim myinLocation As CheckBox = CType(e.Item.FindControl("cbLocationUsed"), CheckBox)
myinLocation.Checked = True
Dim myinLocation2 As CheckBox = CType(myRadGrid.MasterTableView.FindControl("cbLocationUsed"), CheckBox)
myinLocation2.Checked = True
myinLocation.DataBind()
myinLocation2.DataBind()
LoadMyRadGrid()
End If
End If
End Sub
What this should be doing, I think think, is taking in the row like a GridView would with RowDataBound and then check its type, evaluate the InLocation field and populate the checkbox if need be. I think threw a few different methods to see if they would solve it. Nothing really happened though. Which one of the methods would I use here? Or am I completely off track.
My VB.NET code looks like this:
Protected Sub myRadGrid_RowDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGrid.ItemDataBound
If e.Item.ItemType = DataControlRowType.DataRow Then
If (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "InLocation")) Then
Dim myinLocation As CheckBox = CType(e.Item.FindControl("cbLocationUsed"), CheckBox)
myinLocation.Checked = True
Dim myinLocation2 As CheckBox = CType(myRadGrid.MasterTableView.FindControl("cbLocationUsed"), CheckBox)
myinLocation2.Checked = True
myinLocation.DataBind()
myinLocation2.DataBind()
LoadMyRadGrid()
End If
End If
End Sub
What this should be doing, I think think, is taking in the row like a GridView would with RowDataBound and then check its type, evaluate the InLocation field and populate the checkbox if need be. I think threw a few different methods to see if they would solve it. Nothing really happened though. Which one of the methods would I use here? Or am I completely off track.