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();
}
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();
}