DataGrid control question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all

Does anybody know how to set a cell as read only in DataGrid control. My situation is the cell editable/read only decided by another column's value on the same row. Thanks inadvance

Christina
 
You can set the datacolumn that it's bound to to read-only or you can apply
a DataGridTableStyle From there, youi'll need to apply a
DataGridColumnStyle. It provides a Read-Only property
http://www.knowdotnet.com/articles/cgrid.html

HTH,

Bill
www.devbuzz.com
www.knowdotnet.com
Christina said:
Dear all,

Does anybody know how to set a cell as read only in DataGrid control. My
situation is the cell editable/read only decided by another column's value
on the same row. Thanks inadvance.
 
Ryan

Thanks for your response. By using DataGridColumnStyle I can set up the whole column as read-only. How can I set up only one cell in the column as read only, and other cells in this column are still editable? Could you please attach a short sample code to me. Thank you very much for your help

Christin

----- William Ryan eMVP wrote: ----

You can set the datacolumn that it's bound to to read-only or you can appl
a DataGridTableStyle From there, youi'll need to apply
DataGridColumnStyle. It provides a Read-Only propert
http://www.knowdotnet.com/articles/cgrid.htm

HTH

Bil
www.devbuzz.co
www.knowdotnet.co
Christina said:
situation is the cell editable/read only decided by another column's valu
on the same row. Thanks inadvance
 
It doesn't work for individual cells. You're going to have to trap
currentcellchanged or some other event and undo whatever tehy change b/c i
don't believe there's a property that you can set.
Christina said:
Ryan,

Thanks for your response. By using DataGridColumnStyle I can set up the
whole column as read-only. How can I set up only one cell in the column as
read only, and other cells in this column are still editable? Could you
please attach a short sample code to me. Thank you very much for your help.
 
Back
Top