Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using a gridview for showing a control in rows of gridview.

but when i click on button in any one column of gridview then whole page is render. I do not want to render whole page. instead i only want to render respective rows.

What I have tried:

my code:

I want to update controls only which are respective columns as user click button in it.

<asp:GridView ID="GridViewUserScraps2" ItemStyle-VerticalAlign="Top" AutoGenerateColumns="False"
GridLines="None" Width="80px" ShowHeader="False" runat="server" AlternatingRowStyle-BackColor="#A5A5A5"
CellPadding="4" ForeColor="#333333" OnSelectedIndexChanged="GridViewUserScraps1_SelectedIndexChanged" >
<columns> <asp:TemplateField>
<itemtemplate>
--%>


<img align="middle" src='<%#getSRC1(Container.DataItem)%>' class="img-responsive center-block" style='<%# CheckVisibility(DataBinder.Eval(Container.DataItem,"imageurl")) %>; width: 206px; height: 149px;' border="0" ID="kk" />

<asp:button id="b1" runat="server"/>

<br />

<itemtemplate/>

</columns>


<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<editrowstyle backcolor="#2461BF" >
<alternatingrowstyle backcolor="White" ><columns/>
</asp:GridView>
Posted
Updated 15-Jul-16 0:30am
v8
Comments
Sunasara Imdadhusen 15-Jul-16 2:45am    
You can use AJAX to update only selected row in the table. For Gridview you can user UpdatePannel but again it will refresh entire Grid not selected row.
Kishor-KW 15-Jul-16 5:32am    
ya that is the problem if i put gridview in update panel
Kishor-KW 16-Jul-16 3:09am    
Is there any solution for this?

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