Click here to Skip to main content
15,884,099 members
Articles / DataTable

GridviewFix jQuery plugin

Rate me:
Please Sign up or sign in to vote.
4.56/5 (20 votes)
11 Oct 2011CPOL6 min read 94.9K   1.5K   32  
GridviewFix is a helper jQuery plugin that solves the compatibility problem in between .NET Gridview and dataTable plugin.
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;

public partial class dataTable : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        clsEmp emp = new clsEmp();
        GridViewExample.DataSource = emp.GetEmployeeList;
        GridViewExample.DataBind();
    }
}
public class clsEmp
{
    public string Name { get; set; }
    public string Town { get; set; }
    public string Age { get; set; }
    public string Id { get; set; }
    public string Skills { get; set; }
    public List<clsEmp> GetEmployeeList
    {
        get
        {
            List<clsEmp> data = new List<clsEmp>(){
            new clsEmp{ Name="Rupesh" , Age ="29" , Id="114230" , Skills="c sharp, jquery", Town="Louisville"},
            new clsEmp{ Name="Dewang Mehta" , Age ="35" , Id="012530" , Skills="c sharp, project manager", Town="Louisville"},
            new clsEmp{ Name="Ravindra Ravouri" , Age ="32" , Id="012230" , Skills="c sharp, dot net", Town="Amherst"},
            new clsEmp{ Name="Laxmikanth Vardhanapu" , Age ="31" , Id="154587" , Skills="BA", Town="Louisville"},
            new clsEmp{ Name="Rajeswar" , Age ="30" , Id="116230" , Skills="c sharp, dot net", Town="Louisville"},
            new clsEmp{ Name="Monika" , Age ="10" , Id="154230" , Skills="c sharp", Town="Louisville"},
            new clsEmp{ Name="Mandar" , Age ="37" , Id="234230" , Skills="Account Leader", Town="Amherst"},

            new clsEmp{ Name="Harshal" , Age ="31" , Id="244587" , Skills="Project Lead, dot net", Town="Mumbai"},
            new clsEmp{ Name="Lalit" , Age ="26" , Id="126230" , Skills="c sharp, dot net", Town="Ulhas nagar"},
            new clsEmp{ Name="Arun" , Age ="29" , Id="125230" , Skills="c sharp", Town="Mulund"},
            new clsEmp{ Name="Ankita" , Age ="12" , Id="144230" , Skills="c sharp", Town="Andheri"}
        };
            return data;
        }
    }
    public List<clsEmp> GetEmployeeByName(string name)
    {
        return this.GetEmployeeList.FindAll(emp => emp.Name == name);
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States

I am a Senior Software Developer working since 2005 in Microsoft ASP.Net and related Technologies.


I work on C#, Asp.Net, MVC, RAZOR, Entity Framework, JavaScript, jQuery, HTML5, CSS3, WCF, Silverlight, WPF, MVVM, SQL, SSIS, etc. Did Function Point Analysis, WBS to estimate projects and worked on Agile Scrum team.



I enjoy on exploring new technologies by implementing and writing about them, great interest in learning Design Patterns and their implementations. I love learning, writing JavaScript; now my favorite JavaScript library is jQuery. I enjoy writing jQuery Plugins and core JavaScript. I also write Technical blogs here. You can find me on LinkedIn.



I wrote an article on Swami Vivekananda posted his audio speeches by reading them.


Comments and Discussions