DataGridView read only cells

前端 未结 9 467
余生分开走
余生分开走 2020-12-09 10:57

I have a binded DataGridView that contains a large amount of data. The problem is that some cells has to be ReadOnly and also when the user navigates with TAB or ENTER betwe

9条回答
  •  天命终不由人
    2020-12-09 11:44

    Could you not use a template column instead of a bound column then have a condition for the readonlyness of the field?

    Then you could present a label for readonly and a textbox for editable. Labels would not interfere with your tab index.

    
      
    <%
        if ( <%# Eval( "ReadOnlyFlag" ) %> )
        { 
    %>
        " />
    <%
        }
        else
        {
     %>
        " />
    <%
        }
    %>
        
    
    

提交回复
热议问题