Reputation: 13
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.
Upvotes: 1
Views: 2519
Reputation: 4336
GridViewColumn gvc = new GridViewColumn();
gvc.Header = "Value";
Binding b = new Binding();
b.XPath = "./Data/@Value";
gvc.DisplayMemberBinding = b;
GridView.Columns.Add(gvc);
Upvotes: 0
Reputation: 1933
You could do a SetValue within the event handler responsible for changing the width state of the column and update that way.
Upvotes: 0