Hi, I'm looking for a type of grid control that would allow the user to enter values and save them to a database. The problem with DataGrid is such that if there are no data from the database already the grid is not visible. In my application, the user should see an empty grid and be able to fill it with his data and then save it. The new rows should also be automatically added when the user moves onto the last row. Could I use the datagrid but somehow set a property that will allow this kind of functionality? Should I use another control? Thanks a lot for any suggestions.
A:
If you have a standard column layout then create a DataTable with that layout and bind to that. Then when they want to save handle that the table doesn't exist and create it based on the rows in the bound DataTable.
If you don't have a standard column layout then you'll have to provide some mechanism to get the layout. Either handle the cell move events and create the layout yourself or create another control (table designer) which will let you specify the layout. After you have the layout you can do the same as above.
gbogumil
2010-04-09 12:52:25