or
Dear all,
I’m trying to open the Rad window as modal and to be able to calculate the size of the opened window based on the opened page size i.e 400x400 and keep it centered. I don’t not want to use the autosize property.
Below is my Rad window setting as well the JS code which I use to recalculate the window size to fill the window.
Yourhelp is appreciated to open the modal window centered and in correct size based on the content page.
var
oWnd = window.radopen(_EncryptedURL,
"AdvancedForm"
);
oWnd.set_title(pageTitle);
resizeRadWindow(oWnd);
function
resizeRadWindow(radWindow) {
var
windowHeight = $(window).height();
var
windowWidth = $(window).width();
windowHeight = (windowHeight * 97.5) / 100;
windowWidth = (windowWidth * 98) / 100;
radWindow.moveTo(10, 10);
radWindow.setSize(windowWidth, windowHeight);
}
<
rad:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
>
<
Windows
>
<
rad:RadWindow
ID
=
"AdvancedForm"
runat
=
"server"
Modal
=
"True"
OpenerElementID
=
"showDialog"
InitialBehaviors
=
"None"
ShowContentDuringLoad
=
"false"
Behaviors
=
"Close"
OnClientClose
=
"refreshScheduler"
ReloadOnShow
=
"True"
Title
=
""
NavigateUrl
=
""
VisibleStatusbar
=
"False"
>
</
rad:RadWindow
>
</
Windows
>
</
rad:RadWindowManager
>
<
telerik:RadDatePicker
runat
=
"server"
ID
=
"TestPicker"
>
<
Calendar
>
<
FooterTemplate
>
<
telerik:RadButton
runat
=
"server"
ID
=
"RadButton1"
Text
=
"TestButton"
></
telerik:RadButton
>
</
FooterTemplate
>
</
Calendar
>
</
telerik:RadDatePicker
>
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
|
|
protected
void
RadGrid1_NeedDataSource(
object
source, GridNeedDataSourceEventArgs e)
{
if
(!String.IsNullOrEmpty(RadTreeViewContainers.SelectedValue))
RadGrid1.DataSource = WorkBoard.Client.Task.GetTaskByContainerId(RadTreeViewContainers.SelectedValue);
else
RadGrid1.DataSource = WorkBoard.Client.Task.GetTaskByContainerId(TaskFolders[0].Id);
}
protected
void
RadTreeViewContainers_NodeClick(
object
sender, RadTreeNodeEventArgs e)
{
RadGrid1.Rebind();
}
<
telerik:AjaxSetting
AjaxControlID
=
"RadAjaxManager1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid2"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
function
refreshGrid(args, type) {
if
(type ==
"A"
) {
if
(args == 1) {
radalert(
"Action Updated"
);
}
else
{
radalert(
"Action Added"
);
}
$find(
"<%= RadAjaxManager.GetCurrent(me).ClientID %>"
).ajaxRequest(
"RebindActions"
);
}
else
{
if
(args == 1) {
radalert(
"Record Updated"
);
}
else
{
radalert(
"Record Added"
);
}
$find(
"<%= RadAjaxManager.GetCurrent(me).ClientID %>"
).ajaxRequest(
"RebindRecords"
);
}
}
Protected Sub ajaxMsg_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles ajaxMsg.NeedDataSource
Dim Msg As String
Dim dsMsg As New DataSet()
Dim strProjectId As String
Try
Msg = ""
strProjectId = ddlProjectId.SelectedItem.Text
dsMsg = getMessageByCompNoAndProjectId(strProjectId, "")
ajaxMsg.DataSource = dsMsg
If dsMsg.Tables(0).Rows.Count = 0 Then
ajaxMsg.AllowSorting = False
Else
ajaxMsg.AllowSorting = True
End If
Catch ex As Exception
Msg = ex.Message.ToString.Replace("'", "")
RadAjaxManager1.ResponseScripts.Add("alert('" + Msg + "');")
End Try
End Sub
Protected Sub ajaxMsg_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles ajaxMsg.ItemDataBound
If TypeOf e.Item Is Telerik.Web.UI.GridFooterItem Then
If ajaxMsg.MasterTableView.Items.Count > 0 Then
If ajaxMsg.EditIndexes.Count > 0 OrElse ajaxMsg.MasterTableView.IsItemInserted Then
ajaxMsg.MasterTableView.SortExpressions.Clear()
' ajaxMsg.MasterTableView.AllowSorting = False
ajaxMsg.AllowSorting = False
Else
' ajaxMsg.MasterTableView.AllowSorting = True
ajaxMsg.AllowSorting = True
End If
Else
ajaxMsg.MasterTableView.SortExpressions.Clear()
ajaxMsg.MasterTableView.AllowSorting = False
If ajaxMsg.MasterTableView.NoMasterRecordsText = "" AndAlso Not ajaxMsg.MasterTableView.IsItemInserted Then
ajaxMsg.MasterTableView.NoMasterRecordsText = Resources.Resource.Search_Display
End If
End If
ElseIf TypeOf e.Item Is GridPagerItem Then
ajaxMsg.MasterTableView.PagerStyle.PagerTextFormat = "{2}{3}{4} " + Resources.Resource.Page + " {0} " + Resources.Resource.Pageof + " {1}"
Dim PageSizeCombo As RadComboBox
PageSizeCombo = CType(e.Item.FindControl("PageSizeComboBox"), RadComboBox)
PageSizeCombo.Visible = False
ElseIf TypeOf e.Item Is Telerik.Web.UI.GridDataItem AndAlso Not (ajaxMsg.EditIndexes.Count > 0 OrElse ajaxMsg.MasterTableView.IsItemInserted) Then
ajaxMsg.MasterTableView.NoMasterRecordsText = Resources.Resource.Search_Display
ajaxMsg.MasterTableView.AllowSorting = True
Dim commandItem As GridCommandItem
commandItem = CType(ajaxMsg.MasterTableView.GetItems(Telerik.Web.UI.GridItemType.CommandItem)(0), GridCommandItem)
commandItem.FindControl("ExportToCsvButton").Visible = True
End If
End Sub
Hello all,
From the beginning I am in a fight with FormDecorator.
He doesn’t do what I want him to do.
I have a simple example
A FormDecorator with 2 Telerik controls and a Windows Button.
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
telerik:RadFormDecorator
ID
=
"RadFormDecorator1"
runat
=
"server"
Skin
=
"Simple"
DecoratedControls
=
"All"
/>
<
telerik:RadTabStrip
ID
=
"RadTabStrip1"
runat
=
"server"
>
<
Tabs
>
<
telerik:RadTab
runat
=
"server"
Text
=
"Root RadTab1"
>
</
telerik:RadTab
>
<
telerik:RadTab
runat
=
"server"
Text
=
"Root RadTab2"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
telerik:RadButton
ID
=
"RadButton1"
runat
=
"server"
Text
=
"Telerik Button"
>
</
telerik:RadButton
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"ASP Button"
/>
</
form
>
On the normal Button it’s working but on the other controls it doesn't
I have followed some examples but everything is very straight forward so what I am missing here?
Best regards,
Marco