on 05-08-2007 8:58 AM
Hi
I have a table with many lines and a radio button on each line.
I want to group the radio buttons according to a contract id from each line.
How do I implement a radio button group by key?
thanks
Hi,
something about radio button:
Every unique value of IWDRadioButton defined by KeyToSelect property. So bind IWDRadioButton.keyToSelect to attribute <context aattribute1> for one radio button and <context attribute2> for other radio button. here you can set the values of them.
SelectedKey attribute must be shared across all radio buttons that form logical "radio button group". In your context design every radio button has unique SelectedKey, so you have one group with only one button. So create on attribute which is assigned then to both the radio buttons SelectedKey property to hold them together in one group.
see this solved post for the same:
hope it helps
let me know if you face any problem
regards
reward points if it helps
Message was edited by:
Abhijeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Abhijeet,
Sure it's possible to use same answer twice if the problem is the same or very similar. However, direct copy-paste is not always applicable.
<i>So bind IWDRadioButton.keyToSelect to attribute Addr_partner...</i> -- hmm... Anton mentioned context structure?
<i> In your context design every radio button has unique SelectedKey, so you have one group with only one button</i> --- author has no radio buttons at all... yet...
VS
Valery,
I have also posted both the the threads , and let me make one thing clear that the answer i copied from my post, also i attached both the posts (yours as well as mine if skipped something in hurry) for his reference. And to be precise , every answer or post gotta be descendant of one or more posts of your, you are so adept that there is hardly any thread which skipped your reply. So dude every post is generalised from yours, after all you are The One for WDJ. I sincerely bow you. Keep it up buddy
regards,
I think I understand what you are saying, but just to clarify:
If my table has 10 rows and each row has a contractID and each row has a radiobutton; if the 1st 5 rows have a contractID = 101 and the next 5 rows have a contractID = 102, then if I set keyToSelect = contractID for radio button property, the 1st 5 rows' radio buttons will be grouped and the next 5 rows' radio buttons will be grouped?
thanks
Anton Kruse
Anton,
KeyToSelect, should be the attribute bound to ContractID, which i hope is a context attribute in node which has 10 rows, here though first 5 rows has same value they wont be grouped , grouping is done by Selectedkey.
take another attribute out of the node structure, which may be a direct descendant of root context , and bind this to SelectedKey of radioButtons, so that all radiobuttons having this attribute as SelectedKey will be grouped,
refer the thread : it will clear your confusion if you have
regards
Anton,
If you understand, then the following picture should be clear to you:
You will have 10 rows hence 10 radio buttons. They all forms one group. First 5 radiobuttons correspond to one ContractID, second 5 to other. If you click any radio button in first group, then 5 radio buttons get mutually selected, and 5 radio buttons from other group get unselected. Similar if you click radio button from second group.
Abhijeet suggestion will work this way.
Is it right?
Valery Silaev
SaM Solutions
Anton,
This way you get as many goups as there are number of rows.
The sad truth is that it's impossible to create 2 groups (or, strictly speaking, more then one group) using RadioButtonByKey as cell editor.
In fact you need to use ContractID only as group designator, some other attribute (from same node) should be used as KeyToSelect and there are should be as many attributes for SelectedKey outside table node as a number of unique contracts. However, for table cell editor it's just impossible to define specific per-row bindings.
VS
Anton,
See, you need to select one of Questionaire.zValue and place it to some other element attribute. This element must be "singleton" per group, i.e. every group must have own unique element to store selected value. SelectedKey shoud therefor point to such element and not to table node element while there are many of them, one per row.
VS
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.