如何获取 SfDataGrid 控件中 CellLongPress 事件的 e.RowColumnIndex 值?

问题描述 投票:0回答:1
c# xaml maui syncfusion sfdatagrid
1个回答
0
投票

根据文档

RowColumnIndex
类的
DataGridCellLongPressEventArgs
属性属于同名的
RowColumnIndex
类,它包含两个整数字段:
RowIndex
ColumnIndex
,每个类型都是
System.Int32
(或
int
)。

因此,您不能将

RowColumnIndex
与整数进行比较,而只能将其成员与其他整数进行比较,例如:

private void PasswdVw_CellLongPress(object sender, DataGridCellLongPressEventArgs e)
{
    if(e.RowColumnIndex.ColumnIndex != 3)
    {
       return;
    }
    
    // continue with code here.
}
© www.soinside.com 2019 - 2024. All rights reserved.