Skip to content

Commit 37abdd3

Browse files
svdimitrmarin-bratanov
authored andcommitted
docs(checkbox): added demo on indeterminatechange event to the corresponding article
1 parent 4794afc commit 37abdd3

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Loading

components/checkbox/indeterminate-state.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,37 @@ Every time the Checkbox state is changed (checked or unchecked) the `Indetermina
137137
}
138138
}
139139
````
140+
140141
>caption The result from the code snippet above
141142
142143
![gif to showcase the Indeterminate state](images/checkbox-indeterminate-example.gif)
143144

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)
144171

145172
## See Also
146173

0 commit comments

Comments
 (0)