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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:09:14+00:00 2026-05-23T09:09:14+00:00

QUESTION: How can I bind the visibility of FixHyperLink to the condition that Label1

  • 0

QUESTION: How can I bind the visibility of FixHyperLink to the condition that Label1 has a non-empty text value?

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
    <Columns>
        <asp:TemplateField HeaderText="Error" SortExpression="Error">
            <ItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Error") %>'></asp:Label>
                <asp:HyperLink ID="FixHyperLink" runat="server" NavigateUrl='<%# Bind("AppID", "~/da/Default2.aspx?appid={0}") %>'>Fix</asp:HyperLink>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>

UPDATE: C# version of answer

        foreach (GridViewRow row in GridView1.Rows)
        {
            var l = (Label)row.FindControl("Label1");
            var h = (HyperLink)row.FindControl("FixHyperLink");
            h.Visible = !string.IsNullOrWhiteSpace(l.Text);
        }
  • 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-23T09:09:14+00:00Added an answer on May 23, 2026 at 9:09 am

    You have to identify the index of the row you want to change then get it like this:

            Dim tempRow As System.Web.UI.WebControls.GridViewRow
        Dim tempLabel As Label
        Dim tempHyperlink As HyperLink
    
        For Each tempRow In GridView1.Rows
            tempLabel = CType(tempRow.FindControl("Label1"), Label)
            tempHyperlink = CType(tempRow.FindControl("FixHyperLink"), HyperLink)
            If tempLabel.Text.Trim <> String.Empty Then
                tempHyperlink.Visible = True
            Else
                tempHyperlink.Visible = False
            End If
        Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My question is if we can assign/bind some value to a certain item and
Question Can I build a image database/library that has an e-commerce style checkout system
This question bugs me since a long time: Can I have a condition that
This question (along with its answer) explains why you can't easily bind a DataGridView
How can you make an own function in PHP such that I can bind
I have question how i can bind datagrid column to collection? dataGrid1.Columns.Add(new DataGridTemplateColumn {
Before you say, yeah this question can be duplicate; https://stackoverflow.com/questions/2912890/gridview-freeze-pane-solutions How to freeze GridView
I need to bind a TextBox's Text to a property of a class that
I'm using a PasswordBox which exposes a dependency property such that I can bind
Continuing from my last question , I'd like to know how can I bind

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.