Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
I use render to click the row in gridview.i need,if i click the one row ,gridview header should be hide.
Posted 17-Feb-13 23:32pm
Edited 17-Feb-13 23:41pm
v2
Comments
Sandeep Mewara at 18-Feb-13 4:35am
   
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
        onrowcommand="GridView1_RowCommand" >
        <Columns>
            <asp:BoundField DataField="UNIT" HeaderText="UNIT" />
            <asp:BoundField DataField="AMT" HeaderText="AMT" />
            <asp:TemplateField HeaderText="UP">
            <ItemTemplate>
            <asp:Button ID="C" runat="server" Text="DDD" />
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
</asp:GridView>
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
 
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
           //GridView CODE//
        }
 
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (GridView1.HeaderRow.Visible == true)
        {
            GridView1.HeaderRow.Visible = false;
        }
        else
        {
            GridView1.HeaderRow.Visible = true;
        }
    }
}
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 325
1 DamithSL 265
2 CPallini 235
3 Maciej Los 190
4 Sergey Alexandrovich Kryukov 189
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100