c# - DataGridTextboxcolumn readonly based on condition -


i using c# compact framework. vs 2005. binding datatable datagrid. have placed datagridtextboxcoulumn 1 column of datagrid. need make column readonly based on value in other column.

for eg. if cid column value 2, need make datagridtextboxcoulumn read true. if cid column value 4, need make datagridtextboxcoulumn read false. needs done on binding data datagrid.

is there event in can have property datagridtextboxcoulumn.readonly

in event can based on condition

thanks

you can use rowdatabound event of grid,

 protected void grid_rowdatabound(object sender, gridviewroweventargs e)         {             textbox textbox = e.row.findcontrol("textboxid") textbox;              if(<<your condition>>)             {                 textbox.enabled = false;             }         } 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -