silverlight - How to control visibility of DataGridTextColumn -


i named 2 columns this

<data:datagridtextcolumn width="60*" header="status"   binding="{binding f_status}" x:name="f_status" />  <data:datagridtextcolumn width="30*" header="level"   binding="{binding f_level}" x:name="f_level" /> 

and want show these 2 columns dynamically...

when coding in cs file this

if ("1".equals(board_folder_type)) {   f_status.visibility = visibility.visible;   f_level.visibility = visibility.visible; } else {   f_status.visibility = visibility.collapsed;   f_level.visibility = visibility.collapsed; } 

it gives me nullreferenceexception...

please me :(

ps. forgive me english bad...

you should this,

datagrid.columns[yourcolumnindex].visibility = visibility.visible; 

if column "f_status" first column of datagrid, way,

if ("1".equals(board_folder_type)) {   datagrid.columns[0].visibility.visibility = visibility.visible;  } 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -