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

Am I missing something?

3 Answers 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Carolus
Top achievements
Rank 1
Carolus asked on 05 May 2009, 10:49 PM
Of all the Grid products I have tried, this has to be the most confusing. Where in the H-E-DoubleHockeySticks does one add the INSERT ROW Command? I have looked at the tutorials, checked my database etc. Is there a Walkthrough that explains how to create a simple grid attached to a table to INSERT records? Why is this so DIFFICULT?

3 Answers, 1 is accepted

Sort by
0
Accepted
Todd Anglin
Top achievements
Rank 2
answered on 06 May 2009, 03:43 AM
Carolus-

I'm very sorry you've had trouble getting started with RadGrid! Let me see if I can point you to some resources that should help:

DEMO: Automatic Insert/Update/Delete Operations
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx

DEMO: Command Item (showing you how to enable auto UI for adding new rows)
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/commanditem/defaultcs.aspx

DOCS: Inserting Records Using In-Place Edit Form
http://www.telerik.com/help/aspnet-ajax/grdinsertingvaluesinplaceandeditforms.html

DOCS: Insert at Database Level with Queries
http://www.telerik.com/help/aspnet-ajax/grdinsertupdatedeleteatdatabaselevel.html

If you're using a ASP.NET DataSource control, you really don't do anything! Just connect your RadGrid to the data source control (such as the SqlDataSource) via the DataSourceID property. Assuming your DataSource is configured to allow inserts, you can set the AllowAutomaticInserts property on the Grid to "True" and that's all you'll need to do.

Hope this helps. Let me know if you get stuck and I'll be happy to provide more input.

-Todd
0
Carolus
Top achievements
Rank 1
answered on 06 May 2009, 02:48 PM
Missing this in the MasterTableViewTag. One thing that led to the confusion is the availability of the Edit/Delete commands in the RadGrid Tag.  Thanks for the help.

 

CommandItemDisplay="TopAndBottom" 

 

 

 

0
Todd Anglin
Top achievements
Rank 2
answered on 06 May 2009, 03:12 PM
Happy to help. Often, when a property exists in both RadGrid and MasterTableView, you can set it in either place and the settings will work. The reason is that you can have a Grid with no MasterTableView tag if you're using AutoGenerateColumns = "True."

And, yes, the CommandItem is the key to exposing the "auto UI" for enabling users to insert new records in to your Grid. You can also customize the CommandItemTemplate if you need to in the future to display whichever buttons your application needs.

If you get stuck in the future, feel free to come back to the forums for help!

-Todd
Tags
Grid
Asked by
Carolus
Top achievements
Rank 1
Answers by
Todd Anglin
Top achievements
Rank 2
Carolus
Top achievements
Rank 1
Share this question
or