- @if (products != null && columns != null)
+ @if (products != null)
{
+ class="grid-lite-sample">
+
+
+
+
+
+
}
@@ -28,55 +33,11 @@
@code {
private List
products;
- private List columns;
private List eventLogs = new List();
protected override void OnInitialized()
{
products = MockDataGenerator.CreateProducts(50);
-
- columns = new List
- {
- new IgbColumnConfiguration
- {
- Key = nameof(ProductInfo.Name),
- HeaderText = "Product Name",
- Type = GridLiteColumnDataType.String,
- Sort = true
- },
- new IgbColumnConfiguration
- {
- Key = nameof(ProductInfo.Price),
- HeaderText = "Price",
- Type = GridLiteColumnDataType.Number,
- Width = "150px",
- Sort = true
- },
- new IgbColumnConfiguration
- {
- Key = nameof(ProductInfo.Sold),
- HeaderText = "Units sold",
- Type = GridLiteColumnDataType.Number,
- Width = "150px",
- Sort = true
- },
- new IgbColumnConfiguration
- {
- Key = nameof(ProductInfo.Total),
- HeaderText = "Total sold",
- Type = GridLiteColumnDataType.Number,
- Width = "150px",
- Sort = true
- },
- new IgbColumnConfiguration
- {
- Key = nameof(ProductInfo.Rating),
- HeaderText = "Customer rating",
- Type = GridLiteColumnDataType.Number,
- Width = "180px",
- Sort = true
- }
- };
}
private void HandleSorting(IgbGridLiteSortingEventArgs e)
diff --git a/samples/grids/grid-lite/sort-config-events/BlazorClientApp.csproj b/samples/grids/grid-lite/sort-config-events/BlazorClientApp.csproj
index 527fc7b36..fc1bfa2f7 100644
--- a/samples/grids/grid-lite/sort-config-events/BlazorClientApp.csproj
+++ b/samples/grids/grid-lite/sort-config-events/BlazorClientApp.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/samples/grids/grid-lite/sort-config-grid/App.razor b/samples/grids/grid-lite/sort-config-grid/App.razor
index 2e04a2472..41196625a 100644
--- a/samples/grids/grid-lite/sort-config-grid/App.razor
+++ b/samples/grids/grid-lite/sort-config-grid/App.razor
@@ -8,92 +8,43 @@
Enable multi-sort
- Enable tri-state sorting
-
- @if (products != null && columns != null)
+ @if (products != null)
{
-
+
+
+
+
+
+
+
}
@code {
private List
products;
- private List columns;
- private IgbGridLiteSortConfiguration sortConfig;
+ private IgbGridLite grid;
+ private IgbGridLiteSortingOptions sortingOptions;
protected override void OnInitialized()
{
products = MockDataGenerator.CreateProducts(50);
// Grid-level sort configuration
- sortConfig = new IgbGridLiteSortConfiguration
+ sortingOptions = new IgbGridLiteSortingOptions
{
- Multiple = true, // Enable multi-column sorting
- TriState = true // Enable tri-state sorting (asc -> desc -> none)
+ Mode = GridLiteSortingMode.Multiple // Enable multi-column sorting
};
-
- columns = new List
-{
-new IgbColumnConfiguration
-{
-Key = nameof(ProductInfo.Name),
-HeaderText = "Product Name",
-Type = GridLiteColumnDataType.String,
-Sort = true
-},
-new IgbColumnConfiguration
-{
-Key = nameof(ProductInfo.Price),
-HeaderText = "Price",
-Type = GridLiteColumnDataType.Number,
-Width = "150px",
-Sort = true
-},
-new IgbColumnConfiguration
-{
-Key = nameof(ProductInfo.Sold),
-HeaderText = "Units sold",
-Type = GridLiteColumnDataType.Number,
-Width = "150px",
-Sort = true
-},
-new IgbColumnConfiguration
-{
-Key = nameof(ProductInfo.Total),
-HeaderText = "Total sold",
-Type = GridLiteColumnDataType.Number,
-Width = "150px",
-Sort = true
-},
-new IgbColumnConfiguration
-{
-Key = nameof(ProductInfo.Rating),
-HeaderText = "Customer rating",
-Type = GridLiteColumnDataType.Number,
-Width = "180px",
-Sort = true
-}
-};
}
private void MultiSortChanged(IgbCheckboxChangeEventArgs e)
{
- sortConfig = new IgbGridLiteSortConfiguration
- {
- Multiple = e.Detail.Checked,
- TriState = sortConfig.TriState
- };
- }
-
- private void TriStateChanged(IgbCheckboxChangeEventArgs e)
- {
- sortConfig = new IgbGridLiteSortConfiguration
+ sortingOptions = new IgbGridLiteSortingOptions
{
- Multiple = sortConfig.Multiple,
- TriState = e.Detail.Checked
+ Mode = e.Detail.Checked ? GridLiteSortingMode.Multiple : GridLiteSortingMode.Single
};
+ grid?.ClearSortAsync(); // Clear existing sorting when changing mode
}
}
\ No newline at end of file
diff --git a/samples/grids/grid-lite/sort-config-grid/BlazorClientApp.csproj b/samples/grids/grid-lite/sort-config-grid/BlazorClientApp.csproj
index d3edb0811..1ceadb436 100644
--- a/samples/grids/grid-lite/sort-config-grid/BlazorClientApp.csproj
+++ b/samples/grids/grid-lite/sort-config-grid/BlazorClientApp.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/samples/grids/grid-lite/sort-config-sample/App.razor b/samples/grids/grid-lite/sort-config-sample/App.razor
index a419adeeb..1ac0af181 100644
--- a/samples/grids/grid-lite/sort-config-sample/App.razor
+++ b/samples/grids/grid-lite/sort-config-sample/App.razor
@@ -5,65 +5,26 @@
- @if (products != null && columns != null)
+ @if (products != null)
{
+ Data="@products"
+ class="grid-lite-sample">
+
+
+
+
+
+
}
@code {
private List products;
- private List columns;
protected override void OnInitialized()
{
// Generate 50 products
products = MockDataGenerator.CreateProducts(50);
-
- columns = new List
- {
- new IgbColumnConfiguration
- {
- Key = nameof(ProductInfo.Name),
- HeaderText = "Product Name",
- Type = GridLiteColumnDataType.String,
- Sort = true
- },
- new IgbColumnConfiguration
- {
- Key = nameof(ProductInfo.Price),
- HeaderText = "Price",
- Type = GridLiteColumnDataType.Number,
- Width = "150px",
- Sort = true
- },
- new IgbColumnConfiguration
- {
- Key = nameof(ProductInfo.Sold),
- HeaderText = "Units sold",
- Type = GridLiteColumnDataType.Number,
- Width = "150px",
- Sort = true
- },
- new IgbColumnConfiguration
- {
- Key = nameof(ProductInfo.Total),
- HeaderText = "Total sold",
- Type = GridLiteColumnDataType.Number,
- Width = "150px",
- Sort = true
- },
- new IgbColumnConfiguration
- {
- Key = nameof(ProductInfo.Rating),
- HeaderText = "Customer rating",
- Type = GridLiteColumnDataType.Number,
- Width = "180px",
- Sort = true
- }
- };
}
}
diff --git a/samples/grids/grid-lite/sort-config-sample/BlazorClientApp.csproj b/samples/grids/grid-lite/sort-config-sample/BlazorClientApp.csproj
index 527fc7b36..fc1bfa2f7 100644
--- a/samples/grids/grid-lite/sort-config-sample/BlazorClientApp.csproj
+++ b/samples/grids/grid-lite/sort-config-sample/BlazorClientApp.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/samples/grids/grid-lite/styling-config-themes/App.razor b/samples/grids/grid-lite/styling-config-themes/App.razor
index 56229bac3..8ac278e2e 100644
--- a/samples/grids/grid-lite/styling-config-themes/App.razor
+++ b/samples/grids/grid-lite/styling-config-themes/App.razor
@@ -21,66 +21,27 @@
- @if (products != null && columns != null)
+ @if (products != null)
{