网格模板字段可见性 [英] Grid Template Field Visibility

查看:80
本文介绍了网格模板字段可见性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<asp:GridView ID="grdFeedback" runat="server" AutoGenerateColumns="False"

                               Width="468px" CellPadding="4" ForeColor="#333333"

                                   GridLines="None" onrowcommand="grdFeedback_RowCommand"

                                   onrowdatabound="grdFeedback_RowDataBound"

                                   Height="63px" onrowcreated="grdFeedback_RowCreated">
                                   <RowStyle BackColor="#EFF3FB" />
                                   <Columns>
                                       <asp:BoundField DataField="strFedback" HeaderText="Feedback" />
                                       <asp:BoundField DataField="strFedbackSender" HeaderText="Time" />
                                       <asp:BoundField DataField="strFedbackDate" HeaderText="Date" />
                                       <asp:BoundField DataField="strFedbackTime" HeaderText="Sender" />
                                       <asp:TemplateField HeaderText="Operation">
                                           <ItemTemplate>
                                               <asp:LinkButton ID="Lnk_Delete" runat="server"

                                                   CommandArgument='<%# Eval("iFedbackid") %>' CommandName="del"

                                                   onclick="Lnk_Delete_Click">Delete</asp:LinkButton>
                                           </ItemTemplate>
                                       </asp:TemplateField>
                                   </Columns>
                                   <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                   <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                   <EmptyDataTemplate>
                                       <asp:LinkButton ID="Lnk_Delete0" runat="server">Delete</asp:LinkButton>
                                   </EmptyDataTemplate>
                                   <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                   <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                   <EditRowStyle BackColor="#2461BF" />
                                   <AlternatingRowStyle BackColor="White" />
                               </asp:GridView>








这是我提交用户反馈的gridview.有一个模板字段链接"按钮
(Lnk_Delete).发现很难显示仅与
相对应的链接按钮 发布反馈的用户.
请帮助我...








This is my gridview for filing feedback from users. There is a template field Link button
(Lnk_Delete). Am finding it difficult to display this link button corresponding only to
the user who has posted the feedback..
Pls help me out ...

推荐答案

使用GridView的RowDataBound事件.

供参考 GridView中的条件值和样式 [
Use RowDataBound event of GridView.

For reference Conditional Values And Styles In GridView[^]


这篇关于网格模板字段可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆