Click here to Skip to main content
15,900,434 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
XML
<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>







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 ...
Posted

1 solution

Use RowDataBound event of GridView.

For reference Conditional Values And Styles In GridView[^]
 
Share this answer
 

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