Skip to content

Commit b6ef834

Browse files
authored
Merge branch 'master' into themes-docs-removal
2 parents 86b24d8 + 79c5b3f commit b6ef834

File tree

17 files changed

+438
-148
lines changed

17 files changed

+438
-148
lines changed

_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ defaults:
702702
category: "default"
703703
product: "blazor"
704704
editable: true
705-
description_suffix: "Read more in Telerik UI for Blazor Documentation."
705+
description_suffix: ""
706706
-
707707
scope:
708708
path: "blazor"
@@ -765,7 +765,7 @@ defaults:
765765
category: "default"
766766
product: "blazor"
767767
editable: true
768-
description_suffix: "Read more in our Blazor Knowledge Base articles."
768+
description_suffix: ""
769769
-
770770
scope:
771771
path: "web.config"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#dropdownbutton-splitbutton-comparison
22
The DropDownButton and SplitButton components are similar. They both consist of a primary button and a dropdown element that holds additional action items. The major difference is the purpose of the primary button.
33

4-
* [DropDownButton]({%slug dropdownbutton-overview%}) - The main purpose of the primary button is to open the popup with additional actions. The primary button does expose a separate [`OnClick` event]({%slug dropdownbutton-events%}), so you can handle it to invoke a dedicated action but clicking on it always opens the dropdown.
4+
* [DropDownButton]({%slug dropdownbutton-overview%})—The main purpose of the primary button is to open the popup with additional actions. The primary button exposes a separate [`OnClick` event]({%slug dropdownbutton-events%}), which can invoke a dedicated action. Clicking on the DropDownButton always opens the dropdown.
55

6-
* [SplitButton]({%slug splitbutton-overview%}) - The main element contains a primary button and a separate button for opening the dropdown. The purpose of the primary button is to [invoke a standalone action]({%slug splitbutton-events%}#onclick). Clicking on it does not open the dropdown. To open the popup with the additional actions, the user has to click the dedicated button with `caret-alt-down` icon.
6+
* [SplitButton]({%slug splitbutton-overview%})—The main element contains a primary button and a separate button for opening the dropdown. The purpose of the primary button is to [invoke a standalone action]({%slug splitbutton-events%}#onclick). Clicking on it does not open the dropdown. To open the popup with the additional actions, the user has to click the dedicated button with `caret-alt-down` icon. It is possible to [switch the primary and dropdown actions programmatically]({%slug splitbutton-kb-change-primary-action-onclick%}).
77
#end

common-features/data-binding/onread.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Each component name points to component-specific `OnRead` documentation and exam
5959
| [DropDownList]({%slug components/dropdownlist/events%}#onread) | - | [DropDownList virtualization]({%slug dropdownlist-virtualization%}) |
6060
| [Grid]({%slug components/grid/manual-operations%}) | [Grid paging]({%slug components/grid/features/paging%}) | [Grid row virtualization]({%slug components/grid/virtual-scrolling%}) |
6161
| [ListView]({%slug listview-manual-operations%}) | [ListView paging]({%slug listview-paging%}) | - |
62+
| [MultiColumnComboBox]({%slug multicolumncombobox-events%}#onread) | - | [MultiColumnComboBox virtualization]({%slug multicolumncombobox-virtualization%}) |
6263
| [MultiSelect]({%slug multiselect-events%}#onread) | - | [MultiSelect virtualization]({%slug multiselect-virtualization%}) |
6364

6465
Components like the [**TreeList**]({%slug treelist-data-binding-load-on-demand%}) and the [**TreeView**]({%slug components/treeview/data-binding/load-on-demand%}) don't have an `OnRead` event. Instead, they load data on demand via `OnExpand` events.

components/grid/columns/resize.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ The known limitations of the Autofit Columns feature include:
6666
>caption Grid Column Resizing and Autofitting
6767
6868
````CSHTML
69-
@* Grid column resizing and autofitting *@
70-
@* Drag the border between column headers to change the column width. The command column is not resizable by the user. *@
69+
<p>Resize the Grid columns and click the AutoFit buttons. The command column is not resizable by the user.</p>
7170
7271
<TelerikButton OnClick="@AutoFitSingleColumn">AutoFit ID Column</TelerikButton>
7372
<TelerikButton OnClick="@AutoFitMultipleColumns">AutoFit String Columns</TelerikButton>
@@ -76,38 +75,43 @@ The known limitations of the Autofit Columns feature include:
7675
<TelerikGrid @ref="@GridRef"
7776
Data="@GridData"
7877
Resizable="true"
79-
Pageable="true" PageSize="10" Sortable="true" Height="300px">
78+
Pageable="true"
79+
Sortable="true"
80+
Height="300px">
8081
<GridColumns>
81-
<GridColumn Field=@nameof(SampleData.Id) Title="ID" Id="IDColumn" />
82-
<GridColumn Field=@nameof(SampleData.Name) Title="First Name" Id="NameColumn1" />
83-
<GridColumn Field=@nameof(SampleData.LastName) Title="Last Name" Id="NameColumn2" />
82+
<GridColumn Field=@nameof(SampleData.Id) Title="ID" Id="@IdColumnId" />
83+
<GridColumn Field=@nameof(SampleData.FirstName) Title="First Name" Id="@FirstNameColumnId" />
84+
<GridColumn Field=@nameof(SampleData.LastName) Title="Last Name" Id="@LastNameColumnId" />
8485
<GridCommandColumn Width="100px" Resizable="false">
85-
<GridCommandButton Command="Save" Icon="@SvgIcon.Save" ShowInEdit="true">Update</GridCommandButton>
86-
<GridCommandButton Command="Edit" Icon="@SvgIcon.Pencil">Edit</GridCommandButton>
87-
<GridCommandButton Command="Delete" Icon="@SvgIcon.Trash">Delete</GridCommandButton>
88-
<GridCommandButton Command="Cancel" Icon="@SvgIcon.Cancel" ShowInEdit="true">Cancel</GridCommandButton>
86+
<GridCommandButton Icon="@SvgIcon.Pencil">Edit</GridCommandButton>
87+
<GridCommandButton Icon="@SvgIcon.Trash">Delete</GridCommandButton>
8988
</GridCommandColumn>
9089
</GridColumns>
9190
</TelerikGrid>
9291
9392
@code {
94-
public TelerikGrid<SampleData> GridRef { get; set; }
95-
public List<SampleData> GridData { get; set; }
93+
public TelerikGrid<SampleData>? GridRef { get; set; }
94+
public List<SampleData> GridData { get; set; } = new();
95+
96+
// Columns IDs used in the Grid column definitions and in the AutoFit methods.
97+
private const string IdColumnId = "id-column";
98+
private const string FirstNameColumnId = "first-name-column";
99+
private const string LastNameColumnId = "last-name-column";
96100
97101
private async Task AutoFitSingleColumn()
98102
{
99-
await GridRef.AutoFitColumnAsync("IDColumn");
103+
await GridRef!.AutoFitColumnAsync(IdColumnId);
100104
}
101105
102106
private async Task AutoFitMultipleColumns()
103107
{
104-
var columns = new List<string>() { "NameColumn1", "NameColumn2" };
105-
await GridRef.AutoFitColumnsAsync(columns);
108+
var columnIds = new List<string>() { FirstNameColumnId, LastNameColumnId };
109+
await GridRef!.AutoFitColumnsAsync(columnIds);
106110
}
107111
108112
private async Task AutoFitAllColumns()
109113
{
110-
await GridRef.AutoFitAllColumnsAsync();
114+
await GridRef!.AutoFitAllColumnsAsync();
111115
}
112116
113117
protected override void OnInitialized()
@@ -120,16 +124,16 @@ The known limitations of the Autofit Columns feature include:
120124
return Enumerable.Range(1, 50).Select(x => new SampleData
121125
{
122126
Id = x,
123-
Name = $"name {x}",
127+
FirstName = $"Name {x}",
124128
LastName = $"Surname {x}"
125129
}).ToList();
126130
}
127131
128132
public class SampleData
129133
{
130134
public int Id { get; set; }
131-
public string Name { get; set; }
132-
public string LastName { get; set; }
135+
public string FirstName { get; set; } = string.Empty;
136+
public string LastName { get; set; } = string.Empty;
133137
}
134138
}
135139
````

components/mediaquery/integration.md

Lines changed: 136 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,142 @@ You can resize the Chart based on the browser size and re-render with the new di
191191

192192
## Form Integration
193193

194-
You can utilize the Form Columns to fit the contents of the Telerik Form to a smaller browser window. You can find an example in the <a href="https://github.com/telerik/blazor-ui/tree/master/form/responsive-form" target="_blank">Responsive Form</a> demo application.
194+
You can use the MediaQuery component to set various [layout-related parameters of the Form component]({%slug form-overview%}#form-parameters), such as `Orientation`, `Columns`, `ColumnSpacing`, and `ButtonsLayout`.
195+
196+
>caption Responsive Form with MediaQuery
197+
198+
````CSHTML
199+
@using System.ComponentModel.DataAnnotations
200+
201+
<ul>
202+
<li>
203+
<code>IsSmallScreen</code>: <strong>@IsSmallScreen</strong>
204+
</li>
205+
<li>
206+
<code>IsMediumScreen</code>: <strong>@IsMediumScreen</strong>
207+
</li>
208+
<li>
209+
<code>IsLargeScreen</code>: <strong>@IsLargeScreen</strong>
210+
</li>
211+
<li>
212+
<code>IsExtraLargeScreen</code>: <strong>@IsExtraLargeScreen</strong>
213+
</li>
214+
</ul>
215+
216+
<TelerikForm Model="@Employee"
217+
ButtonsLayout="@FormButtonsLayout"
218+
Orientation="@FormOrientation">
219+
<FormValidation>
220+
<DataAnnotationsValidator></DataAnnotationsValidator>
221+
<TelerikValidationSummary />
222+
</FormValidation>
223+
<FormItems>
224+
<FormGroup LabelText="Personal Information" Columns="@FormGroupColumns" ColumnSpacing="@FormGroupColumnSpacing">
225+
<FormItem Field="@nameof(Person.FirstName)" LabelText="First Name"></FormItem>
226+
<FormItem Field="@nameof(Person.MiddleName)" LabelText="Middle Name"></FormItem>
227+
<FormItem Field="@nameof(Person.LastName)" LabelText="Last Name"></FormItem>
228+
<FormItem Field="@nameof(Person.BirthDate)" LabelText="Birth Date"></FormItem>
229+
<FormItem Field="@nameof(Person.Address)" EditorType="@FormEditorType.TextArea" ColSpan="@FormGroupColumns"></FormItem>
230+
</FormGroup>
231+
<FormGroup LabelText="Work Information" Columns="@FormGroupColumns" ColumnSpacing="@FormGroupColumnSpacing">
232+
<FormItem Field="@nameof(Person.Id)" LabelText="Corporate ID" Enabled="false"></FormItem>
233+
<FormItem Field="@nameof(Person.HireDate)" LabelText="Hire Date"></FormItem>
234+
<FormItem Field="@nameof(Person.Team)"></FormItem>
235+
<FormItem Field="@nameof(Person.LeaveDate)" LabelText="Leave Date"></FormItem>
236+
</FormGroup>
237+
</FormItems>
238+
</TelerikForm>
239+
240+
<TelerikMediaQuery Media="@SmallScreenMediaQuery" OnChange="@( (bool matches) => { IsSmallScreen = matches; ConfigureForm(); } )" />
241+
<TelerikMediaQuery Media="@MediumScreenMediaQuery" OnChange="@( (bool matches) => { IsMediumScreen = matches; ConfigureForm(); } )" />
242+
<TelerikMediaQuery Media="@LargeScreenMediaQuery" OnChange="@( (bool matches) => { IsLargeScreen = matches; ConfigureForm(); } )" />
243+
<TelerikMediaQuery Media="@ExtraLargeScreenMediaQuery" OnChange="@( (bool matches) => { IsExtraLargeScreen = matches; ConfigureForm(); } )" />
244+
245+
@code {
246+
private Person Employee { get; set; } = new() { Id = 1234 };
247+
248+
private FormOrientation FormOrientation { get; set; } = FormOrientation.Vertical;
249+
private FormButtonsLayout FormButtonsLayout { get; set; } = FormButtonsLayout.Start;
250+
private int FormGroupColumns { get; set; } = 1;
251+
private string FormGroupColumnSpacing { get; set; } = string.Empty;
252+
253+
private string SmallScreenMediaQuery { get; set; } = "(max-width: 430px)";
254+
private string MediumScreenMediaQuery { get; set; } = "(min-width: 431px)";
255+
private string LargeScreenMediaQuery { get; set; } = "(min-width: 768px)";
256+
private string ExtraLargeScreenMediaQuery { get; set; } = "(min-width: 1199px)";
257+
258+
private bool IsSmallScreen { get; set; }
259+
private bool IsMediumScreen { get; set; }
260+
private bool IsLargeScreen { get; set; }
261+
private bool IsExtraLargeScreen { get; set; }
262+
263+
private void ConfigureForm()
264+
{
265+
if (IsMediumScreen)
266+
{
267+
FormOrientation = FormOrientation.Horizontal;
268+
FormButtonsLayout = FormButtonsLayout.Center;
269+
FormGroupColumns = 2;
270+
FormGroupColumnSpacing = "1em";
271+
}
272+
273+
if (IsSmallScreen)
274+
{
275+
FormOrientation = FormOrientation.Vertical;
276+
FormButtonsLayout = FormButtonsLayout.Stretch;
277+
FormGroupColumns = 1;
278+
FormGroupColumnSpacing = string.Empty;
279+
}
280+
281+
if (IsLargeScreen)
282+
{
283+
FormOrientation = FormOrientation.Vertical;
284+
FormButtonsLayout = FormButtonsLayout.Start;
285+
FormGroupColumns = 3;
286+
FormGroupColumnSpacing = "2em";
287+
}
288+
289+
if (IsExtraLargeScreen)
290+
{
291+
FormOrientation = FormOrientation.Vertical;
292+
FormButtonsLayout = FormButtonsLayout.End;
293+
FormGroupColumns = 4;
294+
FormGroupColumnSpacing = "3em";
295+
}
296+
}
297+
298+
public class Person
299+
{
300+
public int Id { get; set; }
301+
302+
[Required]
303+
public string FirstName { get; set; } = string.Empty;
304+
305+
[Required]
306+
public string MiddleName { get; set; } = string.Empty;
307+
308+
[Required]
309+
public string LastName { get; set; } = string.Empty;
310+
311+
[Required]
312+
public string Address { get; set; } = string.Empty;
313+
314+
[Required]
315+
public DateTime? BirthDate { get; set; }
316+
317+
[Required]
318+
public DateTime HireDate { get; set; } = DateTime.Today;
319+
320+
[Required]
321+
public string? Team { get; set; }
322+
323+
public DateTime? LeaveDate { get; set; }
324+
}
325+
}
326+
````
195327

196328
## See Also
197-
198-
* [Live Demo: MediaQuery - Grid Integration](https://demos.telerik.com/blazor-ui/mediaquery/grid-integration)
199-
* [Overview]({%slug mediaquery-overview%})
200-
* [Events]({%slug mediaquery-events%})
201329

202-
330+
* [Live Demo: MediaQuery and Grid Integration](https://demos.telerik.com/blazor-ui/mediaquery/grid-integration)
331+
* [MediaQuery Overview]({%slug mediaquery-overview%})
332+
* [MediaQuery Events]({%slug mediaquery-events%})

components/mediaquery/overview.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,16 @@ The <a href = "https://www.telerik.com/blazor-ui/mediaquery" target="_blank">Med
6161

6262
@[template](/_contentTemplates/common/parameters-table-styles.md#table-layout)
6363

64-
| Parameter | Type and Default value | Description |
65-
|-----------|------------------------|-------------|
66-
| `Media` | `string` | the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries" target="_blank">media query string</a> that will be matched. |
64+
| Parameter | Type | Description |
65+
|---|---|---|
66+
| `Media` | `string` | The <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries" target="_blank">media query string</a> that will be matched. |
6767

6868
## Notes
6969

70-
The MediaQuery component facilitates the usage of CSS media queries in your C# code. There are a few points to keep in mind:
70+
The MediaQuery component facilitates the usage of CSS media queries in your C# code:
7171

72-
* The MediaQuery component is not a replacement for responsive design, layout and CSS. You should use them to create your responsive application layouts like with any other web application.
73-
74-
* The MediaQuery component makes it easy to use C# logic based on the breakpoint that matches - such as changing parameter values, replacing a component with a different component or even not rendering a part of the layout (with CSS alone you can resize parts of the app or hide them visually, but they still render).
72+
* The MediaQuery component makes it easy to use C# logic based on the matched media query breakpoints. For example, you can change parameter values, replace a component with a different component or even not render parts of the layout. With CSS alone you can resize parts of the app or hide them visually, but they still render.
73+
* The MediaQuery component is not designed as a full replacement for responsive design, layout and CSS. You should use them to create your responsive application layouts like with any other web application.
7574

7675
## Next Steps
7776

-1.18 KB
Binary file not shown.

0 commit comments

Comments
 (0)