Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
AllowAddNew row disabled when datatable contains zero rows
posted

I have an UltraGrid whose DataSource is a datatable and has AllowAddNew set to FixedAddRowOnBottom.  If the datatable contains at least 1 row (dt.rows.count>=1) then I can click in the blank row and supply values for the new record.  However, if the datatable contains zero rows (dt.rows.count=0) then the blank row acts like it is disabled.  Meaning if I click in the blank row the backcolor of the cell does not change from gray to white, I do not get the vertical cursor bar, and everything I type is ignored.

What do I need to do so the user can create the first row?

Any help on this issue is greatly appreciated!

  • 469350
    Offline posted

    Hi Karen,

    What version of the grid are you using? And what version of Visual Studio and the DotNet framework are you coding with?

    I vaguely remember there used to be some problems with the BindingManager and the DataTable class where it would not allow you to add a new row to an empty table. So the issue might not have anything to do with the grid.

    You might try using a BindingSource to wrap your DataTable and see if that helps.