DevExpress GridView için yardımcı metodlar
License
—
Deps
0
Install Size
—
Vulns
✓ 0
Published
May 23, 2025
$ dotnet add package DX.GridHelpers📦 Reusable utility library for DevExpress WinForms XtraGrid (GridView). Includes debounce-enabled row change handling (GridDebouncer<T>) and helpful extensions to simplify selection, scrolling, styling, and focused row access.
Compatible with .NET 8.0 WinForms and DevExpress 24.x
GridDebouncer<T>: Debounce logic for FocusedRowChanged with optional loading indicatordotnet add package DX.GridHelpers
Your project must target
net8.0-windowswith<UseWindowsForms>true</UseWindowsForms>enabled in.csproj.
var debouncer = new GridDebouncer<MyRow>(
gvwMain,
raw => raw as MyRow,
async row =>
{
// Executed after debounce delay
Console.WriteLine($"Focused row changed: {row.Id}");
await Task.CompletedTask;
},
delayMs: 300,
loadingControl: lblLoadingIndicator
);
debouncer.Dispose(); // When closing the form
gvw.SelectRowByValue("Id", 10); // Selects row with Id = 10
int? year = gvw.GetFocusedCellValue<int>("Year"); // Reads cell from focused row
var row = gvw.GetFocusedRow<MyRow>(); // Safely casts focused row
gvw.ScrollToFocusedRow(); // Scroll to focused row
gvw.RefreshCurrentRow(); // Redraw current row
gvw.ClearSelectionSafe(); // Clears selection
gvw.FocusFirstRow(); // Focus top
gvw.FocusLastRow(); // Focus bottom
gvw.SetRowStyleConditionally(
row => (row as MyRow)?.IsPassive == true,
Color.DarkGray,
Color.LightYellow
);
MIT License
This project is independent and not affiliated with Developer Express Inc.
DevExpress,XtraGrid, and all trademarks are property of Developer Express Inc.