I am trying to get the count of the number of rows in the radgrid as part of the needDataSource event. I needs to change a tab header that sits at top of page based on the number of rows it pulls, tried multiple things but nothing works. below always returns 0
Protected Sub myRadGridList_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles myRadGridList.NeedDataSource Dim Count As Integer = 0 Dim sqlwhere As String = "" GetSrpId() sql = "Select strssn, strFullname, strRank, strPMOS, Convert(varchar(10), strdob, 111) strDob from MnNgPersonnel.dbo.tblMNNatPersonnel Where strRECPREC = '99999999' and strRECSTAT <> 'M' AND " _ & "(strUIC = '" & HFID.Value & "' or strAttchUIC = '" & HFID.Value & "') and (strSSN Not IN (Select strssn from tblUnitSRPPersonnelHist where intSRpId = " & HFRID.Value & " and dtExpire > " _ & "GETDATE() and bitActive = 1) OR strSSN Not IN (Select strssn from tblUnitSRPPersonnelHist where intSRpId = " & HFAID.Value & " and dtExpire > GETDATE() and bitActive = 1)) " & sqlwhere & "" myRadGridList.DataSource = getData(sql) Count = myRadGridList.MasterTableView.Items.Count tbAnnual.HeaderText = "Annual Reviews (" & Count & ")" pnlGrid.Visible = True End Sub