PIA EntityGrid Problems: Passing Condition Expression

Oct 28, 2009 at 11:03 PM
Edited Oct 28, 2009 at 11:07 PM

I've been working on this for a couple of hours now but how do I pass a condition expression off to entitygrid within the asp page itself. Here's what I have right now:

 

<asp:GridView ID="pGV" runat="server"></asp:GridView>
<msa:EntityGrid InnerGridView="pGV" ID="eGrid" EntityName="lead" ShowEditButton="true" ShowOnlyActive="true" runat="server" AllowStateChange="false">
  <msa:QueryFilter FilterOperator="Or">
     <msa:Conditions>
        <msa:ConditionExpression AttributeName="address1_stateorprovince" Operator="Contains" Value="OR")/>
     </msa:Conditions>
  </msa:QueryFilter>
</msa:EntityGrid>

It gives a an object not set to an instance of an object at the ConditionExpression line. I added references to Microsoft.Crm.Sdk.Query and attempted to pass them like the following code as well:

 

<asp:GridView ID="pGV" runat="server"></asp:GridView>
<msa:EntityGrid InnerGridView="pGV" ID="eGrid" EntityName="lead" ShowEditButton="true" ShowOnlyActive="true" runat="server" AllowStateChange="false">
  <QueryFilter FilterOperator="Or">
     <Conditions>
        <ConditionExpression AttributeName="address1_stateorprovince" Operator="Contains">
           <Values>
              <String>OR</String>
           </Values>
        </ConditionExpression>
     </Conditions>
  </QueryFilter>
</msa:EntityGrid>

I've tried these two variants and everything in between. The above code executes without error but a blank grid shows up. What am I doing wrong. It has to be syntax somewhere. I'm not overly familiar with passing data using this ASP seudo xml thing.

 

                <asp:GridView ID="pGV" runat="server"></asp:GridView>
                <msa:EntityGrid InnerGridView="pGV" ID="eGrid" EntityName="lead" ShowEditButton="true" ShowOnlyActive="true" runat="server" AllowStateChange="false">
                <msa:QueryFilter FilterOperator="Or">
                   <msa:Conditions>
                   <msa:ConditionExpression AttributeName="address1_stateorprovince" Operator="Contains" Value="OR")/>
                   </msa:Conditions>
                </msa:QueryFilter>
                </msa:EntityGrid>