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 7656007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:39:34+00:00 2026-05-31T12:39:34+00:00

I have a datagrid with linkbutton inside it. <asp:DataGrid id=listDataGrid Runat=server> <Columns> <asp:TemplateColumn HeaderText=Item

  • 0

I have a datagrid with linkbutton inside it.

<asp:DataGrid id="listDataGrid" Runat="server">
                <Columns>

                    <asp:TemplateColumn HeaderText="Item Name">
                        <ItemTemplate>  
                            <asp:LinkButton id="lbItemName" runat="server"  OnClientClick="return false;" />
</Columns>
</asp:DataGrid>


In c#

foreach (DataGridItem dataGridItem in listDataGrid.Items)
            {
LinkButton lbItemName;
lbItemName = (LinkButton)dataGridItem.Cells[1].FindControl("lbItemName");
if (display == false)
                {
                    lbItemName.Attributes.Add("style", "text-decoration: none;cursor: default;");
                    lbItemName.Attributes["disabled"] = "disabled";
                }

}

But link button still works as a clickable link. I want to make it to show as text.

THanks

  • 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-05-31T12:39:35+00:00Added an answer on May 31, 2026 at 12:39 pm

    I would add a literal tag that is not visible. If you do not want it to be a hyperlink make the lblitemname.visble = false and make the literal tag visible

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

Sidebar

Related Questions

I have an asp:DataGrid with templated columns. Here's one of those columns: <asp:TemplateColumn> <ItemTemplate>
I have a Datagrid which looks as under <asp:GridView ID=dgTask runat=server Width=100% AutoGenerateColumns=False> <Columns>
I have DataGrid with dataBinding: <sdk:DataGrid x:Name=colorGrid Height=160 Margin=0,5,0,10 RowHeight=40 AutoGenerateColumns=False > <sdk:DataGrid.Columns> <sdk:DataGridTextColumn
I created this datagrid in my .aspx file. <asp:datagrid id=Computerchange runat=server AllowPaging=True PageSize=2 AutoGenerateColumns=False
I have a Datagrid with say 5 Columns named as follows RowID, Name, Age,
I have a DataGrid, with an ItemTemplate that has an image and label. In
I have a DataGrid with 5 template columns, However when I try and add
I have a DataGrid whose ItemsSource is bound to a changing Observable Collection. Inside
I have a datagrid called DataGridView1, column A contains a name, column B contains
I have a DataGrid bound to a ViewModel's property of type ObservableCollection. Inside DataGrid

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.