Click here to Skip to main content
15,899,935 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a GridView, and a linkbutton inside it. When clicking on the link button, my gridviews RowCommand gets fired. My problenm is that GridView's RowCommand does not get fired when clicking on the linkbutton for the first time. On subsequent click on the linkbutton, the GridView's RowCommand gets fired. I am trying to display details when clicking on row (linkbutton) using AJAX. My GridView is inside an UpdatePannel.

I have created the application using .net 3.0.
Thanks
Saubhagya

UPDATE: Issue resolution
I figured out the issue, I was using GridView_RowCreated which was causing the problem, instead I used GridView_RowDataBound which solved the problem for me.
Posted
Updated 4-Jul-10 19:05pm
v2
Comments
Sandeep Mewara 25-Jun-10 11:36am    
Show us some code. It's not the expected or acutal behaviour. You must be doing something wrong.

1 solution

Atleast you might post the code which you have tried, but i guess the issue may be you bound the datasource to Gridview on postback.
So write the code in not postback.

C#
protected void Page_Load(object sender, EventArgs e)
{
 if (!IsPostBack)
 {
  GridView1.Datasource = DataTable1;
  GridView1.DataBind();
 }
}


Just let us know the status, if not then post your code.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900