wow, well first of all thanks for such a quick response.. I never could figure it out.. here's more or less what I was doing maybe it will help someone out there
.net they were all server controls-->
<asp:wizard>
<wizardStep>
<repeater id=mainCategories>
<asp:radioButton id="subCatItem" />
<div>
<repeater id=subCategoryDetails>
<asp:checkBoxList id="chbxSubCatListing">
</repeater>
</div>
</repeater>
</wizardStep>
</asp:wizard>
-->C#
//so obviously I left out some code, like casting the dataitem, etc..
//but in the end the idea was to on item bound, get the current radio button assign some attributes to it, onclick to select only one, show/hide the div
//append an id to it, etc...
//bear with me.. but it rendered out exactly what I thought I wanted, a list of radio buttons that show / hid a div of checkbox items
onitemDataBound(sender, itemEventargs e)
{
RadioButton rb = (RadioButt)item.FindControl("subCatItem");
if
(rb != null)
{
//lj is an object type that is cast to the dataitem in code not shown
rb.Attributes.Add("onclick", "javascript:showDiv('chbxGroup_" + lj.uniqueId+ "')");
rb.ID = "rb_"+lj.uniqueId;
rb.Text = lj.typeName;
strFunction = "SetUniqueRadioButton('"+dl.ClientID+"',this);";
rb.Attributes.Add("onclick", strFunction+"javascript:showDiv('chbxGroup_" + lj.uniqueId+ "')");
rb.GroupName = "subCatGroupRadios";
}
foreach (var o in jobTypes)
{
if(i == currentItem && currentItem <= totalResults)
var currentSubCategory = from p in ...
CheckBoxList cb = (CheckBoxList)item.FindControl("chbxSubCatListing");
//incase refresh or something
cb.Items.Clear();
foreach ({type} ljt in currentSubCategory)
{
ListItem li = new ListItem();
li.Text = ljt.jobTypeSubCatyName;
li.Value = ljt.uniqueid.ToString();
r.Items.Add(li);
}
currentItem = i;
}
i++;
}
Now The pain---->
//called on switch that fired on activatewizard step, if step == 1... kind of thing
//and in the end the radio button was always false..
protected int getSubCatValue(){
var returnSubCatId = 0;
jRequest = {cast to object}
var i = 0;
if (subCatItem.HasControls())
{foreach (repeater Item ri in subCatItem.Items)
{
RadioButton rb = (RadioButton)mainCategories.Items[0].FindControl("subCatItem");
CheckBoxList cbl = (CheckBoxList)mainCategories.Items[0].FindControl("chbxSubCatListing");//THIS WAS ALWAYS FALSE, THE TEXT VALUE WOULD COME THROUGH FINE, BUT NOT THE CHECKED STATUS..
if (rb.Checked)
{
}
foreach (ListItem li in cbl.Items)
{
...
So basically that's the gist of what was goig on, I know this code won't build, but since the post I've changed the code, but this was the idea... I abanoonded, and I guess that's what MS wanted me to do... it makes sense why radio buttons aren't idea in repeaters, but VS didnt' tell me not too!! hehe..
BTW, I don' t know how to turn this color off, so I apologize...
But in short this drove me nuts.. honestly It was all rendering fine, it was all server controls, but I coulndnt discern which was checked via server side, I saw it.., but when I'd run through the code that radio button was always false.. each item, I saw the items come through with the correct text value so I know I was close, but I the checked flag was always, always false.. ;..(
So in the end I just went to the gym and worked it out, when I returned, I decided that I'd use checkboxes in a datalist, with a nested checkboxlist that I bound to onitembound, I assigned the same javascript function to the main checkbox to keep it exclusive, and also kept the onclick function on tit to show / hide the div, and bound to the checkboxlist for my sub category details listing...so I didnt lose any functionality.. just a couple years off the backend...
The problem was that I didn't discover the issue with the radiobuttons until I had already built the page out, so I was fighting a losing battle from the start but didnt get ther till I was 6 hours deep..
If you'd like to see the working code I'd be happy to post it, but I've resolved this issue, and am very surprised by the quick response, I will definately return and post back if I run into any more issues.. so I'll probably be posting tomorrow!!!
Thanks again!!