WebGrid and ISDataSource Filtering issue

4 replies. Last post: December 13, 2011 3:18 AM by Handy Surya
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Jim DresserMember

I've found a problem where a WebGrid, which is bound to a ISDataSource, is not showing filtered data, even though the ISDatasource is filtered.  I'm using the latest dlls from WebStudio 2011 R1 SP1.


Let me explain.  Below is some very basic code - there is nothing on the code behind page, it's all on the aspx page.  There's a webGrid, and asp:GridView, and a ISDataSource.   The ISData source is connected to a database table, and it has a FilterExpression to limit the data that is returned.

Now,  Both the WebGrid and the asp:GridView are bound to this ISDataSource.  I expect the WebGrid to show the filtered data, but it doesn't, the WebGrid shows all of the data from the datasource, not the filtered data.

Yet, the asp:GridView, which is bound to the very same ISDataSource control, does show just the filtered data.  

If both controls are bound to the same datasource, why don't they show the same data?  Please explain how I can get the WebGrid to show the filtered data that the ISDataSource is providing.  I do not want to use the filtering that is part of the WebGrid, I want the filtering to be done in the ISDatasource.

Thanks, Jim


      <ISWebGrid:WebGrid ID="WebGrid1" runat="server" DataMember="Summaries_WebCatFilters" DataSourceID="ISDataSource2" Height="250px" 
        UseDefaultStyle="True" >
        <RootTable DataKeyField="Pid" >
          <Columns>
            <ISWebGrid:WebGridColumn Caption="Pid" DataMember="Pid" DataType="System.Int32" Name="Pid" Width="100px">
            </ISWebGrid:WebGridColumn>
            <ISWebGrid:WebGridColumn Caption="FullPartNumber" DataMember="FullPartNumber" Name="FullPartNumber" Width="100px">
            </ISWebGrid:WebGridColumn>
          </Columns>
        </RootTable>
      </ISWebGrid:WebGrid>
      <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" CssClass="text" DataKeyNames="FullPartNumber"
        DataSourceID="ISDataSource2" Width="100%">
        <Columns>
          <asp:BoundField DataField="Pid" HeaderText="Pid" InsertVisible="False" ReadOnly="True" SortExpression="Pid" />
          <asp:BoundField DataField="FullPartNumber" HeaderText="FullPartNumber" InsertVisible="False" ReadOnly="True" SortExpression="FullPartNumber" />
        </Columns>
        <PagerStyle CssClass="pager" />
        <HeaderStyle CssClass="header" />
      </asp:GridView>
      
      <ISDataSource:ISDataSource ID="ISDataSource2" runat="server" SchemaName="WebSpecMaster.App_Code.DataSet_ISISWebStaging">
        <Tables>
          <ISDataSource:ISDataSourceTable SelectMethod="GetData" TableName="Summaries_WebCatFilters" 
            FilterExpression="FullPartNumber Like '12345'" 
            TypeName="WebSpecMaster.App_Code.DataSet_ISISWebStagingTableAdapters.Summaries_WebCatFiltersTableAdapter">
          </ISDataSource:ISDataSourceTable>
        </Tables>
      </ISDataSource:ISDataSource>


All times are GMT -5. The time now is 1:48 PM.
Previous Next