C# GridView FocusedRowChanged-子类对象
我需要一些帮助 我从DevExpress EditorRow创建了一个名为MyEditorRow的子类,并添加了3个属性C# GridView FocusedRowChanged-子类对象,c#,events,gridview,devexpress,C#,Events,Gridview,Devexpress,我需要一些帮助 我从DevExpress EditorRow创建了一个名为MyEditorRow的子类,并添加了3个属性 public class myEditorRow : EditorRow { public myEditorRow() { } private string inRowDescription = null; public string RowDescription {
public class myEditorRow : EditorRow
{
public myEditorRow()
{
}
private string inRowDescription = null;
public string RowDescription
{
get { return inRowDescription; }
set { inRowDescription = value; }
}
private bool inRequired = false;
public bool Required
{
get { return inRequired; }
set { inRequired = value; }
}
private bool inInherits = false;
public bool Inherits
{
get { return inInherits; }
set { inInherits = value; }
}
程序中的第二部分代码将MyEditorRow实例添加到DevExpress VGrid控件中
vgcGrid.Rows.Add(Row);
我的问题是:如何将MyEditorRow类与DevExpress VGrid控件FocusedRowChanged事件链接,以便在行焦点更改时获得自定义属性
谢谢e.Row参数是BaseRow类型。因此,要在FocusnedRowChanged事件处理程序中获取MyEditorRow对象的实例,请使用以下代码:
private void vGridControl1_FocusedRowChanged(object sender, DevExpress.XtraVerticalGrid.Events.FocusedRowChangedEventArgs e) {
if(e.Row is myEditorRow) {
myEditorRow row = ((myEditorRow)e.Row);
// your code here
}
}