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

Having trouble getting RadGrid to not postback on Edit

3 Answers 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 22 Sep 2008, 06:23 AM
I'm new to Telerik web controls, and I pretty much followed the exact example from this page, substituting my own data source in for the one provided (although I'm not using the SessionDataSource). Each time I hit the edit button on my page, the page posts back and returns no data (do I really need an OnNeedDataSource handler?) and of course, the loading image does not appear either. I could post my code, but all I've really done is swap out the SessionDataSource from the example and replaced it with a simple instance of a DataTable on the Page_Load(). Does anyone have any idea of what I might be doing wrong? If not, are there any super-simple examples of how to get an AJAX popup edit form to work? Thanks!

3 Answers, 1 is accepted

Sort by
0
Steve Y
Top achievements
Rank 2
answered on 22 Sep 2008, 07:10 AM
Hi Adam,

Do you have the RadAjaxManager on the aspx page and configured to ajaxify the Grid? If not, drop one on the page, hit the smart tag, and configure ajax manager to have the Grid as both initiating and being updated by ajax.

Regards, Steve
0
Adam
Top achievements
Rank 1
answered on 22 Sep 2008, 01:53 PM

I do have the RadAjaxManager, and I've simply copied and pasted the code from the example and removed the second grid for simplicity. Here's what I've got:

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <!-- content start -->
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="CheckBox1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="CheckBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="CheckBox1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
        Width="75px" Transparency="5">
        <img style="margin-top: 150px;" alt="Loading..." src='http://www.armsflow.org/images/spinner.gif' />
    </telerik:RadAjaxLoadingPanel>
    <br />
    <div>
        <div>
            <asp:CheckBox ID="CheckBox1" Text="Allow multi-row edit (first grid)" AutoPostBack="true"
                Checked="<%# RadGrid1.AllowMultiRowEdit %>" runat="server" OnCheckedChanged="CheckBox1_CheckedChanged" />
        </div>
    </div>
    <telerik:RadGrid ID="RadGrid1" AutoGenerateEditColumn="true" runat="server" AllowAutomaticDeletes="True"
        AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowPaging="True"
        AllowMultiRowEdit="<%# CheckBox1.Checked %>" AllowSorting="true" Skin="Hay">
        <PagerStyle Mode="NextPrevAndNumeric" />
        <MasterTableView EditMode="PopUp" CommandItemDisplay="Top" DataKeyNames="ID">
            <EditFormSettings CaptionFormatString="Edit ID: {0}" CaptionDataField="ID" />
        </MasterTableView>
    </telerik:RadGrid>

0
Steve Y
Top achievements
Rank 2
answered on 22 Sep 2008, 02:18 PM
I would be tempted to run RadAjaxManager designer from the smart tag directly and ensure it's all set up correctly from a naming perspective. Perhaps you could even simplify the controls it's ajaxifying to hunt down what the problem is.

Regards, Steve
Tags
Grid
Asked by
Adam
Top achievements
Rank 1
Answers by
Steve Y
Top achievements
Rank 2
Adam
Top achievements
Rank 1
Share this question
or