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

Automatic Operations ObjectContainerDataSource

1 Answer 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 29 Mar 2011, 04:54 PM
Hi,

I have never posted before, I hope this is the correct place. My markup is below. When I click the edit button on a row and make a change in the Edit form, no update events are raised on the datasource . I have copied the sample several times from the website but I still cannot get my events wired up properly. I am using WCSF and am quite familiar with this framework. The datasource seems to work fine if I use an asp.net GridView. Any help would be appreciated.
Thanks

    <pp:ObjectContainerDataSource ID="ds1" runat="server" 
        DataObjectTypeName="Foo.Infrastructure.Interface.Object" 
        ondeleted="ds1_Deleted" UsingServerPaging="True" UsingServerSorting="True" 
        oninserted="ds1_Inserted" onselecting="ds1_Selecting" onupdated="ds1_Updated" />
    <telerik:RadGrid 
        ID="grid" runat="server" GridLines="None" AutoGenerateColumns="False"
        AllowAutomaticInserts="True"
        AllowAutomaticUpdates="True"
         PageSize="100" AllowPaging="True" AllowSorting="True"
        Width="100%" 
        AutoGenerateEditColumn="True" CellSpacing="0" DataSourceID="ds1">
        <MasterTableView CommandItemDisplay="Top" EditMode="EditForms" HorizontalAlign="NotSet"
            AllowAutomaticInserts="false" AllowAutomaticUpdates="true" InsertItemDisplay="Top"
            runat="server" DataSourceID="ds1">
            <Columns>
                <telerik:GridBoundColumn DataField="Id" HeaderText="Id" DataType="System.Int32" />
                <telerik:GridBoundColumn DataField="Name" HeaderText="Name" DataType="System.String" />
                <telerik:GridBoundColumn DataField="ApplicationDomain" HeaderText="Domain" DataType="System.String" />
                <telerik:GridBoundColumn DataField="DefaultTheme" HeaderText="Theme" DataType="System.String" />
                <telerik:GridBoundColumn DataField="DateCreated" HeaderText="Created" DataType="System.DateTime" DataFormatString="{0:MMM dd yyyy}" />
                <telerik:GridBoundColumn DataField="DateOnline" HeaderText="Online" DataType="System.DateTime" DataFormatString="{0:MMM dd yyyy}" />
                <telerik:GridBoundColumn DataField="DateOffline" HeaderText="Offline" DataType="System.DateTime" DataFormatString="{0:MMM dd yyyy}" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Ian
Top achievements
Rank 1
answered on 29 Mar 2011, 05:31 PM
I found the issue. Our project by default has enableViewState="false" in the web.config. Enabling this fixed the issue. I tried just setting the property to true on the grid but this didn't seem to work.

Thanks,
ian
Tags
Grid
Asked by
Ian
Top achievements
Rank 1
Answers by
Ian
Top achievements
Rank 1
Share this question
or