Skip to content

Commit 85adb73

Browse files
dimodiyordan-mitev
andauthored
[7.0] docs(Grid|TreeList): Document hidden columns' editability (#2469)
* docs(Grid|TreeList): Document hidden columns' editability * Update components/grid/editing/popup.md Co-authored-by: Yordan <[email protected]> --------- Co-authored-by: Yordan <[email protected]>
1 parent bdcd99a commit 85adb73

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

components/grid/editing/popup.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,18 @@ The Popup editing mode supports [validation]({%slug common-features/input-valida
3636
````CSHTML
3737
@using System.ComponentModel.DataAnnotations
3838
39-
<strong>Editing is cancelled for the first two records.</strong>
39+
<strong>Editing is cancelled for the fifth item conditionally.</strong>
4040
4141
<TelerikGrid Data=@MyData EditMode="@GridEditMode.Popup" Pageable="true" Height="500px"
4242
OnUpdate="@UpdateHandler" OnEdit="@EditHandler" OnDelete="@DeleteHandler" OnCreate="@CreateHandler" OnCancel="@CancelHandler">
4343
<GridToolBarTemplate>
4444
<GridCommandButton Command="Add" Icon="@SvgIcon.Plus">Add Employee</GridCommandButton>
4545
</GridToolBarTemplate>
4646
<GridColumns>
47-
<GridColumn Field=@nameof(SampleData.ID) Title="ID" Editable="false" />
48-
<GridColumn Field=@nameof(SampleData.Name) Title="Name" />
47+
<GridColumn Field=@nameof(SampleData.ID) Title="ID" Editable="false" Width="80px" />
48+
<GridColumn Field=@nameof(SampleData.FirstName) Title="First Name" />
49+
<GridColumn Field=@nameof(SampleData.MiddleName) Title="Middle Name" Visible="false" />
50+
<GridColumn Field=@nameof(SampleData.LastName) Title="Last Name" />
4951
<GridCommandColumn>
5052
<GridCommandButton Command="Edit" Icon="@SvgIcon.Pencil">Edit</GridCommandButton>
5153
<GridCommandButton Command="Delete" Icon="@SvgIcon.Trash">Delete</GridCommandButton>
@@ -120,8 +122,14 @@ The Popup editing mode supports [validation]({%slug common-features/input-valida
120122
{
121123
public int ID { get; set; }
122124
123-
[Required(ErrorMessage = "The employee must have a name")]
124-
public string Name { get; set; }
125+
[Required]
126+
public string FirstName { get; set; }
127+
128+
[Required]
129+
public string MiddleName { get; set; }
130+
131+
[Required]
132+
public string LastName { get; set; }
125133
}
126134
127135
public List<SampleData> MyData { get; set; }
@@ -157,7 +165,9 @@ The Popup editing mode supports [validation]({%slug common-features/input-valida
157165
_data.Add(new SampleData()
158166
{
159167
ID = i,
160-
Name = "Name " + i.ToString()
168+
FirstName = "First " + i.ToString(),
169+
MiddleName = "Middle " + i.ToString(),
170+
LastName = "Last " + i.ToString(),
161171
});
162172
}
163173
}
@@ -188,6 +198,10 @@ The Popup editing mode supports [validation]({%slug common-features/input-valida
188198

189199
The Grid exposes options to customize the edit popup and its form. Define the desired configuration in the `GridPopupEditSettings` and `GridPopupEditFormSettings` tags under the `GridSettings` tag.
190200

201+
### Editability of Hidden Columns
202+
203+
Starting with version 7.0, the Grid allows users to edit [hidden columns]({%slug grid-columns-visible%}) by default. To disable editing of a hidden column, set `Editable="false"` to the respective `<GridColumn>` tag.
204+
191205
### Popup Customization
192206

193207
The `GridPopupEditSettings` nested tag exposes the following parameters to allow popup customization:

components/treelist/editing/popup.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Editing is cancelled for the first record.
6565
<TreeListColumn Field="Name" Expandable="true" Width="320px" />
6666
<TreeListColumn Field="Id" Editable="false" Width="120px" />
6767
<TreeListColumn Field="EmailAddress" Width="220px" />
68-
<TreeListColumn Field="HireDate" Width="220px" />
68+
<TreeListColumn Field="HireDate" Width="220px" Visible="false" />
6969
</TreeListColumns>
7070
</TelerikTreeList>
7171
@@ -319,6 +319,10 @@ Editing is cancelled for the first record.
319319

320320
The TreeList exposes options to customize the edit popup and its form. You can define your desired configuration in the `TreeListPopupEditSettings` and `TreeListPopupEditFormSettings` tags under the `TreeListSettings` tag.
321321

322+
### Editability of Hidden Columns
323+
324+
Staring from version 7.0, the TreeList allows users to edit [hidden columns]({%slug treelist-columns-visible%}) by default. To disable editing of a hidden column, set `Editable="false"` to the respective `<TreeListColumn>` tag.
325+
322326
### Popup Customization
323327

324328
The `TreeListPopupEditSettings` nested tag exposes the following parameters to allow popup customization:

0 commit comments

Comments
 (0)