Hi ,
I need the data from the ultrawebgrid as a data table for verification. This i have done it in Window application. I need to do it in WebApp. Somebody can help me in this regards.
Thanks alot.
nrv,
ASP.NET applications do not provide the ability to directly use a DataSet object in the design view, starting with version 2.0 of the .NET Framework. This leaves you with two options - using ObjectDataSource for design-time support or using the DataSet entirely in code.
If you want to use ObjectDataSource, I strongly recommend that you look over the MSDN documentation provided for ObjectDataSource. This control works the same for WebGrid as it does for the .NET GridView. Remember that ObjectDataSource represents "flat" data; if your DataSet contains multiple DataTables linked by relations, you'll want to expose each table with its own ObjectDataSource and link these together using our WebHierarchicalDataSource.
The alternative is to instantiate, fill, and bind your DataSet in code. For WebGrid, the typical suggestion is to use the grid's InitializeDataSource event to fill your DataSet and set it as the DataSource of your grid.
Thanks for your reply. I have attached sample website where i want your help. This is also commented in the button event.
My requirement as follows :
I have assigned a data to the UltrawebGrid. On a button click event, i want get data from the Grid and assign it to a Data Table.
Thanks in advance.
For this, you should use the events of WebGrid to update the data object, and then either commit the update to the data store immediately or store the data object in Session state (or persist it in some other fashion) for later updating of the data store.
In your application, you're already binding the grid to a DataTable. Use the grid's UpdateRow and DeleteRow events (or UpdateRowBatch and DeleteRowBatch) to pass any changes made to the grid into the corresponding rows of your DataTable. Store your DataTable in Session state during Page_Unload, and reload it during Page_Init if the Session variable exists. When your button click is processed, you will then have your up-to-date DataTable for updating your database.
The following two articles from our online help documentation of NetAdvantage for .NET 2009 Volume 2 should help to get you started:Database Updates with WebGrid eventsUpdating Data with a Data Set