Answer Posted October 13, 2003 Posted October 13, 2003 I am creating a custom datagrid that inherits the windows forms datagrid. What i do on load is create teh 6 columns i need. I want to at run time however, be able to hide or unhide each column. I do not want to set its width to 0. So i created a new collection ( contains hidden columns ). And add the column i want to hide to this collection, then remove it from the datagrids collection. Everything works fine. To show it again, i add the column from my colletion to the datagrids collection. Everything works fine, until i try and remove the Column from my "hidden column Collection". It crashes and says object reference not found. Anyone got any ideas. I dont quite understand why i cant do this. Quote
Answer Posted October 13, 2003 Author Posted October 13, 2003 One other thing. It doesnt throw the error, until the column i just unhide is the viewable area of the datagrid. So if its not in the viewable region and i have to scroll to see it, it throws the error the instance the column is viewable. Quote
Jerod Posted October 15, 2003 Posted October 15, 2003 How are you removing the column? By index, by name? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.