I have a WinForm that has a DataGridView. When the form opens I want to enable/diable certain fields based on who is logged in, so in the form's load event I am trying to disable editing of certain fields. The below two statements give me the following errror: NullReferenceException occurred. Object reference not set to an instance of an object. Is there any difference for a DataGrid Please advise what I need to do to resolve. thanks.
Me.DataGridView1.Columns.Item("FieldName").Visible = True
Me.DataGridView1.Columns.Item("FieldName").ReadOnly = True