Gerald Christian
Member
- Joined
- May 9, 2020
- Messages
- 9
- Programming Experience
- 10+
In this mature C# project the DataGridView.Visible property of a certain grid view remains false at all times.
This is true even immediately after attempting to programmatically set the value to "true".
DataGridView.Visible property is set initially "true" in Designer, and nothing in the program sets it to "false"
The non-working grid view was recently added to the project, modeled on a number of working grid views. The grid views all differ mainly in the columns and data sources.
I have also set a VisibleChange event as a test, and it is triggered on the first setting of the property to "true". Again the property value remains "false" both before and after the attempt to set the property "true".
Perhaps some clues are in the following properties captured at runtime, which are different from a those of a working grid view.
CanFocus false
CanSelect false
ContainsFocus false
Created false
Focused false
Visible false
In the working grid view these properties are all "true".
I think most of these are a side effect rather than a cause of the non-working grid view.
The interesting one is the "Created" property.
I have single-stepped the invocation code for the grid view and it all executes with no exceptions.
Any ideas on this are appreciated. In particular I am curious about the "Created" property.
Thanks,
Gerald Christian
p.s.
I have heard the operation of the Visible control can be dependent on the parent object Visible property.
However the parent object is a TabPage, which does not have a .Visible property, at least not one exposed in Designer.
In any case all grid views have a TabPage parent.
This is true even immediately after attempting to programmatically set the value to "true".
DataGridView.Visible property is set initially "true" in Designer, and nothing in the program sets it to "false"
The non-working grid view was recently added to the project, modeled on a number of working grid views. The grid views all differ mainly in the columns and data sources.
I have also set a VisibleChange event as a test, and it is triggered on the first setting of the property to "true". Again the property value remains "false" both before and after the attempt to set the property "true".
Perhaps some clues are in the following properties captured at runtime, which are different from a those of a working grid view.
CanFocus false
CanSelect false
ContainsFocus false
Created false
Focused false
Visible false
In the working grid view these properties are all "true".
I think most of these are a side effect rather than a cause of the non-working grid view.
The interesting one is the "Created" property.
I have single-stepped the invocation code for the grid view and it all executes with no exceptions.
Any ideas on this are appreciated. In particular I am curious about the "Created" property.
Thanks,
Gerald Christian
p.s.
I have heard the operation of the Visible control can be dependent on the parent object Visible property.
However the parent object is a TabPage, which does not have a .Visible property, at least not one exposed in Designer.
In any case all grid views have a TabPage parent.