views:

1027

answers:

3

I need to bind width property of the GridView column that is created dynamically in code.

Since GridViewColumn object has no SetBinding method, how should I do this?

Thanks in advance.

A: 

You could do a SetValue within the event handler responsible for changing the width state of the column and update that way.

Janie
A: 
GridViewColumn gvc = new GridViewColumn();
gvc.Header = "Value";
Binding b = new Binding();
b.XPath = "./Data/@Value";
gvc.DisplayMemberBinding = b;
GridView.Columns.Add(gvc);
odyth
A: 

BindingOperations.SetBinding()

Sergey Galich
Finally something that might work, thanks. No longer need this, but will try someday.
peter