gridview-模板字段-Button [英] gridview- Template Field -Button
问题描述
PLZ帮我看看gridview ..
我在网格视图中有两个按钮..
所以当我点击批准按钮然后应该隐藏拒绝按钮并显示带有批准数据的标签..
请帮助编码....
< ; asp:TemplateField HeaderText =Status>
< itemtemplate>
< asp:Button ID =BtnApproveText =Approverunat =server />
< asp:Label ID =StatusResultrunat =serverVisible =false/>
< asp:Button ID = btnRejctrunat =serverText =Reject/>
plz help me with the gridview ..
i''m having two buttons in my gridview..
so when i click on "approve button" then the "reject button" should get hidden and label with approve data should display..
plz help with the coding....
<asp:TemplateField HeaderText="Status" >
<itemtemplate>
<asp:Button ID="BtnApprove" Text="Approve" runat="server" />
<asp:Label ID="StatusResult" runat="server" Visible="false" />
<asp:Button ID="btnRejct" runat="server" Text="Reject" />
推荐答案
在按钮点击事件中写下此代码
Write this code in your button click event
(Button)GridView1.Rows[i].FindControl("Button1").Visible=False;
(Label)GridView1.Rows[i].FindControl("Label1").Visible=True;
如果你有任何疑问,这很容易ping我,我一定会帮你解决这个问题。
It''s very easy if you got any doubt ping me I''ll sure help you out from this problem.
这篇关于gridview-模板字段-Button的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!