Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Model view controller 在asp.net mvc中隐藏编辑表单_Model View Controller_Gridview_Devexpress_Hide - Fatal编程技术网

Model view controller 在asp.net mvc中隐藏编辑表单

Model view controller 在asp.net mvc中隐藏编辑表单,model-view-controller,gridview,devexpress,hide,Model View Controller,Gridview,Devexpress,Hide,如果我的CustomerName字段名等于“MyCustomer”,我想隐藏对该行的编辑 如果客户名称==“MyCustomer,隐藏列编辑 如何根据“MyCustomer”隐藏列编辑 任何帮助都将以分数表示 settings.CommandButtonInitialize = (s, e) => { if (e.ButtonType == ColumnCommandButtonType.Edit) { MVCxGridView g = s as MVCxGridV

如果我的CustomerName字段名等于“MyCustomer”,我想隐藏对该行的编辑

如果客户名称==“MyCustomer隐藏编辑

如何根据“MyCustomer”隐藏列编辑

任何帮助都将以分数表示

settings.CommandButtonInitialize = (s, e) => {
    if (e.ButtonType == ColumnCommandButtonType.Edit) {
        MVCxGridView g = s as MVCxGridView;
        var value = (int)g.GetRowValues(e.VisibleIndex, "RowFieldName"); //use a correct field name and cast a resultant value to a correct value type
        e.Visible = value > 10; // for example, only
    }
};
幸运的是,我自己找到了解决办法。 这是有效的。希望这能帮助将来有同样问题的人

幸运的是,我自己找到了解决办法。 这是有效的。希望这能帮助将来有同样问题的人

settings.CommandButtonInitialize = (s, e) => {
    if (e.ButtonType == ColumnCommandButtonType.Edit) {
        MVCxGridView g = s as MVCxGridView;
        var value = (int)g.GetRowValues(e.VisibleIndex, "RowFieldName"); //use a correct field name and cast a resultant value to a correct value type
        e.Visible = value > 10; // for example, only
    }
};