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

  • Home
  • SEARCH
  • 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 5952459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:41:06+00:00 2026-05-22T17:41:06+00:00

I have a DataTemplate that I am using for a cell in a gridview.

  • 0

I have a DataTemplate that I am using for a cell in a gridview. I would like to switch between the progress bar and the text/link block. Is there a way to hide an element so that it is removed from the flow and takes up no space while it is hidden (like “display:none” in CSS)? Is there a better way to approach this?

DataTemplate looks like:

<DataTemplate x:Key="DataTemplate2">
    <StackPanel Height="40">
        <TextBlock Visibility="{Binding ButtonVisibility}">
            <Hyperlink Click="btn_Authorise">
                <InlineUIContainer>
                    <TextBlock Text="{Binding Button}" />
                </InlineUIContainer>
            </Hyperlink>
        </TextBlock>
        <ProgressBar Value="{Binding Progress}"
                     Visibility="{Binding ProgressVisibility}"
                     Height="15"
                     Width="150"
                     Background="{DynamicResource NormalBrush}"
                     BorderThickness="0"
                     BorderBrush="#FF8D8D8D"
                     Style="{DynamicResource ProgressBarStyle1}" />
    </StackPanel>
</DataTemplate>
  • 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-22T17:41:07+00:00Added an answer on May 22, 2026 at 5:41 pm

    Visibility.Collapsed is probably what you need (as opposed to Visibility.Hidden which still makes the control take part in layout calculations)

    Also see the Visibility enumeration reference.

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

Sidebar

Related Questions

I am using WPF and I have DataTemplate that is i want to access
I have a DataTemplate that I want to find using the FrameworkElement.FindResource() . To
I have a DataTemplate that is displaying objects with three fields, e.g.: Name =
I have a listview with a DataTemplate that has a ComboBox. I want the
I have an <ItemsControl> with a custom <DataTemplate> (and also a custom <ItemsPanelTemplate> that
I have a combo box with the following DataTemplate: <DataTemplate x:Key=ComboBoxDataTemplate> <StackPanel> <TextBlock Text={Binding
I have a Silverlight application that is using a DataGrid. Inside of that DataGrid
Well the problem here is that if you have one DataTemplate for a type
I have a dockpanel that I dynamically fill using an ItemsControl to populate the
I have DataTemplate containing a TextBox . I'm setting this template to a listbox

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.