Hi,
I am using RadGrid control connected to an ObjectDataSource. I am using ItemTemplate and EditItemTemplate to show the items as in the demo of the ListView/DataList like RadGrid.
When i press the update after editing the item, the ObjectDataSource Update method is fired but the data passes is not bounded to the data in the Edit template even though it defined to be binded. i.e. all the parameters passed are nulls.
How can i edit/insert an item?
This is my code:
Thanks!
Ruth.
I am using RadGrid control connected to an ObjectDataSource. I am using ItemTemplate and EditItemTemplate to show the items as in the demo of the ListView/DataList like RadGrid.
When i press the update after editing the item, the ObjectDataSource Update method is fired but the data passes is not bounded to the data in the Edit template even though it defined to be binded. i.e. all the parameters passed are nulls.
How can i edit/insert an item?
This is my code:
<telerik:RadGrid ID="RadGrid2" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" |
AllowAutomaticUpdates="True" DataSourceID="AgentsDatasource" GridLines="None" |
ShowHeader="False" BorderStyle="None" GroupingEnabled="False" Skin="Outlook" |
Width="400px"> |
<HeaderContextMenu EnableTheming="True"> |
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
</HeaderContextMenu> |
<ItemStyle BorderStyle="None" /> |
<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="None" DataKeyNames="UserId" |
DataSourceID="AgentsDatasource" EditMode="InPlace" BorderStyle="None"> |
<ItemTemplate > |
<asp:Label ID="Label1" runat="server" Text='<%#Bind("SwitchId") %>'></asp:Label> |
|
<asp:Label ID="Label2" runat="server" Text='<%#Bind("Extension") %>'></asp:Label> |
|
<asp:LinkButton ID="btnEdit" runat="server" CommandName="Edit" Text="Edit"> |
</asp:LinkButton> |
</ItemTemplate> |
<EditItemTemplate> |
<asp:TextBox ID="tbSwitch" runat="server" Text='<%#Bind("SwitchId")%>'></asp:TextBox> |
<asp:TextBox ID="TextBox1" runat="server" Text='<%#Bind("Extension")%>'></asp:TextBox> |
<asp:LinkButton ID="btnEdit" runat="server" CommandName="Update" Text="Update"> |
</asp:LinkButton> |
</EditItemTemplate> |
<RowIndicatorColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</RowIndicatorColumn> |
<ExpandCollapseColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</ExpandCollapseColumn> |
<Columns> |
<telerik:GridBoundColumn DataField="SwitchId" HeaderText="SwitchId" UniqueName="SwitchId"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Extension" HeaderText="Extension" UniqueName="Extension"> |
</telerik:GridBoundColumn> |
</Columns> |
<EditFormSettings> |
<EditColumn UniqueName="EditCommandColumn1"> |
</EditColumn> |
</EditFormSettings> |
</MasterTableView> |
<ClientSettings> |
<Selecting AllowRowSelect="False" EnableDragToSelectRows="True" /> |
</ClientSettings> |
<SelectedItemStyle BorderStyle="None" /> |
<FilterMenu EnableTheming="True"> |
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
</FilterMenu> |
</telerik:RadGrid> |
<asp:ObjectDataSource ID="AgentsDatasource" runat="server" SelectMethod="FillAgentsExtensions" |
UpdateMethod="UpdateAgentsExtensions" TypeName="WebTester.WebTesterDataSource" |
OldValuesParameterFormatString="original_{0}"> |
<UpdateParameters> |
<asp:Parameter Name="original_UserId" Type="Int32" /> |
<asp:Parameter Name="SwitchId" Type="Int32" /> |
<asp:Parameter Name="Extension" Type="String" /> |
</UpdateParameters> |
</asp:ObjectDataSource> |
Thanks!
Ruth.