3 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 25 Sep 2012, 06:05 AM
Hi,
You can perform automatic CRUD operations by setting AllowAutomaticDeletes as True , AllowAutomaticInserts as True and AllowAutomaticUpdates as True.
aspx:
Also check the following demo.
Grid / Automatic Operations
Thanks,
Shinu.
You can perform automatic CRUD operations by setting AllowAutomaticDeletes as True , AllowAutomaticInserts as True and AllowAutomaticUpdates as True.
aspx:
<
telerik:RadGrid
ID
=
"RadGrid1"
GridLines
=
"None"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
PageSize
=
"10"
AllowAutomaticUpdates
=
"True"
. . . .>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString35 %>"
DeleteCommand="DELETE FROM [Products] WHERE [ProductID] = @ProductID"
InsertCommand="INSERT INTO [Products] ([ProductName], [CategoryID]) VALUES (@ProductName, @CategoryID)"
SelectCommand="SELECT [ProductID], [ProductName] FROM [Products]"
UpdateCommand="UPDATE [Products] SET [ProductName] = @ProductName, [CategoryID] = @CategoryID WHERE [ProductID] = @ProductID">
<
DeleteParameters
>
<
asp:Parameter
Name
=
"ProductID"
Type
=
"Int32"
/>
</
DeleteParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"ProductName"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"CategoryID"
Type
=
"Int32"
/>
</
InsertParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"ProductName"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"CategoryID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"ProductID"
Type
=
"Int32"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
Grid / Automatic Operations
Thanks,
Shinu.
0

Swapnil
Top achievements
Rank 1
answered on 25 Sep 2012, 06:29 AM
1)The grid is looking same as previous grid , there is no new text boxes or button or labels for insert ,update and delete.
2)i am using Entity Framework so how to write that stored procedure and where to write.
Plz help,
Thanks
2)i am using Entity Framework so how to write that stored procedure and where to write.
Plz help,
Thanks
0

Shinu
Top achievements
Rank 2
answered on 26 Sep 2012, 04:43 AM
Hi,
You can configure the EntityDataSource as shown below. Here is the demo which explains the same.
aspx:
Thanks,
Shinu.
You can configure the EntityDataSource as shown below. Here is the demo which explains the same.
aspx:
<
asp:EntityDataSource
ID
=
"EntityDataSourceCustomers"
runat
=
"server"
EntitySetName
=
"Customers"
OrderBy
=
"it.[ContactName]"
EntityTypeFilter
=
"Customers"
EnableUpdate
=
"True"
EnableDelete
=
"True"
EnableInsert
=
"True"
>
</
asp:EntityDataSource
>
Thanks,
Shinu.