diff --git a/blazor/datagrid/cell.md b/blazor/datagrid/cell.md
index fb2dae4d68..fbff0401e9 100644
--- a/blazor/datagrid/cell.md
+++ b/blazor/datagrid/cell.md
@@ -766,10 +766,7 @@ The Syncfusion Blazor DataGrid allows you to display information about the Grid
### Show tooltip
-The Syncfusion Blazor DataGrid provides a built-in feature to display tooltips when hovering over header and content cells. You can enable this feature by setting the `ShowTooltip` property to **true** in the DataGrid.
-By default, it shows the cell value for both header and content cells. For special types like templates, it displays the row data of the corresponding cells.
-
-The following example demonstrates, how to set the `ShowTooltip` property in the DataGrid.
+The Syncfusion Blazor DataGrid provides a built-in feature to display tooltips when hovering over header and content cells. You can enable this feature by setting the `ShowTooltip` property to **true** in the DataGrid. By default, it shows the cell value for both header and content cells. For special types like templates, it displays the row data of the corresponding cells.
{% tabs %}
{% highlight razor tabtitle="Index.razor" %}
@@ -778,77 +775,70 @@ The following example demonstrates, how to set the `ShowTooltip` property in the
-
+
-
-
+
+
@code {
- private SfGrid Grid;
public List Orders { get; set; }
-
+
protected override void OnInitialized()
{
Orders = OrderData.GetAllRecords();
- }
+ }
}
{% endhighlight %}
-{% highlight c# tabtitle="Order.cs" %}
+{% highlight c# tabtitle="OrderData.cs" %}
public class OrderData
+{
+ public static List Orders = new List();
+ public OrderData()
{
- public static List Orders = new List();
- public OrderData()
- {
- }
- public OrderData( int? OrderID, string CustomerID, DateTime? OrderDate, double? Freight)
- {
- this.OrderID = OrderID;
- this.CustomerID = CustomerID;
- this.OrderDate = OrderDate;
- this.Freight = Freight;
- }
- public static List GetAllRecords()
+ }
+ public OrderData( int? OrderID, string CustomerID, DateTime? OrderDate, double? Freight)
+ {
+ this.OrderID = OrderID;
+ this.CustomerID = CustomerID;
+ this.OrderDate = OrderDate;
+ this.Freight = Freight;
+ }
+ public static List GetAllRecords()
+ {
+ if (Orders.Count() == 0)
{
- if (Orders.Count() == 0)
- {
- int code = 10;
- for (int i = 1; i < 2; i++)
- {
- Orders.Add(new OrderData(10248, "VINET",new DateTime(1996,07,07), 32.38));
- Orders.Add(new OrderData(10249, "TOMSP", new DateTime(1996, 07, 07), 92.38));
- Orders.Add(new OrderData(10250, "HANAR", new DateTime(1996, 07, 07), 62.77));
- Orders.Add(new OrderData(10251, "VICTE", new DateTime(1996, 07, 07), 12.38));
- Orders.Add(new OrderData(10252, "SUPRD", new DateTime(1996, 07, 07), 82.38));
- Orders.Add(new OrderData(10253, "CHOPS", new DateTime(1996, 07, 07), 31.31));
- Orders.Add(new OrderData(10254, "RICSU", new DateTime(1996, 07, 07), 22.37));
- Orders.Add(new OrderData(10255, "WELLI", new DateTime(1996, 07, 07), 44.34));
- Orders.Add(new OrderData(10256, "RICSU", new DateTime(1996, 07, 07), 31.33));
- code += 5;
- }
- }
- return Orders;
+ Orders.Add(new OrderData(10248, "VINET", new DateTime(2025, 07, 07), 32.38));
+ Orders.Add(new OrderData(10249, "TOMSP", new DateTime(2025, 07, 07), 92.38));
+ Orders.Add(new OrderData(10250, "HANAR", new DateTime(2025, 07, 07), 62.77));
+ Orders.Add(new OrderData(10251, "VICTE", new DateTime(2025, 07, 07), 12.38));
+ Orders.Add(new OrderData(10252, "SUPRD", new DateTime(2025, 07, 07), 82.38));
+ Orders.Add(new OrderData(10253, "CHOPS", new DateTime(2025, 07, 07), 31.31));
+ Orders.Add(new OrderData(10254, "RICSU", new DateTime(2025, 07, 07), 22.37));
+ Orders.Add(new OrderData(10255, "WELLI", new DateTime(2025, 07, 07), 44.34));
+ Orders.Add(new OrderData(10256, "RICSU", new DateTime(2025, 07, 07), 31.33));
}
- public int? OrderID { get; set; }
- public string CustomerID { get; set; }
- public DateTime? OrderDate { get; set; }
- public double? Freight { get; set; }
+ return Orders;
}
+ public int? OrderID { get; set; }
+ public string CustomerID { get; set; }
+ public DateTime? OrderDate { get; set; }
+ public double? Freight { get; set; }
+}
{% endhighlight %}
{% endtabs %}
-{% previewsample "https://blazorplayground.syncfusion.com/embed/htrSjFVnKuSghwyK?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %}
+{% previewsample "https://blazorplayground.syncfusion.com/embed/LXBSNYMiAEMphkRe?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %}
### Tooltip template
-The Syncfusion Blazor DataGrid component provides a built-in option to customize tooltip content for both header and content cells. This can be achieved using the `TooltipTemplate` property, which accepts a `RenderFragment` under the `GridTemplates` component.
+The Syncfusion Blazor DataGrid component provides a built-in option to customize tooltip content for both header and content cells. This can be achieved using the `TooltipTemplate` property, which accepts a `RenderFragment` under the `GridTemplates` component. This feature allows you to display additional information about columns when users hover over them, enhancing the clarity and usability of the DataGrid.
-This feature allows you to display additional information about columns when users hover over them, enhancing the clarity and usability of the DataGrid.
Tooltip customization is supported through the `TooltipTemplateContext`, which provides access to the following built-in properties:
Value – Displays the content of the hovered cell: the column name for header cells or the cell value for content cells.
@@ -865,19 +855,18 @@ The following sample demonstrates a custom tooltip implementation using the `Too
@using Syncfusion.Blazor.Grids
-
+
@{
var tooltip = context as TooltipTemplateContext;
- var order = tooltip?.RowData as OrdersDetails;
+ var order = tooltip?.Data as OrdersDetails;
if (tooltip?.RowIndex == -1)
{
if (tooltip.Value == "Order ID")
{
@tooltip.Value: Unique number used to identify each customer order.
}
-
else if (tooltip.Value == "Customer ID")
{
@@ -893,7 +882,6 @@ The following sample demonstrates a custom tooltip implementation using the `Too
@tooltip.Value: Name of the city where the order is delivered.
}
}
-
else
{
var fieldName = tooltip?.Column?.Field;
@@ -903,27 +891,23 @@ The following sample demonstrates a custom tooltip implementation using the `Too
case nameof(order.OrderID):