Showing posts with label mutuallyexclusivecheckboxextender. Show all posts
Showing posts with label mutuallyexclusivecheckboxextender. Show all posts

Monday, March 26, 2012

MutuallyExclusiveCheckBoxExtender combined with ToggleButtonExtender

Hey,

I'm trying to combine aToggleButtonExtender with aMutuallyExclusiveCheckBoxExtenderand it seems that the MECBE is overridden by the TBE... I'm guessing that the TBE functions off of click() events while the MECBE solely affects checked / unchecked? Can I get some verification that these two parts don't play well together and it's not error on my side? Thanks a bunch. Sample code below

<asp:CheckBoxID="ChampCheck"runat="server"CssClass="toneProfileRate"AlternateText="People's Champ"/>

<ajaxToolkit:ToggleButtonExtenderrunat="server"ID="champTBE" UncheckedImageUrl="images/action_champed.gif"CheckedImageUrl="images/action_champed_red.gif" TargetControlID="ChampCheck"ImageWidth="18"ImageHeight="18"/><ajaxToolkit:MutuallyExclusiveCheckBoxExtenderrunat="server"ID="champMECBE" TargetControlID="ChampCheck"Key="champChumpMECBE"/>

<asp:CheckBoxID="ChumpCheck"runat="server"CssClass="toneProfileRate"AlternateText="People's Chump"/></td><ajaxToolkit:ToggleButtonExtenderrunat="server"ID="chumpTBE" UncheckedImageUrl="images/action_chumped.gif"CheckedImageUrl="images/action_chumped_red.gif" TargetControlID="ChumpCheck"ImageHeight="18"ImageWidth="18"/><ajaxToolkit:MutuallyExclusiveCheckBoxExtenderrunat="server"ID="chumpMECBE" TargetControlID="ChumpCheck"Key="champChumpMECBE"/>

Thanks again,

Omar

I suspect you're right - pleaseopen a work item to report and track this issue. Thank you!

Hi,

I'm dealing with the same problem. Have you opened a ticket? What solution do you use in the meantime?

Regards

Adina

MutuallyExclusiveCheckBoxExtender with ValidatorCallout Extender?

is there a way to useAjax Mutually Exclusive CheckBox Extender withAjax ValidatorCallout Extender ?

combining togather and let say if i did not check the checkbox then i should get validator callout extender - possible ?

thanks.

Hi Nisarkhan,

As far as I know, there's no direct way unless we modify ValidatorCalloutExtender's source code. ValidatorCallout is designed to use with Validators. In your situation, I think you should better use Javascript + Div and draw the propmt div by yourself. Thanks.

Best regards,

Jonathan.

MutuallyExclusiveCheckBoxExtender in Panel in Updatepanel in Repaeter!

Hi,

I've used this site for reference many times (coz i'm that good!) but this is my first post, so thanks for all the help guys!

Anyway...

I have a page with a repeater control. inside the repeater, i have an updatepanel (i don't need the whole repeater refreshed), and inside that, i have 2 checkboxes that i want to be mutually exclusive!

straightforward huh? er...no!!

adding the MutuallyExclusiveCheckBoxExtender to the panel at Design time causes ALL the checkboxes to uncheck when you click on one, and i can't seem to add the MECE's dynamically at runtime - when i click, nothing happens.

Here's some code for you... it's placed inside Repeater_ItemDatabound

//Check the boxes depending upon user's role Panel myPanel = e.Item.FindControl("RolePanel")as Panel;if (myPanel !=null) { CheckBox myCbA = myPanel.FindControl("cbAdmin")as CheckBox;if (myCbA !=null) { myCbA.Checked = Roles.IsUserInRole(myUser,"Administrator"); } CheckBox myCbB = myPanel.FindControl("cbUser")as CheckBox;if (myCbB !=null) { myCbB.Checked = Roles.IsUserInRole(myUser,"User"); }//Add some ajax! AjaxControlToolkit.MutuallyExclusiveCheckBoxExtender MeCeA =new AjaxControlToolkit.MutuallyExclusiveCheckBoxExtender(); AjaxControlToolkit.MutuallyExclusiveCheckBoxExtender MeCeB =new AjaxControlToolkit.MutuallyExclusiveCheckBoxExtender(); MeCeA.ID ="MeCeA" + ItemCount.ToString(); MeCeA.Key ="Roles" + ItemCount.ToString(); MeCeA.TargetControlID = myCbA.ID; MeCeB.ID ="MeCeB" + ItemCount.ToString(); MeCeB.Key ="Roles" + ItemCount.ToString(); MeCeB.TargetControlID = myCbB.ID; myPanel.Controls.Add(MeCeA); myPanel.Controls.Add(MeCeB); }

and the source... placed inside the RepeaterItem ItemTemplate

<ajax:UpdatePanel ID="UserDetailsUpdatePanel" runat="server" UpdateMode="Always"> <ContentTemplate> <cc1:AnimationExtender ID="AnimationExtender1" runat="server" TargetControlID="lblResponse"> <Animations> <OnLoad> <FadeOut Duration=".5" Fps="20" /> </OnLoad> </Animations> </cc1:AnimationExtender> <div class="RolePanel"> <asp:Panel ID="RolePanel" runat="server"> <asp:CheckBox ID="cbAdmin" runat="server" Text="Administrator" AutoPostBack="true" /><br /> <asp:CheckBox ID="cbUser" runat="server" Text="User" AutoPostBack="true" /><br /> <center><asp:LinkButton ID="lbtnRoles" runat="server" Text="Submit" /></center> <center><asp:Label ID="lblResponse" runat="server" Visible="False" /></center> </asp:Panel> </div> </ContentTemplate> </ajax:UpdatePanel>

I hope someone can help me - this ajax stuff makes my sites look and feel all funky!

TIA

Ché

Seriously... is there no-one who can help me?

Hi,

If I understand the question correctly, you want all 2 to be mutually exclusive checkboxes.

Have you tried adding 2 MutuallyExclusiveCheckBoxExtender in design mode and specifying the same key for both of them?


Yep, i tried that, but where it's inside a repeater it clears all the checkboxes including ones in the different repeateritems.

so, i had the brilliant idea of dynamically creating the extenders at runtime and giving each pair a key, also created at runtime so it's different for each repeateritem.

didn't work.*sob*

so then i thought of grabbing each extender as the repeateritem was databound and applying the unique key there...

nope - didn't work!

Take a quick look at this...


once, i thought it'd be simple!!

TIA for any help!!

Ché


Sorted It!!

one of my plans was indeed correct - i didn't set a key in design time, then at runtime, i grabbed the two extenders and set a unique key for them on each RepeaterItem_DataBound.

Job done!!


MutuallyExclusiveCheckBoxExtender doesnt work if elements are added dynamically

I create my table on the fly and added checkboxes as well as MECBextenders.

The client script is not working on the page. It works as expected if the MECBs are added during design time.

Here is some code to demonstrate population:

1string extenderKey ="AllTheSameKey";23foreach (MvpPoint pointin _selected.FolderPoints)4 {5678switch (point.PointType)9 {10case tPointType.DO:11case tPointType.CP:12 {13continue;14 }15default:16 {17 trow =new TableRow();1819 CheckBox chkSelected =new CheckBox();20string sPointId = point.Handle.ToString();21 chkSelected.ID ="chk" + sPointId;22 chkSelected.Visible =true;23if (point.PointType == tPointType.AI)24 chkSelected.Enabled =true;25else26 chkSelected.Enabled =true;2728 AjaxControlToolkit.MutuallyExclusiveCheckBoxExtender chkExtender =new AjaxControlToolkit.MutuallyExclusiveCheckBoxExtender();29 chkExtender.ID ="chkExt" + sPointId;30 chkExtender.TargetControlID = chkSelected.ID;31 chkExtender.Key = extenderKey;32

The problem ONLY exists if the MutuallyExclusiveCheckBoxExtender is cointeined inside a TabPanel. The IDs get changed by the cointeiner control and the jscript fails to find them.