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

Telerik Grid + Telerik ORM Updating

1 Answer 36 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sander
Top achievements
Rank 1
Sander asked on 01 Aug 2011, 08:06 AM
Hi Folks,

I am new to Telerik ORM.

I have a telerik grid with openaccessdatasource with delete and update enabled, the grid shows the current data but when i try to edit/update them it does not work, the changes are not made.

what am i doeing wrong, this is my code:

<%@ Page Title="" Language="C#" MasterPageFile="~/Operator.Master" AutoEventWireup="true"
    CodeBehind="Channels.aspx.cs" Inherits="IMS_Telerik.Operators.Prepare.TelevisionRadio.Channels" %>
 
<%@ Register Assembly="Telerik.OpenAccess.Web" Namespace="Telerik.OpenAccess" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 
  
    <table cellpadding="0" cellspacing="0" style="border: none;" width="100%">
        <tr>
            <td style="border: none;" valign="top" width="300px">
                <table width="300px" cellpadding="0" cellspacing="0" style="padding: 5px;  
  border: solid 1px #e8eef4; margin-right:15px;">
                    <tr>
                        <td valign="top" style="margin-right: 15px">
                            <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Black" Width="100%">
                                <Items>
                                    <telerik:RadPanelItem runat="server" Expanded="True" Text="Actions">
                                        <Items>
                                            <telerik:RadPanelItem runat="server" Height="30px"
                                                ImageUrl="~/Images/Icons/Menu/rtvchannel.png" Selected="True" Text="Channels">
                                            </telerik:RadPanelItem>
                                            <telerik:RadPanelItem runat="server" Height="30px"
                                                ImageUrl="~/Images/Icons/Menu/rtvchannel-add.png"
                                                NavigateUrl="~/Operators/Prepare/TelevisionRadio/AddChannels.aspx"
                                                Text="Add Channel">
                                            </telerik:RadPanelItem>
                                        </Items>
                                    </telerik:RadPanelItem>
                                </Items>
                            </telerik:RadPanelBar>
                        </td>
                    </tr>
                </table>
            </td>
            <td style="border: none;" valign="top">
                <table width="100%" cellpadding="0" cellspacing="0" style="padding: 5px;  
  border: solid 1px #e8eef4;">
                    <tr>
                        <td valign="top">
                            <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0"
                                DataSourceID="OpenAccessDataSource1" GridLines="None" Skin="Black"
                                AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"
                                AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"
                                ShowGroupPanel="True">
                                <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True"
                                    ReorderColumnsOnClient="True">
                                    <Selecting AllowRowSelect="True" />
                                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                                </ClientSettings>
<MasterTableView AutoGenerateColumns="False" DataSourceID="OpenAccessDataSource1">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridBoundColumn DataField="Channel_id" DataType="System.UInt32"
            FilterControlAltText="Filter Channel_id column" HeaderText="Channel_id"
            SortExpression="Channel_id" UniqueName="Channel_id">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_epg_id"
            FilterControlAltText="Filter Channel_epg_id column" HeaderText="Channel_epg_id"
            SortExpression="Channel_epg_id" UniqueName="Channel_epg_id" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_name"
            FilterControlAltText="Filter Channel_name column" HeaderText="Channel_name"
            SortExpression="Channel_name" UniqueName="Channel_name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_image"
            FilterControlAltText="Filter Channel_image column" HeaderText="Channel_image"
            SortExpression="Channel_image" UniqueName="Channel_image">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_image_icon"
            FilterControlAltText="Filter Channel_image_icon column"
            HeaderText="Channel_image_icon" SortExpression="Channel_image_icon"
            UniqueName="Channel_image_icon" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_level"
            FilterControlAltText="Filter Channel_level column" HeaderText="Channel_level"
            SortExpression="Channel_level" UniqueName="Channel_level" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_category"
            FilterControlAltText="Filter Channel_category column"
            HeaderText="Channel_category" SortExpression="Channel_category"
            UniqueName="Channel_category" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_group"
            FilterControlAltText="Filter Channel_group column" HeaderText="Channel_group"
            SortExpression="Channel_group" UniqueName="Channel_group">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_epg"
            FilterControlAltText="Filter Channel_epg column" HeaderText="Channel_epg"
            SortExpression="Channel_epg" UniqueName="Channel_epg" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_type"
            FilterControlAltText="Filter Channel_type column" HeaderText="Channel_type"
            SortExpression="Channel_type" UniqueName="Channel_type" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_archive"
            FilterControlAltText="Filter Channel_archive column"
            HeaderText="Channel_archive" SortExpression="Channel_archive"
            UniqueName="Channel_archive" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_direct"
            FilterControlAltText="Filter Channel_direct column" HeaderText="Channel_direct"
            SortExpression="Channel_direct" UniqueName="Channel_direct" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_url"
            FilterControlAltText="Filter Channel_url column" HeaderText="Channel_url"
            SortExpression="Channel_url" UniqueName="Channel_url">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_block_url"
            FilterControlAltText="Filter Channel_block_url column"
            HeaderText="Channel_block_url" SortExpression="Channel_block_url"
            UniqueName="Channel_block_url" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_block_name"
            FilterControlAltText="Filter Channel_block_name column"
            HeaderText="Channel_block_name" SortExpression="Channel_block_name"
            UniqueName="Channel_block_name" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_block_timeshift"
            FilterControlAltText="Filter Channel_block_timeshift column"
            HeaderText="Channel_block_timeshift" SortExpression="Channel_block_timeshift"
            UniqueName="Channel_block_timeshift" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Channel_auth"
            FilterControlAltText="Filter Channel_auth column" HeaderText="Channel_auth"
            SortExpression="Channel_auth" UniqueName="Channel_auth">
        </telerik:GridBoundColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
                            </telerik:RadGrid>
                            
                        
                            <telerik:OpenAccessDataSource ID="OpenAccessDataSource1" runat="server"
                                ObjectContextProvider="IMS_Telerik.EntitiesModel, IMS Telerik"
                                TypeName="IMS_Telerik.Channel" Where="" EnableDelete="true"
                                EnableUpdate="true">
                             <UpdateParameters>
                             <asp:Parameter Name="Channel_name" DbType="String" />
                             </UpdateParameters>
                            </telerik:OpenAccessDataSource>
                            
                        
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>


Thanks for your help!

Regards Sander

1 Answer, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 04 Aug 2011, 10:58 AM
Hi Sander,

In order for automatic operations to work with RadGrid you need to enable AllowAutomaticInserts/Updates/Deletes properties. Check this help article for further details.

Best wishes,
Pavel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Sander
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Share this question
or