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.
Hello,
I am following up to see if the information provided has resolved this matter.
Please let me know if I may be of further assistance with this matter.
Thank you for the update. When AutoGenerateColumns is set to false the only way to have columns is to ether create them manually in code in the code behind or you can create them in markup. If you have AutoGenerateColumns set to true then create columns manually you may end up with duplicate columns.
Please let me know if you have any further questions concerning this matter.
Bhaaa! sorry i mean
Can i add column Manually by code then AutoGenerateColumns=false ?
And thanks for the quick reply!
Can i add column Manually by code then AutoGenerateColumns=true ?
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