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