So I am running into this error after a postback on my radgrid, and I cannot figure out what the heck it is. so its on teh following command in my radgrid. So when it initially binds it might have a sub record or not, if they have sub record they have to choice accept it or deny it. I the follwoing they deny it, which updates a few bits and does a rebind. But on rebind is when i get the error its like it does not see the record or something. but if i response.write out all the statements the data is there.
after this it should do a rebind
And the following is where its breaking on the bind of the subgrid
error
If TypeOf e.Item Is GridDataItem AndAlso e.Item.OwnerTableView.Name = "myReIssueGrid" Then
If (e.CommandName = "Cancel") Then
Dim ReIssueId As Integer = e.CommandArgument
sql = "Execute sp_ReIssueCancel " & ReIssueId & ", " & Convert.ToInt32(HFPersId.Value)
insertUpdateDelete(sql)
'FillIssue(HFPersId.Value)
myIssueGrid.Rebind()
End If
End If
after this it should do a rebind
Protected Sub myIssueGrid_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles myIssueGrid.NeedDataSource
sql = "Select dr.strSN, dr.intTranstypeId, dm.strManufacturer + ' ' + mm.strMake + ' - ' + m.strModel Item, tt.strTransaction, i.intIssuedId, CONVERT(varchar(10), i.dtIssued, 111) DT_Issued, " _
& "p.strFullname + '\' + p.strRank IssuedTo, ftQTY From Drat_Issued i INNER JOIN Drat_Received dr on dr.intRecId = i.intRecId INNER JOIN Drat_TransactionType tt on tt.intTransTypeId = dr.intTransTypeId " _
& "INNER JOIN Drat_Model m on m.intModelId = dr.intModelID INNER JOIN Drat_Make mm on mm.intMakeId = m.intMakeId INNER JOIN Drat_Manufacturer dm on dm.intManufacturerId = mm.intManufacturerID INNER JOIN " _
& "MnNgPersonnel.dbo.tblMNNatPersonnel p on p.intPersonnelId = i.intIssuedTo Where bitSigned Is Not NULL And bitTakeOffHR Is NULL And bitTransfer Is NULL and intIssuedto = " & HFPersId.Value & ""
myIssueGrid.DataSource = getData(sql)
End Sub
And the following is where its breaking on the bind of the subgrid
Protected Sub myIssueGrid_DetailTableDataBind(sender As Object, e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles myIssueGrid.DetailTableDataBind
If e.DetailTableView.Name = "myReIssueGrid" Then
sql = "Select ri.intReIssueId, ri.intIssuedId, CONVERT(varchar(10), ri.dtIssue, 111) DT_Issue, intReIssueBy, p.strFullname + '\' + p.strRank IssuedBy, mn.strFullname + '\' + mn.strRank IssuedTo " _
& "From Drat_ReIssue ri LEFT JOIN Drat_Issued i on i.intIssuedId = ri.intIssuedId LEFT JOIN drat_Received dr on dr.intRecId = i.intRecId LEFT JOIN MnNgPersonnel.dbo.tblMNNatPersonnel p on " _
& "p.intPersonnelId = ri.intReIssueBy INNER JOIN MnNgPersonnel.dbo.tblMNNatPersonnel mn on mn.intPersonnelId = ri.intReIssueTo Where i.bitReIssue = 1 And ri.bitAccepted Is NULL AND " _
& "ri.intIssuedId = " & e.DetailTableView.ParentItem.GetDataKeyValue("intIssuedID")
e.DetailTableView.DataSource = getData(sql)
End If
End Sub
error
intReIssueId is neither a DataColumn nor a DataRelation for table Table.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: intReIssueId is neither a DataColumn nor a DataRelation for table Table.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: intReIssueId is neither a DataColumn nor a DataRelation for table Table.]
System.Data.DataRowView.get_Item(String property) +2725340
Telerik.Web.UI.GridTableView.PopulateDataKeys(Object dataItem) +238
[GridException: There was a problem extracting DataKeyValues from the DataSource. Please ensure that DataKeyNames are specified correctly and all fields specified exist in the DataSource.]
Telerik.Web.UI.GridTableView.PopulateDataKeys(Object dataItem) +1220
Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) +431
Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) +161
Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +1450
Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +858
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +94
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +182
Telerik.Web.UI.GridTableView.PerformSelect() +206
Telerik.Web.UI.GridTableView.DataBind() +441
Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +2337
Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +158
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +52
Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +50
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +52
Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +102
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +52
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707