Hosting a Custom Control within a DataGridView in VB.NET -- 2
Budget: $10 – $30 USD
The Datagridview will contain two custom columns. The custom columns will be of the type combobox.
When the combobox menu is opened, a Form will appear directly below the combobox. Basically, the Form should override the original dropdown menu of the combobox. When the datagridview is moved, the Form should also move with it.
The Form will contain two textboxes. Textbox1 will show the text within the first column, and Textbox2 will show the text within the second column. There is also a button, that when clicked, will close the Form. The user can also close the Form by clicking outside the Form.
Once the Form is closed, the text within Textbox1 and Textbox2 will update in the the combobox columns.
The combobox columns should be editable. For example, users can type in text, change text, etc. Likewise, when the text in the combobox columns are changed, the Textbox1 and Textbox2 text should also be updated with the new text when the Form is shown.
Users can add new rows. For example, editing the last row will automatically add a new row.
IMPLEMENTATION:
- using .NET Framework 4.8, written in VB.NET, with the source code provided
- Derive from the DataGridViewCell and DataGridViewColumn, such as seen in:
https://docs.microsoft.com/en-us/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells?view=netframeworkdesktop-4.8&redirectedfrom=MSDN
When the combobox menu is opened, a Form will appear directly below the combobox. Basically, the Form should override the original dropdown menu of the combobox. When the datagridview is moved, the Form should also move with it.
The Form will contain two textboxes. Textbox1 will show the text within the first column, and Textbox2 will show the text within the second column. There is also a button, that when clicked, will close the Form. The user can also close the Form by clicking outside the Form.
Once the Form is closed, the text within Textbox1 and Textbox2 will update in the the combobox columns.
The combobox columns should be editable. For example, users can type in text, change text, etc. Likewise, when the text in the combobox columns are changed, the Textbox1 and Textbox2 text should also be updated with the new text when the Form is shown.
Users can add new rows. For example, editing the last row will automatically add a new row.
IMPLEMENTATION:
- using .NET Framework 4.8, written in VB.NET, with the source code provided
- Derive from the DataGridViewCell and DataGridViewColumn, such as seen in:
https://docs.microsoft.com/en-us/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells?view=netframeworkdesktop-4.8&redirectedfrom=MSDN