This is a migrated thread and some comments may be shown as answers.

RadGrid as data entry form?

4 Answers 207 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 02 Jan 2009, 12:32 AM
Hey all,

I want to use a radgrid without a data source, just to be able to for my customers to enter in line items for creating invoices.  I want it to be able to add rows by using ajax, and then loop through after the data entry and insert to my sql db... i cant seem to figure out how to use the grid by default to be a data entry form rather than a data display form.

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 02 Jan 2009, 06:13 AM
Hi Darren,

One suggestion would be to bind the RadGrid with an empty DataTable. Keep the Grid Insert form open always on the top so that you can enter the Data . While entering data  you can dynamically add the data to the temporary DataTable and then you can perform bulk Insert to add the data from the DataTable to the DataBase.

I have also found a code library which demostrates a similar scenario as your's.
Excel-like RadGrid

Shinu
0
Alagappan Venkatachalam
Top achievements
Rank 1
answered on 03 Sep 2009, 08:37 AM
Hi Shinu,

I have tried the functionality mentioned in the Example. 

Where in my case, I have all the columns are in GridTemplateColumn. The Grid is not bound to any datasource and consuming the datasource OnNeedDataSource event.

 To add a new row I am using the ItemCommand property of the Grid and trying to access the new values of existing rows. But it fails since I could not access the new value of the column.

       Hashtable newValues = new Hashtable();
                       RG.MasterTableView.ExtractValuesFromItem(newValues, dataItem);
                       int Type=dataItem["CustPTC_Type"]   --------- This is producing the error and says the cell with the name CustPTC_Type coud not found

also the Dataitem count is 0

Thanks
0
Elliott
Top achievements
Rank 2
answered on 02 Jun 2010, 03:16 PM
This is very close to what I am looking for
so - I declare the Columns explicitly
bind to a DataTable which is set to Nothing on Page Load
how (and when) do I programatically open the Insert row?
can I respond to data entry without the user clicking on an insert link?
0
Elliott
Top achievements
Rank 2
answered on 04 Jun 2010, 08:08 PM
I translated this to VB to match the rest of the site
the FireCommand isn't working
is the problem VB - or is it that I am putting it into a MasterPage
the event is getting cancelled by the Telerik javascript (why????)

Marianne Seggerman

VS 2010, Telerik trial Rad Controls
Tags
Grid
Asked by
Darren
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Alagappan Venkatachalam
Top achievements
Rank 1
Elliott
Top achievements
Rank 2
Share this question
or