T
The angry snapping Goose
Hi All:
I wish I brought my code sample home with me but I'm afraid I left it at
work. I'm struggling with trying to attach an "Editable" control to a
"bounded" DataGridView "after" the grid has been bounded.
Going from memory, I have a Typed Dataset which has a DataTable. This
datatable has a "Datetime" column in it. I am NOT creating the
DataGridTableColumns myself. Rather, they're being created at the time I
say:
dataBindingSource.DataSource = myDataTable;
Well... I located an example on how one can have a DatetimePicker for a
Column when you choose to edit the column. Since one of the columns will be
a Date, this control would be perfect. The example, however, assumes you
will create the DataGridView and all of it's DataGridViewColumns by hand.
In the constructor, it creates all of it's columns up front and then fills
in the DataTable afterwards. It does not use a binding source. So this
example won't work. I've tried numerous things to try and replace the
Date's default editor (which is a TextBox) for that column "after" the
bindingSources' dataSource has been set but no luck.
I'm familiar with Java Swing (I'm coverting to WinForms) and Java has the
getTableCellEditorComponent() method that you can override which allows you
to return an Editor of your choice when the user clicks in a cell to start
editing.
Is there a property or something similar to this in WinForms using the
DataGridView??? I'd like to return an instance of a CalendarPicker()
control which causes the datechooser dialog to come up. I have no choice
though to use the bindingSource so I cannot manually create the
DataGridViewColumns()...
thanks again...
I wish I brought my code sample home with me but I'm afraid I left it at
work. I'm struggling with trying to attach an "Editable" control to a
"bounded" DataGridView "after" the grid has been bounded.
Going from memory, I have a Typed Dataset which has a DataTable. This
datatable has a "Datetime" column in it. I am NOT creating the
DataGridTableColumns myself. Rather, they're being created at the time I
say:
dataBindingSource.DataSource = myDataTable;
Well... I located an example on how one can have a DatetimePicker for a
Column when you choose to edit the column. Since one of the columns will be
a Date, this control would be perfect. The example, however, assumes you
will create the DataGridView and all of it's DataGridViewColumns by hand.
In the constructor, it creates all of it's columns up front and then fills
in the DataTable afterwards. It does not use a binding source. So this
example won't work. I've tried numerous things to try and replace the
Date's default editor (which is a TextBox) for that column "after" the
bindingSources' dataSource has been set but no luck.
I'm familiar with Java Swing (I'm coverting to WinForms) and Java has the
getTableCellEditorComponent() method that you can override which allows you
to return an Editor of your choice when the user clicks in a cell to start
editing.
Is there a property or something similar to this in WinForms using the
DataGridView??? I'd like to return an instance of a CalendarPicker()
control which causes the datechooser dialog to come up. I have no choice
though to use the bindingSource so I cannot manually create the
DataGridViewColumns()...
thanks again...