Sunday, March 31, 2013

Colspan in Jquery DataTables using C# in asp.net GridView

In this post i will show how to Make Colspan for Jquery DataTables in ASP.Net GridView.

Actually ColSpan is not supported in Jquery DataTables

Previous Posts :

So here is a small trick to do it in server side....


OutPut :



















protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{   
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        string platform = ((Label)e.Row.FindControl("lblPlatform")).Text;
        string Grade = ((Label)e.Row.FindControl("lblGrade")).Text;
        e.Row.Cells[2].ColumnSpan = 2;
        e.Row.Cells[3].Style.Add("display""none");
        e.Row.Cells[3].Text = "";
        ((Label)e.Row.FindControl("lblPlatform")).Text = 
                                           platform + ", <b>Grade :</b> " + Grade;
    }
}  
 
Download from Here 

1 comment:

  1. i create this site watch my grid

    http://www.finestardiamonds.com/User/SearchDiamondResult.aspx

    click search

    ReplyDelete