简体   繁体   English

我想从gridview“ ReadOnly”中整行

[英]I want to make a entire row from a gridview “ReadOnly”

I am using a Gridview and so far everything is working great! 我正在使用Gridview,到目前为止,一切都很好! My question is how do I make the current row as a read only if a specific condition become false? 我的问题是,如果特定条件为假,如何将当前行设为只读? I have tested and tried a few examples but with no luck. 我已经测试并尝试了一些示例,但是没有运气。 I found a way to make the column read only but im unable to make the entire row read only. 我找到了一种方法使该列为只读,但是即时通讯无法使整个行变为只读。 Thanks in advance, Irfan 在此先感谢Irfan

Use event ShowingEditor . 使用事件ShowingEditor

private void  myGridView_ShowingEditor(object sender, System.ComponentModel.CancelEventArgs e) {
    var gv = sender as GridView; 
    if (/* your condition to determine if the row is readokly */ ) {
        e.Cancel = true;
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使整个GridView变为ReadOnly? - How to make entire GridView to ReadOnly? 我想使我的Gridview行垂直(就像一排又一排的细节) - I want to Make my Gridview row vertical (like one row details after another) 我想将行值从gridview获取到另一个gridview并将其用于计算 - I want to get the row value from the gridview into another gridview and use it for calculation 如何在GridView中将文本框设为只读? - How to make textbox readonly in a gridview? 如何使整个Gridview行可单击并打开新链接? - How to make entire Gridview Row clickable and open a new link? 我怎样才能通过代码从 GridView(没有数据源)中创建一个只读列? (asp.net C#) - How can i make a column from GridView(without datasource) readOnly through code? (asp.net C#) 我想在behnd代码中将datagrid设为只读,但看不到该选项 - I want to make datagrid readonly in behnd code, but do not see the option 将GridView的第一行或特定行设置为只读 - Set GridView first or specific row to be readonly 调用UserDeletingRow事件后,行会从gridview中消失,如果我想删除它,则会回答NO - Row disappears from gridview after calling the UserDeletingRow event and answering NO if I want to delete it 在gridview中使整行可单击 - Making an entire row clickable in a gridview
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM