Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
570
Can't access Columns with AutoGenerateColumns=true
posted

I have 3 bands with AutoGenerateColumns=true and when i try to format the header text of column i got a error.

I try both Way with no succes:

grid.GridView.Columns("id").Header.Text = "N°"

OR

grid.Columns("id").Header.Text = "N°"

I got this error : Object reference not set to an instance of an object.

Parents
No Data
Reply
  • 25665
    Offline posted

    Hello,

    Thank you for contacting Infragistics!

    This is the expected behavior as the columns collection is only for column that have been manually created either through markup or code. I recommend that you set AutoGenerateColumns to false and create your columns yourself. If you are unable to do this you can get access to the columns autogenerated through the row, for example:

    Whdg.GridView.Rows(0).items(0).Column

    Please let me know if you have any further questions concerning this matter.

Children