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

RadGrid with unexpected postback

1 Answer 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 16 Nov 2012, 02:13 PM
I have a RadPane on a web page that and the ID of the RadPane starts with an underscore. The RadPane also contains a RadGrid, and when clicking on the header of the RadGrid there is a postback that occurs that probably should not be happening. If a RadPane's ID does not start with an underscore and contains a RadGrid clicking the header does not result in a postback behaving as I expect.  Why does the underscore in the ID of the RadPane make a difference in the behavior?

HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <table>
            <tr>
                <td>When clicking in the header first grid you will get a postback when the ID of the RadPane starts with an underscore. </td>
            </tr>
            <tr>
                <td>When clicking in the header of the second grid you will not get a postback when the ID of the RadPane does not start with an underscore.</td>
            </tr>
        </table>
        <telerik:RadScriptManager runat="server" ID="ScriptManager1"></telerik:RadScriptManager>
        <telerik:RadSplitter runat="server" ID="Splitter" Orientation="Horizontal">
            <!-- RadPane with underscore at the beginning of the ID results in a submit when clicking the header -->
            <telerik:RadPane runat="server" ID="_Test" Height="100%">
                <telerik:radgrid runat="server" ID="Grid1"  Width="100%" Height="100%" AllowFilteringByColumn="true" Style="border: 0; outline: none">
                    <MasterTableView TableLayout="Fixed" Width="100%" />
                    <ClientSettings EnablePostBackOnRowClick="True">
                        <Scrolling AllowScroll="true" UseStaticHeaders="true"/>
                        <Selecting AllowRowSelect="True"></Selecting>
                    </ClientSettings>
                </telerik:radgrid>
            </telerik:RadPane>
            <!-- RadPane without underscore at the beginning of the ID does in result in a submit when clicking the header -->
            <telerik:RadPane runat="server" ID="Test" Height="100%">
                <telerik:radgrid runat="server" ID="Grid2"  Width="100%" Height="100%" AllowFilteringByColumn="true" Style="border: 0; outline: none">
                    <MasterTableView TableLayout="Fixed" Width="100%" />
                    <ClientSettings EnablePostBackOnRowClick="True">
                        <Scrolling AllowScroll="true" UseStaticHeaders="true"/>
                        <Selecting AllowRowSelect="True"></Selecting>
                    </ClientSettings>
                </telerik:radgrid>
            </telerik:RadPane>
        </telerik:RadSplitter>
    </form>
</body>
</html>

Code Behind:

        protected void Page_Load(object sender, EventArgs e)
        {
            var intData = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8 };
            var intData1 = new List<int> { 10, 20, 30, 40, 50, 60, 70, 80 };


            Grid1.DataSource = intData;
            Grid1.DataBind();


            Grid2.DataSource = intData1;
            Grid2.DataBind();
        }

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 21 Nov 2012, 09:23 AM
Hello Ben,

I already answered in your support ticket. The problem is that in this case the ID of the control has double underscore which is not supported scenario.
double underscore problem

Once again, please excuse us for any inconvenience caused.

Best regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Ben
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or