2021-06-16 15:11:39 +02:00
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using DevExpress.Xpf.Grid;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
|
|
|
|
|
namespace BS.Shared.Extensions
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class GridControlExtensions
|
|
|
|
|
|
{
|
|
|
|
|
|
public static T GetCurrentValue<T>(this GridControl pGrid)
|
|
|
|
|
|
{
|
|
|
|
|
|
// var lView = pGrid.View;
|
|
|
|
|
|
|
|
|
|
|
|
// if (lView == null) return default(T);
|
|
|
|
|
|
|
|
|
|
|
|
// RowData lData = lView.FocusedRowData;
|
|
|
|
|
|
|
|
|
|
|
|
// if (lData == null || lData.RowHandle == null) return default(T);
|
|
|
|
|
|
object value = pGrid.GetFocusedRow();
|
|
|
|
|
|
if (value == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return default(T);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (T)value;
|
|
|
|
|
|
|
|
|
|
|
|
// return (T) pGrid.getr(lData.RowHandle.Value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|