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

Update dont work in grid

1 Answer 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Effendi
Top achievements
Rank 1
Effendi asked on 04 Nov 2010, 04:34 PM
I inserted grid control on my form. The data loads correctly but I cannot update the rows. Here are my code. Can anyone tell me what I did wrong


<

 

td class="style6">

 

 

<telerik:RadGrid ID="RadGrid2" runat="server" DataSourceID="SalesOrderDetails"

 

 

GridLines="None" AllowFilteringByColumn="True" AllowPaging="True"

 

 

AllowSorting="True" AutoGenerateEditColumn="True">

 

 

<MasterTableView AutoGenerateColumns="False" DataSourceID="SalesOrderDetails">

 

 

<CommandItemSettings ExportToPdfText="Export to Pdf" />

 

 

<RowIndicatorColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="ItemNo" HeaderText="ItemNo"

 

 

SortExpression="ItemNo" UniqueName="ItemNo">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ItemDesc" HeaderText="ItemDesc"

 

 

SortExpression="ItemDesc" UniqueName="ItemDesc">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Quantity" DataType="System.Int16"

 

 

HeaderText="Quantity" SortExpression="Quantity" UniqueName="Quantity">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="PdtLine" HeaderText="PdtLine"

 

 

SortExpression="PdtLine" UniqueName="PdtLine">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CustPrice" DataType="System.Decimal"

 

 

HeaderText="CustPrice" SortExpression="CustPrice" UniqueName="CustPrice">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Currency" HeaderText="Currency"

 

 

SortExpression="Currency" UniqueName="Currency">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Clumpcode" HeaderText="Clumpcode"

 

 

SortExpression="Clumpcode" UniqueName="Clumpcode">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="SalesOrder" HeaderText="SalesOrder"

 

 

SortExpression="SalesOrder" UniqueName="SalesOrder">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings>

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

 

<asp:SqlDataSource ID="SalesOrderDetails" runat="server"

 

 

ConnectionString="<%$ ConnectionStrings:Contract-LookupConnectionString %>"

 

 

 

SelectCommand="SELECT ItemNo, ItemDesc, Quantity, PdtLine, CustPrice, Currency, Clumpcode, SalesOrder FROM SalesOrderDetail WHERE (SalesOrder = @SalesOrder)"

 

 

UpdateCommand="UPDATE [SalesOrderDetail] Set [Clumpcode]=? Where [SalesOrder]=?" >

 

 

<SelectParameters>

 

 

<asp:ControlParameter ControlID="MOOGSO" Name="SalesOrder" PropertyName="Text"

 

 

Type="String" />

 

 

</SelectParameters>

 

 

<UpdateParameters>

 

 

<asp:Parameter Name="Clumpcode" Type="String" />

 

 

<asp:Parameter Name="SalesOrder" Type="String" />

 

 

</UpdateParameters>

 

 

</asp:SqlDataSource>

 

 

</td>

 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Nov 2010, 05:40 AM
Hello Effendi,

In order to perform the Automatic update operation , you need to set the AllowAutomaticUpdates property as"True".
For more information on this please go through the following documentation.
Automatic DataSource operations


Thanks,
Princy.
Tags
Grid
Asked by
Effendi
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or