Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8714869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:42:27+00:00 2026-06-13T05:42:27+00:00

For one of the columns startdate in my gridview, if the user has correct

  • 0

For one of the columns “startdate” in my gridview, if the user has correct permissions, I want to add an edit icon to open a calendar which allows the user to edit the date.

I have the following code to add the image to the column, but it’s replacing the date rather than appending the image after the date.

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{

    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        if (System.Web.Security.Roles.IsUserInRole(Security.GetUserName(true, true), "UpdateStartDate"))
        {
          HyperLink hl = new HyperLink();
          // hl.Text = e.Row.Cells[6].Text;
          hl.ImageUrl = "../images/pencil.gif";

          e.Row.Cells[6].Controls.Add(hl);
        }
    }
}

The gridview column

<asp:BoundField HeaderText="Start Date" DataField="start_dt" DataFormatString="{0:d}" SortExpression="start_dt" ReadOnly="true" /> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:42:28+00:00Added an answer on June 13, 2026 at 5:42 am

    In my opinion better to use opposite approach: don’t show edit link if user have appropriate permissions, but instead to hide link if user doesn’t. Add HyperLink control next to textbox with date value and hide it conditionally in GridView1_RowDataBound method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that has two datetime columns (one for start time and
I have one database table which contains 8 columns. One of the columns is
I have a simple grid with 3 columns (one of which contains a grid
I have a gridview to display data, and one of columns was the file
I have two tables both of which have columns StartDate and EndDate. I'm trying
I have a datagrid, which gets filled by an ArrayList. I want one column
I have a table that containts a set of columns one of it is
My question is related to the following two: Emacs - Multiple columns one buffer
One of the columns in my table is a varchar that is supposed to
I have table with one of the columns as date in 'YYYY-MM-DD' format. Can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.