Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > I want some rows read-only in datagridview Edit mode
 

I want some rows read-only in datagridview Edit mode

Even though I set dgv.BeginEdit() I still want to control whether some rows are read-only on an individual basis. How do I do this?

jal2  Saturday, April 26, 2008 5:15 PM
Try setting ReadOnly property on individual rows after calling BeginEdit()
Giorgi Dalakishvili  Saturday, April 26, 2008 5:23 PM

Okay, part of the problem (though I don't understand it) was that I was settting ReadOnly and then calling an AcceptChanges. When I moved the ReadOnly command to a spot after the AcceptChanges command, it started working, finally.

I have no idea why this made the difference.

jal2  Saturday, April 26, 2008 5:41 PM
Try setting ReadOnly property on individual rows after calling BeginEdit()
Giorgi Dalakishvili  Saturday, April 26, 2008 5:23 PM

Does that work for you? I had already tried that before making this post - that's the reason I made this post.

jal2  Saturday, April 26, 2008 5:34 PM

Okay, part of the problem (though I don't understand it) was that I was settting ReadOnly and then calling an AcceptChanges. When I moved the ReadOnly command to a spot after the AcceptChanges command, it started working, finally.

I have no idea why this made the difference.

jal2  Saturday, April 26, 2008 5:41 PM

You can use google to search for other answers

Custom Search

More Threads

• I need create a master - details with a combobox and a gridcontrol
• DataGridView -- setting column format to 'UpperCase'
• sort a datatable before bind a bindingsource for a datagridview
• Setting Datagridview Styles Dynamically
• dataSet.Tables["tableName"] cell value?
• Binding to Objects
• search Master/Detail example
• Table Adapter Issue
• how to set dataType of dataTable column as byte[]
• Inline controls in a DataGrid or ListView