Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kb(treelist): update long text sample and fix typo #2085

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions knowledge-base/treelist-longer-text-starts-from-root-level.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ To align all lines of text to the same level do the following:
height: 50px;
}

.MyTreeList .defaultHeight .k-icon.k-i-none {
float: left;
height: 100%;
}
.MyTreeList .defaultHeight .k-icon {
float: left;
height: 100%;
}
</style>

<TelerikTreeList Data="@Data"
Expand All @@ -60,15 +60,25 @@ To align all lines of text to the same level do the following:
Pageable="true"
Class="MyTreeList">
<TreeListColumns>
<TreeListColumn OnCellRender="@( (TreeListCellRenderEventArgs e) => e.Class="defaultHeight" )"
<TreeListColumn OnCellRender="@OnCellRenderHandler"
Field="FirstName" Expandable="true">
</TreeListColumn>
<TreeListColumn Field="EmployeeId"></TreeListColumn>
</TreeListColumns>
</TelerikTreeList>

@code {
public List<Employee> Data { get; set; }
private List<Employee> Data { get; set; }

private void OnCellRenderHandler(TreeListCellRenderEventArgs args)
{
var item = args.Item as Employee;

if (item.ReportsTo != null)
{
args.Class = "defaultHeight";
}
}

public class Employee
{
Expand All @@ -86,11 +96,11 @@ To align all lines of text to the same level do the following:
for (int i = 1; i < 3; i++)
{
Data.Add(new Employee()
{
EmployeeId = currentId,
ReportsTo = null,
FirstName = "Employee " + i.ToString()
});
{
EmployeeId = currentId,
ReportsTo = null,
FirstName = "Employee " + i.ToString()
});

currentId++;
}
Expand All @@ -99,11 +109,11 @@ To align all lines of text to the same level do the following:
for (int j = 0; j < 2; j++)
{
Data.Add(new Employee()
{
EmployeeId = currentId,
ReportsTo = i,
FirstName = "Employee " + j.ToString() + " : Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "
});
{
EmployeeId = currentId,
ReportsTo = i,
FirstName = "Employee " + j.ToString() + " : Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "
});
currentId++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion knowledge-base/treeview-dropdown-not-open.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Wrap the TreeView `<ItemTemplate>` content inside a `<div @onclick:stopPropagati
}
@item.Text
<div @onclick:stopPropagation>
<TelerikTextBox PlaceHolder="Type..." Width="140px" />
<TelerikTextBox Placeholder="Type..." Width="140px" />
</div>
</ItemTemplate>
</TreeViewBinding>
Expand Down
Loading