Skip to content

Commit e2929ba

Browse files
authored
Updates based on customer feedback (#2392)
* docs(grid): Improve auto-fit example * docs(DropDownButton|SplitButton): Docs feedback improvements * Polish Menu Templates article * Explanation polishing * fix slugs
1 parent 10a534d commit e2929ba

File tree

5 files changed

+189
-111
lines changed

5 files changed

+189
-111
lines changed
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

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
````
Binary file not shown.

0 commit comments

Comments
 (0)