diff --git a/GridBlazor/CGrid.cs b/GridBlazor/CGrid.cs index 83b08752..34197124 100644 --- a/GridBlazor/CGrid.cs +++ b/GridBlazor/CGrid.cs @@ -829,6 +829,26 @@ public virtual void AutoGenerateColumns() /// public string DeleteLabel { get; set; } + /// + /// Create button tooltip + /// + public string CreateTooltip { get; set; } = Strings.CreateItem; + + /// + /// Read button tooltip + /// + public string ReadTooltip { get; set; } = Strings.ReadItem; + + /// + /// Update button tooltip + /// + public string UpdateTooltip { get; set; } = Strings.UpdateItem; + + /// + /// Delete button tooltip + /// + public string DeleteTooltip { get; set; } = Strings.DeleteItem; + /// /// Create form label /// diff --git a/GridBlazor/Client/GridClient.cs b/GridBlazor/Client/GridClient.cs index ed1faaab..4748c618 100644 --- a/GridBlazor/Client/GridClient.cs +++ b/GridBlazor/Client/GridClient.cs @@ -393,6 +393,20 @@ public IGridClient SetCrudButtonLabels(string createLabel, string readLabel, return this; } + public IGridClient SetCrudButtonTooltips(string createTooltip, string readTooltip, string updateTooltip, + string deleteTooltip) + { + if(createTooltip != null) + _source.CreateTooltip = createTooltip; + if (readTooltip != null) + _source.ReadTooltip = readTooltip; + if (updateTooltip != null) + _source.UpdateTooltip = updateTooltip; + if (deleteTooltip != null) + _source.DeleteTooltip = deleteTooltip; + return this; + } + public IGridClient SetCrudFormLabels(string createLabel, string readLabel, string updateLabel, string deleteLabel) { _source.CreateFormLabel = createLabel; diff --git a/GridBlazor/Client/IGridClient.cs b/GridBlazor/Client/IGridClient.cs index 7aef21d4..8588d341 100644 --- a/GridBlazor/Client/IGridClient.cs +++ b/GridBlazor/Client/IGridClient.cs @@ -215,6 +215,11 @@ IGridClient ODataCrud(bool createEnabled, Func readEnabled, /// IGridClient SetCrudButtonLabels(string createLabel, string readLabel, string updateLabel, string deleteLabel); + /// + /// Configure CRUD button tootips + /// + IGridClient SetCrudButtonTooltips(string createTooltip, string readTooltip, string updateTooltip, string deleteTooltip); + /// /// Configure CRUD button labels /// diff --git a/GridBlazor/ICGrid.cs b/GridBlazor/ICGrid.cs index 37d527e3..3bcc358d 100644 --- a/GridBlazor/ICGrid.cs +++ b/GridBlazor/ICGrid.cs @@ -301,6 +301,26 @@ public interface ICGrid : IGrid, IGridOptions /// string DeleteLabel { get; set; } + /// + /// Create button tooltip + /// + string CreateTooltip { get; set; } + + /// + /// Read button tooltip + /// + string ReadTooltip { get; set; } + + /// + /// Update button tooltip + /// + string UpdateTooltip { get; set; } + + /// + /// Delete button tooltip + /// + string DeleteTooltip { get; set; } + /// /// Create form label /// diff --git a/GridBlazor/Pages/GridComponent.razor b/GridBlazor/Pages/GridComponent.razor index 122625b5..a3a857c6 100644 --- a/GridBlazor/Pages/GridComponent.razor +++ b/GridBlazor/Pages/GridComponent.razor @@ -100,11 +100,11 @@
@if (string.IsNullOrWhiteSpace(Grid.CreateLabel)) { - + } else { - + }
} @@ -113,11 +113,11 @@
@if (string.IsNullOrWhiteSpace(Grid.ReadLabel)) { - + } else { - + }
} @@ -126,11 +126,11 @@
@if (string.IsNullOrWhiteSpace(Grid.UpdateLabel)) { - + } else { - + }
} @@ -139,11 +139,11 @@
@if (string.IsNullOrWhiteSpace(Grid.DeleteLabel)) { - + } else { - + }
} diff --git a/GridBlazor/Pages/GridRowComponent.razor b/GridBlazor/Pages/GridRowComponent.razor index ac10a621..78a026a7 100644 --- a/GridBlazor/Pages/GridRowComponent.razor +++ b/GridBlazor/Pages/GridRowComponent.razor @@ -26,11 +26,11 @@ { @if (string.IsNullOrWhiteSpace(Grid.ReadLabel)) { - + } else { - + } } @@ -42,11 +42,11 @@ { @if (string.IsNullOrWhiteSpace(Grid.UpdateLabel)) { - + } else { - + } } @@ -60,11 +60,11 @@ { @if (string.IsNullOrWhiteSpace(Grid.DeleteLabel)) { - + } else { - + } } } @@ -105,11 +105,11 @@ else { @if (string.IsNullOrWhiteSpace(Grid.ReadLabel)) { - + } else { - + } } @@ -123,11 +123,11 @@ else { @if (string.IsNullOrWhiteSpace(Grid.UpdateLabel)) { - + } else { - + } } } @@ -140,11 +140,11 @@ else { @if (string.IsNullOrWhiteSpace(Grid.DeleteLabel)) { - + } else { - + } } diff --git a/docs/blazor_client/Crud.md b/docs/blazor_client/Crud.md index 5c748c1e..fd8357af 100644 --- a/docs/blazor_client/Crud.md +++ b/docs/blazor_client/Crud.md @@ -469,6 +469,18 @@ You can also use text labels for the header buttons. In this the configuration i .SetCrudButtonLabels("Add", "View", "Edit", "Delete"); ``` +## CRUD button tooltips + +You can change the default CRUD button tooltips using the ```SetCrudButtonTooltips``` method of the ```GridClient``` object for this: +```c# + var client = new GridClient(HttpClient, url, query, false, "ordersGrid", ColumnCollections.OrderColumnsWithCustomCrud, locale) + .Crud(true, orderService) + .SetCrudButtonTooltips("Add Order", "View Order", "Edit Order", "Delete Order"); +``` + +If any of the passed values is null, then the tooltip text will be the default one. +If any of the passed values is empty (""), then there will not be a tooltipfor it. + ## Custom forms (Optional) If you want to use custom forms you can enable them using the **SetCreateComponent**, **SetReadComponent**, **SetUpdateComponent** and **SetDeleteComponent** methods of the **GridClient** object: diff --git a/docs/blazor_grpc/Crud.md b/docs/blazor_grpc/Crud.md index 1b8d117a..7ab644e4 100644 --- a/docs/blazor_grpc/Crud.md +++ b/docs/blazor_grpc/Crud.md @@ -505,6 +505,18 @@ You can also use text labels for the header buttons. In this the configuration i .SetCrudButtonLabels("Add", "View", "Edit", "Delete"); ``` +## CRUD button tooltips + +You can change the default CRUD button tooltips using the ```SetCrudButtonTooltips``` method of the ```GridClient``` object for this: +```c# + var client = new GridClient(gridClientService.OrderColumnsWithCrud, query, false, "ordersGrid", ColumnCollections.OrderColumnsWithCustomCrud, locale) + .Crud(true, orderService) + .SetCrudButtonTooltips("Add Order", "View Order", "Edit Order", "Delete Order"); +``` + +If any of the passed values is null, then the tooltip text will be the default one. +If any of the passed values is empty (""), then there will not be a tooltipfor it. + ## Custom forms (Optional) If you want to use custom forms you can enable them using the **SetCreateComponent**, **SetReadComponent**, **SetUpdateComponent** and **SetDeleteComponent** methods of the **GridClient** object: diff --git a/docs/blazor_local/Crud.md b/docs/blazor_local/Crud.md index 89edc553..e2afc0ae 100644 --- a/docs/blazor_local/Crud.md +++ b/docs/blazor_local/Crud.md @@ -362,6 +362,18 @@ You can also use text labels for the header buttons. In this the configuration i .SetCrudButtonLabels("Add", "View", "Edit", "Delete"); ``` +## CRUD button tooltips + +You can change the default CRUD button tooltips using the ```SetCrudButtonTooltips``` method of the ```GridClient``` object for this: +```c# + var client = new GridClient(gridClientService.OrderColumnsWithCrud, query, false, "ordersGrid", ColumnCollections.OrderColumnsWithCustomCrud, locale) + .Crud(true, orderService) + .SetCrudButtonTooltips("Add Order", "View Order", "Edit Order", "Delete Order"); +``` + +If any of the passed values is null, then the tooltip text will be the default one. +If any of the passed values is empty (""), then there will not be a tooltipfor it. + ## Custom forms (Optional) If you want to use custom forms you can enable them using the **SetCreateComponent**, **SetReadComponent**, **SetUpdateComponent** and **SetDeleteComponent** methods of the **GridClient** object: diff --git a/docs/blazor_odata/Crud.md b/docs/blazor_odata/Crud.md index 7b667b07..aac42773 100644 --- a/docs/blazor_odata/Crud.md +++ b/docs/blazor_odata/Crud.md @@ -405,6 +405,18 @@ You can also use text labels for the header buttons. In this the configuration i .SetCrudButtonLabels("Add", "View", "Edit", "Delete"); ``` +## CRUD button tooltips + +You can change the default CRUD button tooltips using the ```SetCrudButtonTooltips``` method of the ```GridClient``` object for this: +```c# + var client = new GridODataClient(HttpClient, url, query, false, "ordersGrid", columns, 10, locale) + .Crud(true, orderService) + .SetCrudButtonTooltips("Add Order", "View Order", "Edit Order", "Delete Order"); +``` + +If any of the passed values is null, then the tooltip text will be the default one. +If any of the passed values is empty (""), then there will not be a tooltipfor it. + ## Custom forms (Optional) If you want to use custom forms you can enable them using the **SetCreateComponent**, **SetReadComponent**, **SetUpdateComponent** and **SetDeleteComponent** methods of the **GridODataClient** object: diff --git a/docs/blazor_server/Crud.md b/docs/blazor_server/Crud.md index 291cb446..1b5ee28e 100644 --- a/docs/blazor_server/Crud.md +++ b/docs/blazor_server/Crud.md @@ -362,6 +362,18 @@ You can also use text labels for the header buttons. In this the configuration i .SetCrudButtonLabels("Add", "View", "Edit", "Delete"); ``` +## CRUD button tooltips + +You can change the default CRUD button tooltips using the ```SetCrudButtonTooltips``` method of the ```GridClient``` object for this: +```c# + var client = new GridClient(q => orderService.GetOrdersGridRows(columns, q), query, false, "ordersGrid", columns, locale) + .Crud(true, orderService) + .SetCrudButtonTooltips("Add Order", "View Order", "Edit Order", "Delete Order"); +``` + +If any of the passed values is null, then the tooltip text will be the default one. +If any of the passed values is empty (""), then there will not be a tooltipfor it. + ## Custom forms (Optional) If you want to use custom forms you can enable them using the **SetCreateComponent**, **SetReadComponent**, **SetUpdateComponent** and **SetDeleteComponent** methods of the **GridClient** object: diff --git a/docs/dotnetcore_blazor/Crud.md b/docs/dotnetcore_blazor/Crud.md index 45f030a2..915ce2ac 100644 --- a/docs/dotnetcore_blazor/Crud.md +++ b/docs/dotnetcore_blazor/Crud.md @@ -360,6 +360,18 @@ You can also use text labels for the header buttons. In this the configuration i .SetCrudButtonLabels("Add", "View", "Edit", "Delete"); ``` +## CRUD button tooltips + +You can change the default CRUD button tooltips using the ```SetCrudButtonTooltips``` method of the ```GridClient``` object for this: +```c# + var client = new GridClient(q => orderService.GetOrdersGridRows(columns, q), query, false, "ordersGrid", columns, locale) + .Crud(true, orderService) + .SetCrudButtonTooltips("Add Order", "View Order", "Edit Order", "Delete Order"); +``` + +If any of the passed values is null, then the tooltip text will be the default one. +If any of the passed values is empty (""), then there will not be a tooltipfor it. + ## Custom forms (Optional) If you want to use custom forms you can enable them using the **SetCreateComponent**, **SetReadComponent**, **SetUpdateComponent** and **SetDeleteComponent** methods of the **GridClient** object: