Question XML into DataGridView read only

Joe1

Active member
Joined
Dec 4, 2012
Messages
37
Programming Experience
Beginner
Hello,

I have read an XML file into a datagridview. So these columns aren't in the 'edit columns' window. How can i make only these columns read only and not effect the other columns in my datagridview?
 
You can add those columns in designer as well, remember to set each columns appropriate DataPropertyName so they aren't generated again when you assign DataSource.
As alternative, if what you do is of a dynamic nature that can't be designed, you can loop through the columns collection and check which columns has DataPropertyName set and configure them in code likewise.
 
Back
Top