hello sir , this is my grid when i am clicking the return linkbutton that time the perticular book is return and hide from the grid..plz help.
gridlinkbutton code
hello sir , this is my grid when i am clicking the return linkbutton that time the perticular book is return and hide from the grid..plz help.
Vishal GilbilePosted Mar 8, 2013, 3:28 AM
All you need to do is set the DataKeyNames property of the GridView control to the Book_Id and Provide a CommandName to the return Link Button and finally fire the RowCommand Event Of your GridView Control.
For Eg: If I set the commandName Property of the return Link button to let say "Return"
then in the RowCommand Event of the GridView Control, I'll write code something like this.
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
//here you will have to check whether the RowCommand event is fired because of
// other controls within the gridview or due postback or due to click of our return //LinkButton. This thing can be done like this.
if(e.CommandName.Equals("Return"))
{
//here you will have to call a function which will hide the particular row from the
//gridview. All you need to do is create one private function which will rotate //through all the rows of the gridview and finally just hide the row by removing it //from the gridview dynamically.
}
}
Hope that helps you.
With Regards,
Vishal Gilbile.