how to control a gridview by a button click outside the grid

Posted by Shoumik025 under ASP.NET on 5/8/2013 | Points: 10 | Views : 16234 | Status : [Member] | Replies : 3
how to control a gridview by a button click outside the grid..........
is it possible??




Responses

Posted by: Valley on: 5/8/2013 [Member] Starter | Points: 25

Up
0
Down
Yes.

Shoumik025, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sumank on: 5/9/2013 [Member] Starter | Points: 25

Up
0
Down
Yes, you can control gridview on button click.
For Example, you want to show data in gridview on button click,
so on button click event bind the gridview with data.
Suppose, you want to hide the gridview on click of another button then
set visible=false for that gridview.

On the button click page is posted to the server and we can make
changes to the gridview.

Regards
SumanK

Shoumik025, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Valley on: 5/9/2013 [Member] Starter | Points: 25

Up
0
Down
<asp:BoundField DataField="Notes" HeaderText="Notes" Visible="False" 

SortExpression="Notes" />
<asp:BoundField DataField="Notes" HeaderText="Notes" Visible="False"
SortExpression="Notes" />
<asp:ButtonField ButtonType="Image" ImageUrl="~/Images/Imgs.jpg"
Text="Button" />
-----------------------------------------------------------------------------------------------------

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridView1.Columns[2].Visible = true;
GridView1.Columns[3].Visible = true;
}


Shoumik025, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response