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

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

1 Answer 85 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 25 Feb 2011, 11:51 AM
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

1 Answer, 1 is accepted

Sort by
0
Adam
Top achievements
Rank 1
answered on 28 Feb 2011, 02:26 PM
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/
Tags
Sharepoint Integration
Asked by
Adam
Top achievements
Rank 1
Answers by
Adam
Top achievements
Rank 1
Share this question
or