4 Replies - 11542 Views - Last Post: 14 March 2013 - 12:00 AM Rate Topic: -----

#1 KFredje  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 131
  • Joined: 06-September 11

Binding to a Grid's ColumnDefinition

Posted 03 March 2013 - 04:24 AM

Hi,

I've searched the internet how to do this but I only came to the conclusion this isn't going to be easy or even possible to do. Does anyone know (if possible) how to do this? If not, does somebody know a workaround?

If I know what to look for it would be easier for me.
Is This A Good Question/Topic? 0
  • +

Replies To: Binding to a Grid's ColumnDefinition

#2 ThrowsException  Icon User is offline

  • D.I.C Head

Reputation: 33
  • View blog
  • Posts: 83
  • Joined: 21-February 12

Re: Binding to a Grid's ColumnDefinition

Posted 03 March 2013 - 08:20 AM

Could you please explain a little more what exactly you're trying to accomplish maybe with code or pseudo code examples? If you're simply trying to bind data from an object to the DataSource of a grid then that is definitely possible.
Was This Post Helpful? 0
  • +
  • -

#3 KFredje  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 131
  • Joined: 06-September 11

Re: Binding to a Grid's ColumnDefinition

Posted 03 March 2013 - 04:22 PM

I just need to be able to bind a ColumnDefinition Width at runtime. I know how it works for normal let's say, binding a text for a textblock or a source for an image. I just can't get to bind the ColumnDefinition Width of my Grid.

I won't be able to reply till March the 9th cause of travel.

This post has been edited by KFredje: 03 March 2013 - 04:23 PM

Was This Post Helpful? 0
  • +
  • -

#4 RandomlyKnighted  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 115
  • View blog
  • Posts: 1,356
  • Joined: 14-January 10

Re: Binding to a Grid's ColumnDefinition

Posted 05 March 2013 - 10:55 PM

Have you tried creating a method that gets the width you need then assigning it to the set accessor of a property? Once you do that then you could just bind to the property by doing:

<ColumnDefinition Width="{Binding Path=PropertyName}"/>



Note: I have not tested this so the XAML may not be exactly accurate.
Was This Post Helpful? 0
  • +
  • -

#5 KFredje  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 131
  • Joined: 06-September 11

Re: Binding to a Grid's ColumnDefinition

Posted 14 March 2013 - 12:00 AM

I found on the internet databinding isn't possible with ColumnDefinition since they are ColumnDefinitionCollection's. Anyhow, I give it a try.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1