I'm getting an error when I try to page using Master/Detail tables. The error I get is :
Sys.WebForms.PageRequestManagerServerErrorException: Syntax error: Missing operand before 'And' operator.
I'm using version 2008.1.610.35 of the grid. Here is the code that is executed in the NeedDataSource:
this
.RadGrid1.MasterTableView.DataKeyNames = new string[] { "ndc" };
this.RadGrid1.MasterTableView.DataMember = "NDCMaster";
this.RadGrid1.MasterTableView.AllowPaging = true;
NDCMaster
master = new NDCMaster();
DataSet dsMaster = master.GetDataSetforNDCMaster();
this.RadGrid1.MasterTableView.DataSource = dsMaster;
this.RadGrid1.MasterTableView.DataMember = "NDCMaster";
this.RadGrid1.MasterTableView.DataKeyNames = new string[]{"ndc"};
GridRelationFields fields = new GridRelationFields();
fields.DetailKeyField =
"ndc";
fields.MasterKeyField =
"ndc";
detailView =
new GridTableView(this.RadGrid1);
this.RadGrid1.MasterTableView.DetailTables.Add(detailView);
this.RadGrid1.MasterTableView.DetailTables[0].ParentTableRelation.Add(fields);
NDCDetail detail = new NDCDetail();
DataSet dsDetail = detail.GetDataSetforNDCDetail();
this.RadGrid1.MasterTableView.DetailTables[0].DataSource = dsDetail;
this.RadGrid1.MasterTableView.DetailTables[0].DataMember = "NDCDetails";
this.RadGrid1.MasterTableView.DetailTables[0].Width = Unit.Percentage(100);
Here is the code in the aspx:<
telerik:RadGrid ID="RadGrid1" runat="server"
onneeddatasource="RadGrid1_NeedDataSource"
GridLines="None" ShowGroupPanel="True" onpageindexchanged="RadGrid1_PageIndexChanged"
>
<
MasterTableView hierarchyloadmode="ServerBind">
<
RowIndicatorColumn>
<
HeaderStyle Width="20px"></HeaderStyle>
</
RowIndicatorColumn>
<
ExpandCollapseColumn>
<
HeaderStyle Width="20px"></HeaderStyle>
</
ExpandCollapseColumn>
</
MasterTableView>
<ClientSettings AllowDragToGroup="True">
</ClientSettings>
</telerik:RadGrid>
I'm using the auto-generate columns at runtime. Any help is appreciated - thanks!Edited to add - I did originally assign the datasource and datamember to the detailView:
detailView.DataSource = dsDetail;
detailView.DataMember =
"NDCDetails";
But then when I try to page I get the error:
IListSource does not contain a datasource named "NDCDetails". Check your DataMember value.
So I assigned them to the Masterview detail table - that's when I get theSys.WebForms.PageRequestManagerServerErrorException: Syntax error: Missing operand before 'And' operator.
error. Thanks!
joni