From d5dacc11505e326783331bdf9b134163e51baeb8 Mon Sep 17 00:00:00 2001 From: firozmangroe <107689467+firozmangroe@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:44:37 +0200 Subject: [PATCH 1/2] Update grid-rows-text-ellipsis.md In case you need to render all cells and do not want to do it column by column --- knowledge-base/grid-rows-text-ellipsis.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/knowledge-base/grid-rows-text-ellipsis.md b/knowledge-base/grid-rows-text-ellipsis.md index 68b330a746..c036b9f652 100644 --- a/knowledge-base/grid-rows-text-ellipsis.md +++ b/knowledge-base/grid-rows-text-ellipsis.md @@ -43,7 +43,8 @@ Resize Note column or double click on a row to see the product details Pageable="true" Sortable="true" Groupable="true" FilterMode="Telerik.Blazor.GridFilterMode.FilterRow" Resizable="true" Reorderable="true" - OnRowDoubleClick="@OnRowDoubleClickHandler"> + OnRowDoubleClick="@OnRowDoubleClickHandler" + OnRowRender="@OnRowRender"> @@ -70,6 +71,12 @@ Resize Note column or double click on a row to see the product details text-overflow: ellipsis; white-space: nowrap; } + /* OnRowRender */ + .custom-ellipsis .k-table-td { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } @@ -98,6 +105,12 @@ Resize Note column or double click on a row to see the product details WindowIsVisible = !WindowIsVisible; } + // If you need to render all cells with ellipsis + private void OnRowRender(GridRowRenderEventArgs args) + { + args.Class = "custom-ellipsis"; + } + void OnCellRenderHandler(GridCellRenderEventArgs args) { args.Class = "custom-ellipsis"; From 79479e1fd77cf6dcb8d02eb00861c6e3593418b8 Mon Sep 17 00:00:00 2001 From: Dimo Dimov <961014+dimodi@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:29:16 +0300 Subject: [PATCH 2/2] docs(grid): Apply custom column and row styles to separate Grid instances --- knowledge-base/grid-rows-text-ellipsis.md | 62 ++++++++++++++--------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/knowledge-base/grid-rows-text-ellipsis.md b/knowledge-base/grid-rows-text-ellipsis.md index c036b9f652..e9623e20e4 100644 --- a/knowledge-base/grid-rows-text-ellipsis.md +++ b/knowledge-base/grid-rows-text-ellipsis.md @@ -35,16 +35,16 @@ You might still want to allow the user to see the whole content, so you can enab ````CSHTML -@*Use the OnCellRender event to pass a custom CSS class to the Grid column and prevent it from wrapping the text in multiple lines for the Notes column. Display the full content of the column in a separate Window component.*@ - -Resize Note column or double click on a row to see the product details - - +Ellipsis for the Notes column via OnCellRender. + + OnRowDoubleClick="@OnRowDoubleClickHandler"> @@ -62,17 +62,30 @@ Resize Note column or double click on a row to see the product details +Ellipsis for all columns via OnRowRender. + + + + + + + + + + + +