This is a migrated thread and some comments may be shown as answers.

Missing operand after 'a' operator error for master/detail

1 Answer 161 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tuan Huynh
Top achievements
Rank 1
Tuan Huynh asked on 19 Sep 2008, 03:10 PM
I am getting the error "Missing operand after 'a' operator" when I have master/detail views of RadGrid for AJAX.Net. This error happens when user attempts to drill into detail table and value of the DataKeyNames of the parent table has a single quote '.  I found one thread that someone had shared similar error. 

http://www.telerik.com/community/forums/thread/b311D-ebecm.aspx

However, he had to resort to an alternative to use two grids instead of master/detail. I'd rather use master/detail. Can you help? Thanks.

Here is my snippet of my master/detail relation. City has single quote in value

<

DetailTables><telerik:GridTableView DataKeyNames="City" Name="ITContact"  GridLines="None" Width="100%" BorderStyle="None" GroupLoadMode="Client">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="City" MasterKeyField="City" />
</ParentTableRelation>


In debugging, I have no problem in retrieving the detail table of City with single quote in value. The statements of below in DetailTableDataBind event handler executes with no error.

switch (e.DetailTableView.Name) {

case "ITContact":
string City = dataItem.GetDataKeyValue("City").ToString();
DataSet dsResult = new WorkflowParticipant().GetITContactsByCity(City);
e.DetailTableView.DataSource = dsResult;
break;

}

Stack trace shows that the error happens at System.Data.ExpressionParser.Parse()
System.Data.ExpressionParser.Parse() +442
   System.Data.DataExpression..ctor(DataTable table, String expression, Type type) +154
   System.Data.DataExpression..ctor(DataTable table, String expression) +35
   System.Data.DataView.set_RowFilter(String value) +192

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 23 Sep 2008, 11:20 AM
Hello,

It seems that you are using both ParentTableRelation and DetailTableDataBind event? If this is the case, please remove the ParentTableRelation and use only DetailTableDataBind event.

Please give it a try and see if this helps.

Sincerely yours,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Tuan Huynh
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or