1

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.

3 Answers 3

1

BindingOperations.SetBinding()

Sign up to request clarification or add additional context in comments.

1 Comment

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

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

Comments

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

Comments

Your Answer

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.

Ask question

Explore related questions

See similar questions with these tags.