Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 566173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:56:58+00:00 2026-05-13T12:56:58+00:00

Right, ok, I have followed Scott Gu’s example in his part 9, etc, etc

  • 0

Right, ok, I have followed Scott Gu’s example in his part 9, etc, etc blog and despite my best efforts to achieve ‘automatic sorting, paging and editing, I cannot get the so and so to work.

Is automatic sorting, paging and editing possible with the following set up?

<asp:TextBox ID="tbxHowMany" runat="server"></asp:TextBox>

    <asp:RadioButtonList ID="radMaterial" runat="server">
        <asp:ListItem>Paper</asp:ListItem>
        <asp:ListItem>Glass</asp:ListItem>
    </asp:RadioButtonList>


    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />


    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" 
        DataSourceID="LQTOPDS" Font-Size="XX-Small" ForeColor="#333333" 
        GridLines="None" DataKeyNames="PriKey" 
        AllowPaging="True" AllowSorting="True">
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <Columns>
            <asp:CommandField ShowEditButton="True" />
            <asp:BoundField DataField="Productpriority" HeaderText="Productpriority" 
                SortExpression="Productpriority" />
            <asp:BoundField DataField="MemberId" HeaderText="MemberId" 
                SortExpression="MemberId" />
            <asp:BoundField DataField="UnitWeight" HeaderText="UnitWeight" 
                SortExpression="UnitWeight" />
            <asp:BoundField DataField="WeightUnitCode" HeaderText="WeightUnitCode" 
                SortExpression="WeightUnitCode" />
            <asp:BoundField DataField="RecycledContent" HeaderText="RecycledContent" 
                SortExpression="RecycledContent" />
            <asp:BoundField DataField="IsBiodegradable" HeaderText="IsBiodegradable" 
                SortExpression="IsBiodegradable" />
            <asp:BoundField DataField="Recyclability" HeaderText="Recyclability" 
                SortExpression="Recyclability" />
            <asp:BoundField DataField="RevisionSourceCode" HeaderText="RevisionSourceCode" 
                SortExpression="RevisionSourceCode" />
            <asp:BoundField DataField="PriKey" HeaderText="PriKey" 
                SortExpression="PriKey" ReadOnly="True" />
        </Columns>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#999999" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    </asp:GridView>

    <asp:LinqDataSource ID="LQTOPDS" runat="server" 
        ContextTypeName="LQTOPDSDataContext" EnableInsert="True" EnableUpdate="True" 
        TableName="tblOnlineReportingCOMPLETEWEIGHTSFINALs" 
        Where="MaterialText == @MaterialText &amp;&amp; Productpriority &lt;= @Productpriority">

        <WhereParameters>
            <asp:ControlParameter ControlID="radMaterial" Name="MaterialText" 
                PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="tbxHowMany" Name="Productpriority" 
                PropertyName="Text" Type="Int32" />
        </WhereParameters>
    </asp:LinqDataSource>

Currently the only code behind I have is as follows:

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        GridView1.DataSourceID = null;

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        GridView1.DataSourceID = "LQTOPDS";
            GridView1.DataBind();
    }

}

This is driving me nuts…I’m reading that this sorting/paging/editing functionality should be automatic but obviously I am doing something wrong.

If someone can explain to me why this functionality is not being generated, I would be most grateful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:56:59+00:00Added an answer on May 13, 2026 at 12:56 pm

    This was finally achieved by changing the method of creating the table from whcih the data was sourced.

    I removed what was essentially the “SELECT TOP” I was using as a where clause and used a different method. I ranked the data and used ‘take’ – this effectively selected the data that was preordered and thus removed any additonal selecting that cuased issues with the gridview pging, sorting, etc.

    If anyone would like to see the code, just let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I been really enjoying playing with OpenGl and have followed some examples etc My
I have followed the tutorial at http://blog.boreal-kiss.net/2011/03/15/how-to-create-universal-static-libraries-on-xcode-4/ To make myself a static library. It
What I have right now is an animation that starts when I press space:
I actually have right now two questions: 1) What font faces are preferred for
This is what I have right now for a file residing on the same
I hope I can explain this right I have two input fields that require
Good day! I right now have a function the drags an element from a
Right now I have an upload field while uploads files to the server. The
Right now I have a script that will get the last five files in
Right now I have 3 tables: User, Roles, and User_Roles for the many-to-many association.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.