HI,
Ok, with some help i got to this point but found out on postback for some reason it alwyas registers my check event as as false and then i get an error in the datasource event, how can I check for it the cb_checkchanged event is true or false for checked or not in the event so that I can set the value of my hidden field to load the grid properly.
Ok, with some help i got to this point but found out on postback for some reason it alwyas registers my check event as as false and then i get an error in the datasource event, how can I check for it the cb_checkchanged event is true or false for checked or not in the event so that I can set the value of my hidden field to load the grid properly.
Protected Sub myRadGrid_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGrid.ItemCreated If TypeOf e.Item Is GridCommandItem Then Dim citem As GridCommandItem = DirectCast(e.Item, GridCommandItem) Dim Cb As CheckBox = DirectCast(citem.FindControl("cbhist"), CheckBox) If Cb.Checked = True Then HFHist.Value = 1 AddHandler Cb.CheckedChanged, AddressOf cb_CheckedChanged Else HFHist.Value = Nothing AddHandler Cb.CheckedChanged, AddressOf cb_CheckedChanged End If End If End Sub Private Sub cb_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) myRadGrid.Rebind() End SubProtected Sub myRadGrid_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles myRadGrid.NeedDataSource Dim sqlwhere As String If Int32.Parse(HFHist.Value) = 1 Then sqlwhere = "" Else sqlwhere = "where bitJ6 IS NULL or bitJ6 = 0" End If sql = "Select f.intFlagId, f.intPersonnelid, mn.strFullname + ' ' + mn.strRank Flag, m.strFullname + ' ' + m.strRank FlagBy, CONVERT(varchar(10), dtFlagged, 101) dtFlagged, bitUnit, bitJ2, bitJ6, strNotes " _ & "from iMAC_J2Flag f INNER JOIN MnNgPersonnel.dbo.tblMNNatPersonnel mn on mn.intPersonnelId = f.intPersonnelId INNER JOIN MnNgPersonnel.dbo.tblMNNatPersonnel m on m.intPersonnelId = f.intFlagBy " _ & "" & sqlwhere & "" Response.Write(sql) Response.End() myRadGrid.DataSource = getData(sql) End Sub