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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:45:54+00:00 2026-05-17T00:45:54+00:00

I have this: <Grid.ColumnDefinitions> <ColumnDefinition Width=50* /> <ColumnDefinition Width=5 /> <ColumnDefinition Width=50* /> </Grid.ColumnDefinitions>

  • 0

I have this:

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="5" />
            <ColumnDefinition Width="50*" />
        </Grid.ColumnDefinitions>
        <GridSplitter Background="{x:Static SystemColors.ControlBrush}"
          Grid.Column="1"
          Margin="0,0,0,0"
          Name="splitter"
          HorizontalAlignment="Stretch" />

I’m trying to save and restore the splitter position. I’m using grid.ColumnDefinitions[0].Width, which returns the width of the column in pixels.

When I restore the position, how do I restore AND keep the 50* setting, so that when you resize the window, the column resizes correctly?

  • 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-17T00:45:55+00:00Added an answer on May 17, 2026 at 12:45 am

    The Width property is not a simple double, it is a System.Windows.GridLength object which contains the Value property (double) and a GridUnitType property (GridUnitType) which is an enum.
    So, to set your column’s width to 50*:

    grid.ColumnDefinitions[0].Width = new GridLength(50, GridUnitType.Star)
    

    To save and restore all you need to do is to save the value and the GridUnitType for each column.

    Hope it helps.

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

Sidebar

Related Questions

<StackPanel Grid.Column=0 > <Button Name=buttonEditListBoxItem Content=Edit Click=buttonEditListBoxItem_Click></Button> <ListBox Name=ListBoxTriggers SelectedValuePath=TriggerId IsSynchronizedWithCurrentItem=True SelectionChanged=Triggers_SelectionChanged ScrollViewer.HorizontalScrollBarVisibility=Auto HorizontalContentAlignment=Stretch>
I have the following Style (defined as a Resource in xaml). This is basically
I have those two classes: class DownloadLink { public string Name { get; private
I'm attempting to display a table of data which looks like this on Windows
In a nutshell what Im trying to achieve is to have a re-usable DLL
I'm having trouble adding controls with x:name to my custom control. Adding the x:name=startDate
I have a listbox template showing an image and three textboxes. You will see
I'm trying to create a user control which will allow me to pass in
I'm trying to make a list that is populated by external data and I
I try to make a view that will display a treeview on one side

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.