DataGrid control question

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
 
W

William Ryan eMVP

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.
 
G

Guest

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
 
W

William Ryan eMVP

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top