cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bochie
Resolver I
Resolver I

CheckAll/Reset CheckBox inside component

Hi All,

 

I'm trying to build a component that has a gallery with a checkbox control. Outside of the gallery, I have another checkbox control named AllChkbox and the default value is "true". I set Default property of the checkboxes in the gallery to be AllChkbox.Value. It's all good on visible event of the screen like below:

Bochie_0-1636098641272.png

When I untick any one of the checkboxes inside the gallery, I'd like the AllChkbox control outside the gallery to become unchecked. However, if I check the AllChkbox control, I would also like to check all the checkboxes inside the gallery. I've been running circles with this logic and can't find the solution. I found one solution here, but this is not inside a component. Is it possible to create this logic inside a component? Help! 😔

 

-bochie

 

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you for your reply @v-xiaochen-msft ! I solved it last week by adding a boolean column "Show" to the collection and applying the same principle you outlined above. I had to add the columns because the number of checkboxes are dynamic and they are inside a gallery. In your sample above, the sub-checkboxes are not inside a gallery.

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @Bochie ,

 

I did a test for you.

vxiaochenmsft_0-1636340214840.png

 

CheckBox1:

Default: B

OnCheck: Set(A,true);Reset(Checkbox1_1);Reset(Checkbox1_2);Reset(Checkbox1_3)

OnUncheck: Set(A,false);Reset(Checkbox1_1);Reset(Checkbox1_2);Reset(Checkbox1_3)

 

Checkbox1_1:

Default: A

OnUncheck: Set(B,false);Reset(Checkbox1)

 

Checkbox1_2:

Default: A

OnUncheck: Set(B,false);Reset(Checkbox1)

 

Checkbox1_3:

Default: A

OnUncheck: Set(B,false);Reset(Checkbox1)

 

AAA.gif

 

Best Regards,

Wearsky

Thank you for your reply @v-xiaochen-msft ! I solved it last week by adding a boolean column "Show" to the collection and applying the same principle you outlined above. I had to add the columns because the number of checkboxes are dynamic and they are inside a gallery. In your sample above, the sub-checkboxes are not inside a gallery.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,900)