c# - Grid View - Binding Data with Data Source at Button Click But Grid is not appearing -
i have gridview
in updatepanel
. on button click event binding data grid view. data being binded grid not showing.
protected void page_load(object sender, eventargs e) { if (!ispostback) { binddata(); } } protected void binddata() { // dv data view have rows , columns gridview1.datasource = dv; gridview1.databind(); updatepanel.update(); } }
on button click event :-
protected void btnupdateextensions_click(object sender, eventargs e) { // dv data view have data columns , rows gridview1.datasource = dv; gridview1.databind(); updatepanel.update(); }
at page load binding data ad showing gridview
@ button click event not showing gridview while data source same source.
your button inside of updatepanel
call
<asp:updatepanel id="updatepanel1" runat="server"> button , gridview </asp:updatepanel protected void btnupdateextensions_click(object sender, eventargs e) { binddata(); }
no need write updatepanel.update();
Comments
Post a Comment