.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Sorting Data in a GridView Web Server Control

Posted By: Venkat     Posted Date: April 07, 2010    Points: 2   Category :ASP.Net
The GridView control provides built-in sorting functionality without requiring any coding. You can further customize the sort functionality of the GridView control by using custom SortExpression property values for columns as well as by using the Sorting and Sorted events

View Complete Post

More Related Resource Links

GridView control to show master-child or master-slave data, written in c#, asp.net

I previously made a master slave datagrid using Visual Studio 2003 .Net (original article) that would allow users to show data to clients using collapse and expand features. These features however did not carry over to gridview for many users. This tutorial will explaing how to create a collapsable/expandable gridview in frameworks 2.0 and higher

Easily manipulate data with the GridView control in ASP.NET 2.0

Last week, I introduced ASP.NET 2.0's GridView data control and covered the basics of using it. This week, I go a step further by going into the details of working with the data contained in the control. This includes viewing, editing, and deleting data. Thankfully, the GridView control makes it easy to utilize these features. Before diving into these topics, I begin with an examination of the different field types supported by the GridView control.

Manually sorting and paging Gridview without using datasource control

Many a times while working with Gridview we want to work with the paging and sorting functionality without using any datasource control. Gridview is flexible enough to perform these tasks without the use of any datasource control and only a few lines of code.

Sorting in Data GridView using c#

Sallam & Hi to all,well i m making a project in asp .net c# i used data gridview which is bound at run time after many calculations... problem occured when i want to sort it.. anybody help me...ThanksSaqib

GridView data to Chart Control


I have a GridView that is filled with databound data.  My problem is that I have a template field that uses the index + 1 for the gridview to give each record a unique number.  Then with this Gridview, with BoundFields and TemplateFields, I want to have this data to be the data for the chart control series.  How exactly is the best way to go about this?

Thanks in advance. :)

Losing Data on GridView Control


VWD 2008 Express.  Visual Basic.

Please bear with me as I explain.  I have a page I use to update a student's personal and grade information.  I use a formview control to enter and update a students personal information.  I use a gridview control to enter and update the student's grades.  When the user wants to make edits to the data, they make the changes in the formview and the gridview, then press a "Save" button, which runs code behind that reads the formview and gridview data, builds two SQL UPDATE statements, then performs the update on two SQL tables (the Students table and the Grades table).  This seems to work fine in most cases.

I have had students reporting that at times segments of the student grades are lost when they make updates.  For instance, the student has 180 grades and grade dates recorded, thee user makes some updates on the end of the student's grade record, saves the changes, then goes back later and finds that a large contiguous block of previously entered grades and grade dates have been nulled out.  One user said this happened when they were on the student record and they hit the "back" arrow in the browser, then hit the forward arrow and saved the student record.  Can anyone think of a circumstance (like with a back arrow and fo

How to get some data fom GridView (or whatever control DataList etc...)


Hi everyone,

I really love GridView and I like to use it whenever it suits well. Just out of curisority, recently, I been thinking what if i wanna get sme data from the GridView I just bind on the page without actually nesting each column and row? For example :


From the above table, say I wanna take the value Three and Five. How can I get it back from the table ? I know I can query back the database to get the value but that's not what I am trying to figure out here. Thanks all and will be looking forward to getting some cool stuff from you guys.

How to calculate data from gridview control ???


Hello friends,

well i want to calculate data from a gridview field, you can see below the structure of my main page:


    <form runat="server">


        <asp:Label runat="server" Text="Result:" ForeColor="Red"></asp:Label>

        <asp:Label runat="server"></asp:Label><br />

        <br />

        <asp:GridView runat="server" AutoGenerateColumns="False" CellPadding="4"

            ForeColor="#333333" GridLines="None" DataSourceID="SqlDataSource1">

            <RowStyle BackColor="#E3EAEB" />

            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />

            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />

            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />

            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />

            <EditRowStyle BackColor="#7C6F57" />

            <AlternatingRowStyle BackColor="White" />


How to implement paging and sorting in asp.net Gridview control?

In this article, I will explore how to implement paging and sorting in gridview control without using sql and object data sources.

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

AJAX GridView Paging and Sorting using C# in ASP.Net

To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.

Sorting Gridview using Jquery with ASP.NET

I want to show how to sorting a gridview using a Jquery in ASP.NET, it is a flexible client-side table sorting. We have known that Jquery is a new kind of Javascript Library. You can find detail of Jquery in this site http://jquery.com/ there are lot of example with documentation and also allow free download a latest version.

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

In-Depth look at the GridView Control

In the last article we looked at few of the new controls available in Asp.net 2.0. We also talked about Grid View Control which has replaced the Asp.net 1.1 DataGrid control for good. In this article we will examine more features of the Grid View control. In this article we will see some of the common operations that can be performed using the GridView control. Apart from these operations there are many more functions that can be performed on the control and which we will see in the later articles

Editing the Data in a GridView

In addition to deleting a GridView's underlying data, another common need is to allow end users to edit the data displayed in a GridView. With ASP.NET 1.x's DataGrid control, editing the data is certainly possible, but requires creating three event handlers and writing a dozen or so lines of code. With the GridView and ASP.NET 2.0, it is possible to create an editable GridView without writing a single line of code! All of the necessary functionality is encapsulated within the GridView.

The GridView allows editing on a row-by-row basis. An editable GridView contains an additional column with an Edit button in each row. When the end user clicks on an Edit button that row becomes editable, causing the Edit button to change to Update and Cancel buttons and the other columns to become TextBoxes. The end user can then update one or more column values and click Update to save their changes.

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend