K
k992637
Hello
I have derived a class from DataGridTextBoxColumn and am getting some
behaviour which I do not understand and I would like to know where I am
going wrong.
The problem is like this. I have a datagrid, lets say with four
columns. Two columns have my derived style and two have the default
DataGridTextBoxColumn. When you make changes to the datagrid there is
a button to press to validate and then send the changes back to the
database to be written. The problem comes when you click in the "new
row" at the bottom of a datagrid (the blank row with the star in the
header). If you click into and then straight off the default
DataGridTextBoxColumn in the new row, the UI indicates that no new row
has been created, and if you then save the changes, no new rows are
added to the database. However when you click on and then away from
the derived class, the UI performs in the same way - it appears as if
there are no new rows added, but when you click save changes you get a
new row written to the database - with all the row default values.
This implies that the row was created in the underlying DataTable, but
that fact was not reflected in the UI of the datagrid. For reasons
that I shall not go into this is a big problem for my application.
What I would really like to know is what I need to do to get my derived
column style to behave in the same way in this situation as the
DataGridTextBoxColumn. I.e. click on and away - the UI implies that no
row has been created and that is in fact the case when writing changes
to the database.
Thanks in advance for any light that can be shed on this issue! I've
been reading lots of articles on MSDN but none that I have found seems
to cover this situation!
Best Regards
David Smith
I have derived a class from DataGridTextBoxColumn and am getting some
behaviour which I do not understand and I would like to know where I am
going wrong.
The problem is like this. I have a datagrid, lets say with four
columns. Two columns have my derived style and two have the default
DataGridTextBoxColumn. When you make changes to the datagrid there is
a button to press to validate and then send the changes back to the
database to be written. The problem comes when you click in the "new
row" at the bottom of a datagrid (the blank row with the star in the
header). If you click into and then straight off the default
DataGridTextBoxColumn in the new row, the UI indicates that no new row
has been created, and if you then save the changes, no new rows are
added to the database. However when you click on and then away from
the derived class, the UI performs in the same way - it appears as if
there are no new rows added, but when you click save changes you get a
new row written to the database - with all the row default values.
This implies that the row was created in the underlying DataTable, but
that fact was not reflected in the UI of the datagrid. For reasons
that I shall not go into this is a big problem for my application.
What I would really like to know is what I need to do to get my derived
column style to behave in the same way in this situation as the
DataGridTextBoxColumn. I.e. click on and away - the UI implies that no
row has been created and that is in fact the case when writing changes
to the database.
Thanks in advance for any light that can be shed on this issue! I've
been reading lots of articles on MSDN but none that I have found seems
to cover this situation!
Best Regards
David Smith