This is my scenario:
Master Page.
centerBody div--> in content page the app generate programmatically a RadSplitter with 2 panes (left and center)
ContentPage --> add in center Pane grid.
I need do this grid with heigt = centerBody heigth or Splitter height.
this is my contentPage.aspx:
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
window.onload = regrid;
function regrid() {
/try1: this option
var scrollArea = $find("<%= CommunityGrid.ClientID %>" + "_GridData");
if (scrollArea) {
// this isn't work
scrollArea.style.height = 700 + "px";
}
//try 2: this option
var scrollArea = $find("<%= CommunityGrid.ClientID %>");
if (scrollArea) {
// this isn't work
scrollArea.get_element().style.height = 700 + "px";
}
}
function ShowEditForm(id, rowIndex) {
var grid = $find("<%= CommunityGrid.ClientID %>");
var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
grid.get_masterTableView().selectItem(rowControl, true);
var oWindow = window.radopen("CommunityForm.aspx?ID=" + id, "UserListDialog");
return false;
}
function RowDblClick(sender, eventArgs) {
editedRow = eventArgs.get_itemIndexHierarchical();
$find("<%= CommunityGrid.ClientID %>").get_masterTableView().editItem(editedRow);
}
function ShowDelete(id, rowIndex) {
var grid = $find("<%= CommunityGrid.ClientID %>");
var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
grid.get_masterTableView().selectItem(rowControl, true);
var oWindow = window.radopen("DeleteCommunity.aspx?ID=" + id, "ConfirmDelete");
return false;
}
function ShowInsertForm() {
var oWindow = window.radopen("CommunityForm.aspx", "UserListDialog");
return false;
}
function confirmCallBackFn(arg) {
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
if (arg == true)
{ ajaxManager.ajaxRequest("Remove"); }
}
function refreshGrid(arg) {
if (arg != null) { $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest(arg); }
else {
if (arg) {
$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest(arg);
}
else {
$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("RebindAndNavigate");
}
}
}
</script>
</telerik:RadCodeBlock>
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="AjaxManagerProxy1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="CommunityGrid" LoadingPanelID="LoadginPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="CommunityGrid">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="CommunityGrid" LoadingPanelID="LoadginPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<UC:header runat="server" ID="headerPage" />
<div id="containerSubWHelp" runat="server" >
<telerik:RadGrid ID="CommunityGrid" runat="server" OnNeedDataSource="CommunityGrid_NeedDataSource"
OnUpdateCommand="CommunityGrid_UpdateCommand" OnInsertCommand="CommunityGrid_InsertCommand"
AutoGenerateColumns="False" OnItemCommand="CommunityGrid_ItemCommand" OnPreRender="CommunityGrid_PreRender"
OnItemCreated="CommunityGrid_ItemCreated" OnDeleteCommand="CommunityGrid_DeleteCommand"
OnItemDataBound="CommunityGrid_ItemDataBound" >
<MasterTableView DataKeyNames="Id">
<Columns>
<telerik:GridTemplateColumn UniqueName="TemplateEditColumn" HeaderStyle-Width="25px"
AllowFiltering="false" Resizable="false">
<ItemTemplate>
<asp:ImageButton ID="EditLink" runat="server" ImageUrl="~/UI/Images/pencil.png">
</asp:ImageButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridEditCommandColumn HeaderStyle-Width="25px" UniqueName="EditCommandColumn"
ButtonType="ImageButton" EditImageUrl="../Images/grid_edit.png" Resizable="false">
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn UniqueName="btnDelete" ConfirmDialogType="RadWindow" ButtonType="ImageButton"
CommandName="Delete" ConfirmDialogHeight="100px" ConfirmDialogWidth="300px" HeaderStyle-Width="25px"
Resizable="false" />
<telerik:GridTemplateColumn DataField="Id" HeaderText="Id" UniqueName="Id" Visible="false">
<InsertItemTemplate>
<telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Bind("Id") %>' Width="150px"
ReadOnly="true" Enabled="false" />
</InsertItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Eval("Id") %>' ReadOnly="true"
Width="150px" />
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Name" UniqueName="Name" DataField="Name">
<EditItemTemplate>
<asp:TextBox ID="txtName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
CssClass="validator" ControlToValidate="txtName"></asp:RequiredFieldValidator><br />
<asp:CustomValidator ID="cvName" CssClass="validator" OnServerValidate="cvName_ServerValidate"
Display="Dynamic" runat="server" ControlToValidate="txtName"></asp:CustomValidator>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblName" runat="server" Width="200px" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Description" DataField="Description" UniqueName="Description">
<EditItemTemplate>
<asp:TextBox ID="txtDescription" Width="250px" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Description") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblDescription" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Description") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<CommandItemTemplate>
<UC:AddButtons ID="AddButtons" runat="server" />
</CommandItemTemplate>
</MasterTableView>
<ClientSettings>
<ClientEvents OnRowDblClick="RowDblClick" />
<Scrolling UseStaticHeaders="true"/>
</ClientSettings>
</telerik:RadGrid>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
<Windows>
<telerik:RadWindow ID="UserListDialog" runat="server" Height="600px" Width="800px"
ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" VisibleStatusbar="false"
Behaviors="Close" Skin="Vista" />
<telerik:RadWindow ID="ConfirmDelete" runat="server" Skin="Vista" Left="15%" ReloadOnShow="true"
ShowContentDuringLoad="false" Modal="true" VisibleStatusbar="false" VisibleTitlebar="false"
Behaviors="Close" Height="150px" Width="300px" />
</Windows>
</telerik:RadWindowManager>
</div>
</asp:Content>
Where is the error?
Master Page.
centerBody div--> in content page the app generate programmatically a RadSplitter with 2 panes (left and center)
ContentPage --> add in center Pane grid.
I need do this grid with heigt = centerBody heigth or Splitter height.
this is my contentPage.aspx:
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
window.onload = regrid;
function regrid() {
/try1: this option
var scrollArea = $find("<%= CommunityGrid.ClientID %>" + "_GridData");
if (scrollArea) {
// this isn't work
scrollArea.style.height = 700 + "px";
}
//try 2: this option
var scrollArea = $find("<%= CommunityGrid.ClientID %>");
if (scrollArea) {
// this isn't work
scrollArea.get_element().style.height = 700 + "px";
}
}
function ShowEditForm(id, rowIndex) {
var grid = $find("<%= CommunityGrid.ClientID %>");
var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
grid.get_masterTableView().selectItem(rowControl, true);
var oWindow = window.radopen("CommunityForm.aspx?ID=" + id, "UserListDialog");
return false;
}
function RowDblClick(sender, eventArgs) {
editedRow = eventArgs.get_itemIndexHierarchical();
$find("<%= CommunityGrid.ClientID %>").get_masterTableView().editItem(editedRow);
}
function ShowDelete(id, rowIndex) {
var grid = $find("<%= CommunityGrid.ClientID %>");
var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
grid.get_masterTableView().selectItem(rowControl, true);
var oWindow = window.radopen("DeleteCommunity.aspx?ID=" + id, "ConfirmDelete");
return false;
}
function ShowInsertForm() {
var oWindow = window.radopen("CommunityForm.aspx", "UserListDialog");
return false;
}
function confirmCallBackFn(arg) {
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
if (arg == true)
{ ajaxManager.ajaxRequest("Remove"); }
}
function refreshGrid(arg) {
if (arg != null) { $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest(arg); }
else {
if (arg) {
$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest(arg);
}
else {
$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("RebindAndNavigate");
}
}
}
</script>
</telerik:RadCodeBlock>
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="AjaxManagerProxy1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="CommunityGrid" LoadingPanelID="LoadginPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="CommunityGrid">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="CommunityGrid" LoadingPanelID="LoadginPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<UC:header runat="server" ID="headerPage" />
<div id="containerSubWHelp" runat="server" >
<telerik:RadGrid ID="CommunityGrid" runat="server" OnNeedDataSource="CommunityGrid_NeedDataSource"
OnUpdateCommand="CommunityGrid_UpdateCommand" OnInsertCommand="CommunityGrid_InsertCommand"
AutoGenerateColumns="False" OnItemCommand="CommunityGrid_ItemCommand" OnPreRender="CommunityGrid_PreRender"
OnItemCreated="CommunityGrid_ItemCreated" OnDeleteCommand="CommunityGrid_DeleteCommand"
OnItemDataBound="CommunityGrid_ItemDataBound" >
<MasterTableView DataKeyNames="Id">
<Columns>
<telerik:GridTemplateColumn UniqueName="TemplateEditColumn" HeaderStyle-Width="25px"
AllowFiltering="false" Resizable="false">
<ItemTemplate>
<asp:ImageButton ID="EditLink" runat="server" ImageUrl="~/UI/Images/pencil.png">
</asp:ImageButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridEditCommandColumn HeaderStyle-Width="25px" UniqueName="EditCommandColumn"
ButtonType="ImageButton" EditImageUrl="../Images/grid_edit.png" Resizable="false">
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn UniqueName="btnDelete" ConfirmDialogType="RadWindow" ButtonType="ImageButton"
CommandName="Delete" ConfirmDialogHeight="100px" ConfirmDialogWidth="300px" HeaderStyle-Width="25px"
Resizable="false" />
<telerik:GridTemplateColumn DataField="Id" HeaderText="Id" UniqueName="Id" Visible="false">
<InsertItemTemplate>
<telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Bind("Id") %>' Width="150px"
ReadOnly="true" Enabled="false" />
</InsertItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Eval("Id") %>' ReadOnly="true"
Width="150px" />
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Name" UniqueName="Name" DataField="Name">
<EditItemTemplate>
<asp:TextBox ID="txtName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
CssClass="validator" ControlToValidate="txtName"></asp:RequiredFieldValidator><br />
<asp:CustomValidator ID="cvName" CssClass="validator" OnServerValidate="cvName_ServerValidate"
Display="Dynamic" runat="server" ControlToValidate="txtName"></asp:CustomValidator>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblName" runat="server" Width="200px" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Description" DataField="Description" UniqueName="Description">
<EditItemTemplate>
<asp:TextBox ID="txtDescription" Width="250px" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Description") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblDescription" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Description") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<CommandItemTemplate>
<UC:AddButtons ID="AddButtons" runat="server" />
</CommandItemTemplate>
</MasterTableView>
<ClientSettings>
<ClientEvents OnRowDblClick="RowDblClick" />
<Scrolling UseStaticHeaders="true"/>
</ClientSettings>
</telerik:RadGrid>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
<Windows>
<telerik:RadWindow ID="UserListDialog" runat="server" Height="600px" Width="800px"
ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" VisibleStatusbar="false"
Behaviors="Close" Skin="Vista" />
<telerik:RadWindow ID="ConfirmDelete" runat="server" Skin="Vista" Left="15%" ReloadOnShow="true"
ShowContentDuringLoad="false" Modal="true" VisibleStatusbar="false" VisibleTitlebar="false"
Behaviors="Close" Height="150px" Width="300px" />
</Windows>
</telerik:RadWindowManager>
</div>
</asp:Content>
Where is the error?