I am creating some more complex controls containing already defined controls for use in my application which I am currently working.
I have an issue with a ListView control on which I try to “draw” a table (View = Details). I add the columns header for my ListView and a couple of rows. The header and the rows are visible in the designer from my custom activity, but when I add the custom control on a Windows form I cannot see them neither on the designer, neither when executing the application. The custom activity contains also other predefined controls: ListBox, TextBox, etc, which are shown correctly, but the ListView isn’t and I cannot find any reasonable explanation for this. I made also some debug and observed that the items are there but simply are not shown in the form.
Someone have any idea how I can go over this issue? 🙂
Thank you, for trying to help me with this.
I manged to solve the problem in not a very elegant manner, but one that it works. I will add my solution if anyone would need help with a similar problem.
I don’t know if it could be understand from my question but I created the custom control from the designer. It seems that there is a small bug with generating the Designer file if adding a ListView on a custom control. For some reason the columns added in the designer are not added into the *.Designer file, I manually added them and the problem was solved. The lines of code that should be added in this case will be something like this:
I must also note that this problem can be observed only when adding the ListView through the designer on a custom control, if it is added directly on a Windows form the *.Designer file will be saved Ok.