Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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.
BindingOperations.SetBinding()
Add a comment
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);
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.