Mahesha999 0 Newbie Poster

Hi there. I am using GridView to display the comments of the thread in my forum. The GridView has only one templated column: showing User name who commented, title, date-time, comment and reply button.

I put reply button in asp:LoginView's <LoggedInTemplate>, so that it will be displayed only if the user is logged in.

Now I want to display the Edit button on the comment if the comment is made by the currently logged in user.

I am trying to do this in RowDataBound() event of the GridView. So that the commentor id (which I get for each row from gridViews's datasource ) can be compared with the id of the currently logged in user (which I am obtaining using Membership api). However in RowDataBound(), I am not able to figure out how I can access the commentorId column of the bounded row (in code behind.)( While binding control, we use expressions like: {0}, which returns 0th column of the bound row)

Also, I am unable to access the elements in the TemplateField in RowDataBound(), so that I can hide the Edit label depending upon whether the comment is created by currently logged in user.

Please tell me how can I achieve this functionality?