RadGrid in Sharepoint don't fire Insert(Edit) Command

2 posts, 0 answers
  1. Adam
    Adam avatar
    3 posts
    Member since:
    Feb 2010

    Posted 25 Feb 2011 Link to this post

    Hi,
    I added a RadGrid to my custom page.
    <asp:UpdatePanel ChildrenAsTriggers="true" UpdateMode="Conditional" runat="server">
            <ContentTemplate>
                <telerik:RadGrid ID="rgProducts" runat="server" AutoGenerateColumns="false" Skin="WebBlue"
                    OnItemInserted="rgProducts_ItemInserted" OnInsertCommand="rgProducts_InsertCommand"
          OnNeedDataSource="rgProducts_NeedDataSource" OnEditCommand="rgProducts_EditCommand"
                          OnItemUpdated="rgProducts_ItemUpdated">
                    <MasterTableView CommandItemDisplay="Top" AllowAutomaticInserts="True" EditMode="InPlace">
                        <Columns>
                            <telerik:GridBoundColumn DataField="ProductId" HeaderText="Id" />
                            <telerik:GridBoundColumn DataField="ProductName" HeaderText="Name" />
                            <telerik:GridBoundColumn DataField="BuyerGroup" HeaderText="BuyerGroup" />
                            <telerik:GridEditCommandColumn EditText="Edit" CancelText="Cancel" HeaderText="" />
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
            </ContentTemplate>
        </asp:UpdatePanel>

    When Grid is in edit mode, I fill required fields and press Update button, but this only fire Load event.
    The event OnNeedDataSource fire properly, but events OnInsertCommand, OnEditCommand don't.
    I try to create grid programmatic, but the effect is the same.

    PageLoad function:
    protected void Page_Load(object sender, EventArgs e)
            {
                if (!Page.IsPostBack)
                {
                    rgProducts.DataSource = OrderMoq.Products;
                }
            }

    rgProducts_NeedDataSource function:
    protected void rgProducts_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
            {
                rgProducts.DataSource = OrderMoq.Products;
            }

    Adam
  2. Adam
    Adam avatar
    3 posts
    Member since:
    Feb 2010

    Posted 28 Feb 2011 Link to this post

    I found the solution. It was the UpdatePanel bug in Sharepoint.

    http://sharemypoint.wordpress.com/2007/11/11/webpart-and-ajax-second-postback-not-working-in-updatepanel/

Back to Top