-
Notifications
You must be signed in to change notification settings - Fork 78
kb(Gantt): add Gantt TreeList width persistance kb #3061
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
base: master
Are you sure you want to change the base?
Conversation
Hello @IvanDanchev, Check the below option if you would like to automatically generate PR to production. The automation uses the branch for the cherry-pick, and then will delete the branch. Please, do not delete it manually.
|
type: how-to | ||
page_title: How to Display Model Fields in the Gantt Tooltip? | ||
slug: gantt-kb-persist-treelist-width-after-refresh | ||
tags: gantt, blazor, treelist, width, persist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tag names should make sense when taken outside context. These are not keywords used for SEO. Good candidates are component names and feature names.
tags: gantt, blazor, treelist, width, persist | |
tags: gantt, blazor, treelist, width |
</script> | ||
|
||
@code { | ||
private TelerikGantt<FlatModel> GanttRef; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good practice to create code snippets that do not trigger compile warnings
private TelerikGantt<FlatModel> GanttRef; | |
private TelerikGantt<FlatModel>? GanttRef { get; set; } |
var currentListWidth = await JS.InvokeAsync<string>("getListSize"); | ||
ListWidth = currentListWidth; | ||
|
||
GanttRef.Rebind(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GanttRef.Rebind(); | |
GanttRef?.Rebind(); |
var currentListWidth = await JS.InvokeAsync<string>("getListSize"); | ||
ListWidth = currentListWidth; | ||
|
||
GanttRef.Rebind(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GanttRef.Rebind(); | |
GanttRef?.Rebind(); |
protected override void OnInitialized() | ||
{ | ||
GanttData = new List<FlatModel>(); | ||
var random = new Random(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Random.Shared instead for thread safety.
GanttRef.Rebind(); | ||
} | ||
|
||
class FlatModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Model classes and data generation should come after the more relevant business logic, methods and events. See the Docs & Demos Code Style Guide in the blazor repo wiki.
Note to external contributors: make sure to sign our Contribution License Agreement (CLA) for Blazor UI first:
https://forms.office.com/Pages/ResponsePage.aspx?id=Z2om2-DLJk2uGtBYH-A1NbWxVqugKN5DvVp8I-1AgOBURFBVSkwyMlA1TkFDVFdMNU1aM1o1UlZQOC4u