Home Forums WinForms controls Xceed Grid for WinForms Get columns from dataadapter but not data

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15151 |

    Is there a way to have a gridcontrol get the column info from a dataadapter, but not display the existing datarows. I want to create a blank grid for data entry of new records, and idsplay what the user enters, but not the thousands of rows already in the table.

    Imported from legacy forums. Posted by Phil (had 4046 views)

    User (Old forums)
    Member
    Post count: 23064

    There are a few possible solutions.

    You can clear the DataRows collection after the gird has created them, which is of course not very good if you have a lot of DataRows.

    You can also never call the Fill method of the DataAdapter, so the DataSet has its columns, but is empty. Once you bind the grid to it, the columns will be created with no rows.

    You can also fill the DataSet, then loop on the tables and columns into the DataSet to create a template DataSet, and then bind the grid to this row-less DataSet.

    Imported from legacy forums. Posted by André (had 405 views)

    User (Old forums)
    Member
    Post count: 23064

    “You can also never call the Fill method of the DataAdapter, so the DataSet has its columns, but is empty. Once you bind the grid to it, the columns will be created with no rows.”

    I tried this, but when I hit enter the newly entered row disappears, it is not added as a datarow.

    Table is 9000 rows and growing by several hundred per week, so loading the datarows and discarding them does not seem to be a good solution.

    Is there some event i need to ahndle manually that is handled automatically after Fill is called?

    Imported from legacy forums. Posted by Phil (had 489 views)

    User (Old forums)
    Member
    Post count: 23064

    I tried altering the select command so I could use dataadapter.fill, and one row added directly into the database which meets the new select command shows up, but the insertion row data still vanishes when I hit enter.
    Help?!?

    Imported from legacy forums. Posted by Phil (had 465 views)

    User (Old forums)
    Member
    Post count: 23064

    “I tried this, but when I hit enter the newly entered row disappears, it is not added as a datarow. “

    We do not reproduce this behavior here, that is, if I use a DataSet which has not been filled, I can add a new DataRow through an InsertionRow with no problem. If this is not working for you, is it possible that some constrains in the DB makes the changes to be rejected? It could explain why it does not work in the second scenario.

    To find out if this is the case, and you may already be set up properly, you need to make sure the debugger is set to break on all exceptions (Debug Menu -> Exceptions -> Common Language Runtime Exception, then select “Break into the debugger” radio button in VS2003, or select “Thrown” CheckBox in VS2005).

    If you are in VS2005, make sure the “Enable Just My Code” CheckBox is unselected (Tools Menu -> Options -> Debugging -> General).

    This will make sure that no exceptions are swallowed by the grid, and that the debugger will break in any part of the code, not just yours.

    Imported from legacy forums. Posted by André (had 300 views)

    User (Old forums)
    Member
    Post count: 23064

    put in select >>> WHERE 0=1

    Imported from legacy forums. Posted by smileym (had 4941 views)

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.