connectseekers.com

Wednesday, 2 July 2014

How To Disable Sorting in Asp.net MVC Webgrid

7/02/2014 - By Pranav Singh 0

In this short article i will give you tips for removing shorting from header of the webgrid in an mvc application. For this we needed to just set the canShort=false while assigning the data source to webgrid. have a look the sample code below.

In my previous article i have shown you : How to Bind Data to Webgrid in ASP.net MVC Using C#.Net

 var grid = new WebGrid(Model.Studentmodel,canSort:false);

    <div>
        @grid.GetHtml(columns:
                                grid.Columns
                                (
                                    grid.Column("ID", "Stud ID"),
                                    grid.Column("Name", "Stud Name"),
                                    grid.Column("Class", "Class"),
                                    grid.Column("Section", "Section"),
                                    grid.Column("Address", "Address")
                                ), mode: WebGridPagerModes.Numeric)
    </div> 

In above code please check the blow mention line

 var grid = new WebGrid(Model.Studentmodel,canSort:false);

About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com
Email Id : contact@aspdotnet-pools.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Top jQuery Plugins

Global Classified : Connectseekers.com
© 2014
back to top