Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am woring on SilverLight. I have one problem in my project. That is, I have generated checkboxes in gridview at runtime. Now I have to enable false when I Check check box.

Please, Help me ASAP.
Posted
Comments
Nelek 17-Apr-12 11:34am    
People here will help when they can. If you need it ASAP, then do it yourself.

On the other hand... what is your question? What did you try? Where are you having problems? Use the "improve question" and add relevant information

1 solution

I assume from the statement, that you have directly added the checkboxes to the gridview.
A better alternative is to bind the gridview to a datasource of somekind - custom class, or entity set that you control.
In the gridview, in the xaml, create a datatemplate for the item template that defines what you require, and bind the enabled state of the checkbox to whatever property you require.

If that property is on your main viewmodel, you then have the ability to use element to element binding to get to it.

However, adding checkboxes directly would mean having to add a binding directly to the checkbox evertime. Which isn't possible, just not very nice :)
Just create a new Binding in the code and set it to the EnabledProperty of the Checkbox.

Oh, and we are all here to help. We do not work here and are doing this for free. Marking things as ASAP is not a good way to get that help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900