By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,092 Members | 1,597 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,092 IT Pros & Developers. It's quick & easy.

I have a datagridview with a template field. How can i make that field as ReadOnly ?

P: 1
I have a datagridview with a template field. How can i make that field as ReadOnly when I load the grid in Web Forms.

" dataGridView1.Columns["CompanyName"].ReadOnly = true; " works only for Windows Forms DataGridView Control. So how can I do it in Web Forms.

Thanks in advance
Mar 15 '11 #1
Share this Question
Share on Google+
1 Reply


P: 14
If your TemplateField cantains an EditTemplate inside it then your field will be editable. If you remove the EditTemplate the field is not editable anymore. So when a user clicks on the "Edit" button (assuming that there is an edit button) he will not be able to alter the contents of the field. HTH
May 7 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.