Skip to content

Commit 1b7c904

Browse files
committed
chore(common): fix snippets and skip repls
1 parent 8c01a44 commit 1b7c904

10 files changed

+30
-10
lines changed

components/treeview/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ The table below lists the TreeView methods. Also consult the [TreeView API](/bla
151151
| `Rebind` | [Refreshes the component data]({%slug treeview-refresh-data%}#rebind-method). |
152152
| `GetItemFromDropIndex` <br /> `(string index)` | gets the corresponding `TItem` of the destination TreeView from the passed [`DestinationIndex`]({%slug grid-drag-drop-overview%}#event-arguments) |
153153

154+
<div class="skip-repl"></div>
154155
````RAZOR
155156
<TelerikTreeView @ref="@TreeViewRef" .../>
156157

globalization/rtl-support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Right-to-left support is configured at the root level so it affects all UI for B
2020

2121
To enable right-to-left direction of the components in your application, set the `EnableRtl` parameter of the [`TelerikRootComponent`]({%slug rootcomponent-overview%}) to `true`.
2222

23+
<div class="skip-repl"></div>
2324
````TelerikLayout.razor
2425
<TelerikRootComponent EnableRtl="true">
2526
@Body

knowledge-base/animationcontainer-close-on-outside-click.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ To achieve the desired scenario:
3636
1. If the target is outside, [call a .NET method from the JavaScript code](https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-dotnet-from-javascript) that will close the AnimationContainer.
3737
1. When closing the AnimationContainer from JavaScript, [detach](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener) the `click` handler from step 2.
3838

39+
> Replace the `Index` type of the `DotNetObjectReference` in the example below with the type of the component that hosts this code.
40+
3941
>caption Close the AnimationContainer upon an outside click
4042
43+
<div class="skip-repl"></div>
4144
````RAZOR
4245
@inject IJSRuntime js
4346
@@ -50,7 +53,8 @@ To achieve the desired scenario:
5053
</TelerikAnimationContainer>
5154
5255
@* suppress-error allows script tags in Razor files. Move this script to a separate file *@
53-
<script suppress-error="BL9992">//
56+
<script suppress-error="BL9992">
57+
//
5458
function attachCloseTAC(dotNetReference) {
5559
dotNet = dotNetReference;
5660
document.documentElement.addEventListener("click", checkHideTAC);
@@ -64,13 +68,14 @@ To achieve the desired scenario:
6468
dotNet.invokeMethodAsync("HideTAC");
6569
}
6670
}
67-
//</script>
71+
//</script>
6872
6973
@code {
7074
private TelerikAnimationContainer TAC { get; set; }
7175
7276
private bool TACOpen { get; set; }
7377
78+
//Replace the Index type with the type of the component that hosts this code
7479
private DotNetObjectReference<Index>? DotNetRef;
7580
7681
private async Task ShowTAC()

knowledge-base/common-catch-all-exceptions-globally.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Consider the following application layout setup:
4343

4444
>caption TelerikLayout.razor
4545
46+
<div class="skip-repl"></div>
4647
````RAZOR
4748
@inherits LayoutComponentBase
4849
@@ -53,6 +54,7 @@ Consider the following application layout setup:
5354

5455
>caption MainLayout.razor
5556
57+
<div class="skip-repl"></div>
5658
````RAZOR
5759
@layout TelerikLayout
5860
@inherits LayoutComponentBase
@@ -78,6 +80,7 @@ To handle this, wrap the `ErrorBoundary` component around the `<TelerikRootCompo
7880

7981
>caption TelerikLayout.razor
8082
83+
<div class="skip-repl"></div>
8184
````RAZOR
8285
@inherits LayoutComponentBase
8386
@@ -92,6 +95,7 @@ If the application is using only one layout file, it should look like this:
9295

9396
>caption MainLayout.razor
9497
98+
<div class="skip-repl"></div>
9599
````RAZOR
96100
@inherits LayoutComponentBase
97101

knowledge-base/common-newtonsoft-breaks-datasourcerequest-serialization.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Now, when I <a href="https://github.com/telerik/blazor-ui/tree/master/grid/datas
3939

4040
Add the Newtonsoft JSON serialization service to your ASP.NET Core backend that also needs to process the Blazor grid requests.
4141

42+
<div class="skip-repl"></div>
4243
````RAZOR
4344
//something like
4445
@@ -75,7 +76,8 @@ Use explicit System.Text.Json serialization when needed:
7576

7677
* to serialize the DataSourceRequest - make it explicit in the WASM app service:
7778

78-
````C#.skip-repl
79+
<div class="skip-repl"></div>
80+
````C#
7981
public async Task<DataEnvelope<WeatherForecast>> GetForecastListAsync(DataSourceRequest gridRequest)
8082
{
8183
HttpResponseMessage response = await Http.PostAsJsonAsync(
@@ -87,7 +89,8 @@ public async Task<DataEnvelope<WeatherForecast>> GetForecastListAsync(DataSource
8789

8890
* when deserializing it - don't let the framework deserialize with the registered serialized (Newtonsoft) but take it as a string in the action and deserialize explicitly there with System.Text.Json:
8991

90-
````C#.skip-repl
92+
<div class="skip-repl"></div>
93+
````C#
9194
[HttpPost]
9295
public async Task<DataEnvelope<WeatherForecast>> Post([FromBody] string gridRequestAsString)
9396
{

knowledge-base/common-struct-error.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ res_type: kb
2424

2525
When using a data-bound component, the application gets a null exception, and the component does not work. When running the Telerik Blazor application the application gets an error similar to the following:
2626

27-
````C#.skip-repl
27+
<div class="skip-repl"></div>
28+
````C#
2829
ArgumentNullException: Value cannot be null. (Parameter 'source')
2930
System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
3031
````
3132

3233
To reproduce the problem, you can use the following code sample:
34+
35+
<div class="skip-repl"></div>
3336
````RAZOR
3437
<TelerikGrid Data="@GridData">
3538
<GridColumns>
@@ -83,7 +86,6 @@ The cause for this null exception is the binding of Telerik UI for Blazor compon
8386
The solution is to always bind the component to a `class` model, not a `struct`. For more information, see [Data Binding Overview]({%slug common-features-data-binding-overview%}#how-to-provide-data).
8487

8588
<div class="skip-repl"></div>
86-
8789
````CS
8890
public class Product
8991
{

knowledge-base/dropdown-kb-bind-to-enum.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Here are examples of both.
6161
6262
@* for a combo box, make sure that custom values and clearing are not available unless you are explicitly OK with that *@
6363
<TelerikComboBox Data="@myDdlData" TextField="MyTextField" ValueField="MyValueField" @bind-Value="@selectedValue"
64-
ClearButton="false" AllowCustom="false" Filterable="true">
64+
ShowClearButton="false" AllowCustom="false" Filterable="true">
6565
</TelerikComboBox>
6666
6767
@code {
@@ -104,7 +104,7 @@ You will see blank space above the combobox until you select something.
104104
<br />
105105
106106
<TelerikComboBox Data="@myDdlData" TextField="MyTextField" ValueField="MyValueField" @bind-Value="@selectedValue"
107-
ClearButton="false" AllowCustom="false" Filterable="true" Placeholder="Select an option">
107+
ShowClearButton="false" AllowCustom="false" Filterable="true" Placeholder="Select an option">
108108
</TelerikComboBox>
109109
110110
@code {

knowledge-base/dropdowns-readonly-struct-error.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Telerik.Blazor.Components.TelerikComboBox<TItem, TValue>.<OnParametersSetAsync>b
3434

3535
## Steps to Reproduce
3636

37+
<div class="skip-repl"></div>
3738
````RAZOR
3839
Selected value: @selectedValue
3940
<br />
@@ -70,7 +71,7 @@ There are two approaches to avoiding this error:
7071

7172
* When setting the `Data` of the dropdown, make it a collection of anonymous objects, for example:
7273

73-
**Razor**
74+
<div class="skip-repl"></div>
7475
````RAZOR.skip-repl
7576
@* See the Select in the Data parameter *@
7677

knowledge-base/editor-convert-to-plain-text.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ To export to another format, use the corresponding namespace and format provider
4545

4646
>caption Obtain the Editor HTML value as plain text
4747
48+
<div class="skip-repl"></div>
4849
````RAZOR
4950
@*TxtFormatProvider*@
5051
@using Telerik.Windows.Documents.Flow.FormatProviders.Txt;

knowledge-base/grid-center-checkbox-column.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ How to center the selection checkboxes in the GridCheckboxColumn?
3232
There are a few alternative ways to center the checkboxes in the GridCheckboxColumn or the TreeListCheckboxColumn.
3333

3434
* The easiest option is to set a smaller column width:
35-
35+
<div class="skip-repl"></div>
3636
````RAZOR
3737
<GridCheckboxColumn Width="40px" />
3838
````
3939
4040
* Use CSS, which centers the content of the first Grid/TreeList column, no matter what that column is.
4141
42+
<div class="skip-repl"></div>
4243
````RAZOR
4344
<TelerikGrid Class="center-first-column" />
4445
@@ -52,6 +53,7 @@ There are a few alternative ways to center the checkboxes in the GridCheckboxCol
5253
5354
* Use the `OnCellRender` event of the [Grid]({%slug grid-column-events%}) or [TreeList]({%slug treelist-column-events%}) to render a custom CSS class for the checkbox column table cells. Then, apply a `text-align:center` style for this class. You will need [CSS specificity](https://css-tricks.com/specifics-on-css-specificity/), which is higher than **0, 0, 1, 1** (one class and one element).
5455
56+
<div class="skip-repl"></div>
5557
````RAZOR
5658
<GridCheckboxColumn
5759
OnCellRender="@( (GridCellRenderEventArgs args) => args.Class = "center-cell" )" />

0 commit comments

Comments
 (0)