Click here to Skip to main content
16,001,979 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I have GridView inside UpdatePanel.In that one Asp:Button filed in ItemTempelte. When I will click on Button no event is fired row Command.I know that RowCommand Event is fired for ButtonField. But want to use simple Button.On that Button_click current rows data should show in Textboxes below that GridView But all these textboxes are not inside that UpdatePanel.

<asp:UpdatePanel ID="pnlList" runat="server" > <ContentTemplate>

<asp:GridView runat="server" id="gdvList" AutoGenerateColumn="false">
<Column>
<TemplteField>
<ItemTemplete>
<asp:Button id="btnEdit" runat="server" text="Edit" commandName="Edit">
</ItemTemplete>
</TemplteField>
</Column>
</ asp:GridView>
</ContentTemplate></asp:UpdatePanel>
...
....
.....
<asp:TextBox ID="txtLogicalCode" Runat="server"></asp:TextBox>



Please tell me solution as early as possible.

Thanks in Advance.
:)
Posted
Updated 16-Feb-10 4:12am
v3

First you need to change the CommandName="Select" and then handle SelectedIndexChanged event, after that when you click that button it will fire SelectedIndexChanged

Also you can set the property DataKeyNames="your primary key"

and you will get that key value in the selected index changed event, so that you can perform more operation on it using

gdvList.SelectedDataKey.Value
 
Share this answer
 
try using linkbutton instead of button..


:)
 
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