Skip to content

Commit c82bafb

Browse files
svdimitrmarin-bratanov
authored andcommitted
docs(checkbox): Moved the indeterminatechanged event from state to events article, added a link to it from the overview article.
1 parent 37abdd3 commit c82bafb

File tree

3 files changed

+33
-27
lines changed

3 files changed

+33
-27
lines changed

components/checkbox/events.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ position: 20
1313
This article showcases the available events in the Telerik CheckBox component:
1414
* [ValueChanged](#valuechanged)
1515
* [OnChange](#onchange)
16+
* [IndeterminateChanged](#indeterminatechanged)
1617

1718
## ValueChanged
1819

@@ -146,3 +147,34 @@ The `OnChange` event fires every time the `Value` parameter changes. The key dif
146147
>caption The result from the code snippet above
147148
148149
![checkbox with two-way data binding and OnChange event](images/checkbox-onchange.gif)
150+
151+
## IndeterminateChanged
152+
153+
The `IndeterminateChanged` event fires every time the `Indeterminate` parameter changes.
154+
155+
>caption Handle IndeterminateChanged event
156+
157+
````CSHTML
158+
@*Press the button to toggle the Indeterminate state*@
159+
160+
<TelerikButton Primary="true" OnClick="@(() => Indeterminate = !Indeterminate)"> Toggle Indeterminate </TelerikButton>
161+
162+
<div class="mt-2">
163+
<strong class="text-muted">Indeterminate checkbox</strong>
164+
<TelerikCheckBox @bind-Value="@IndeterminateValue"
165+
Indeterminate="@Indeterminate"
166+
IndeterminateChanged="((bool val) => ChangeHandler(val))">
167+
</TelerikCheckBox>
168+
</div>
169+
170+
@code{
171+
public bool Indeterminate { get; set; }
172+
public bool IndeterminateValue { get; set; }
173+
174+
void ChangeHandler(bool value)
175+
{
176+
Indeterminate = value;
177+
}
178+
}
179+
````
180+
![Toggle Indeterminate state](images/checkbox-toggle-indeterminate-state.gif)

components/checkbox/indeterminate-state.md

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -142,33 +142,6 @@ Every time the Checkbox state is changed (checked or unchecked) the `Indetermina
142142
143143
![gif to showcase the Indeterminate state](images/checkbox-indeterminate-example.gif)
144144

145-
>caption Handle IndeterminateChanged event
146-
147-
````CSHTML
148-
@*Press the button to toggle the Indeterminate state*@
149-
150-
<TelerikButton Primary="true" OnClick="@(() => Indeterminate = !Indeterminate)"> Toggle Indeterminate </TelerikButton>
151-
152-
<div class="mt-2">
153-
<strong class="text-muted">Indeterminate checkbox</strong>
154-
<TelerikCheckBox @bind-Value="@IndeterminateValue"
155-
Indeterminate="@Indeterminate"
156-
IndeterminateChanged="((bool val) => ChangeHandler(val))">
157-
</TelerikCheckBox>
158-
</div>
159-
160-
@code{
161-
public bool Indeterminate { get; set; }
162-
public bool IndeterminateValue { get; set; }
163-
164-
void ChangeHandler(bool value)
165-
{
166-
Indeterminate = value;
167-
}
168-
}
169-
````
170-
![Toggle Indeterminate state](images/checkbox-toggle-indeterminate-state.gif)
171-
172145
## See Also
173146

174147
* [Checkbox Overview]({%slug checkbox-overview%})

components/checkbox/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ The CheckBox provides the following features:
4242
* `Value` and `bind-Value`- mapped to the `Checked` property of the normal HTML checkbox
4343
* The `Value` and `bind-Value` accept `bool` and `bool?` types
4444
* `Indeterminate` and `bind-Indeterminate` - see the [Indeterminate state]({%slug checkbox-indeterminate-state%}) article for more information and examples
45+
* `IndeterminateChanged` - see the [CheckBox events]({%slug checkbox-events%}) article for more information and example
4546
* Validation - see the [Input Validation]({%slug common-features/input-validation%}) article for more details.
4647

4748
## Examples

0 commit comments

Comments
 (0)