winform中怎样使DataGridView的某一列可以添加两个Button控件
1个回答
2015-04-02 · 知道合伙人互联网行家
关注
展开全部
asp:GridView ID="gvPlan" runat="server" AutoGenerateColumns="False" OnRowCommand="gvImage_RowCommand"
OnRowDataBound="gvPlanDrill_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="操作">
<ItemTemplate>
<asp:ImageButton ID="bntCommit" ImageUrl="~/Images/Commit.gif" runat="server" CommandName="commit"
CausesValidation="false" ToolTip="总结" CommandArgument='<%# Eval("PLAN_ID")%>' />
<asp:ImageButton ID="btnEdit" ImageUrl="~/Images/table_edit.png" runat="server" CommandName="ed"
CausesValidation="false" ToolTip="编辑" CommandArgument='<%# Eval("PLAN_ID")%>' />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="60px" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
OnRowDataBound="gvPlanDrill_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="操作">
<ItemTemplate>
<asp:ImageButton ID="bntCommit" ImageUrl="~/Images/Commit.gif" runat="server" CommandName="commit"
CausesValidation="false" ToolTip="总结" CommandArgument='<%# Eval("PLAN_ID")%>' />
<asp:ImageButton ID="btnEdit" ImageUrl="~/Images/table_edit.png" runat="server" CommandName="ed"
CausesValidation="false" ToolTip="编辑" CommandArgument='<%# Eval("PLAN_ID")%>' />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="60px" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询