<
div
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager2"
runat
=
"server"
ClientEvents-OnRequestStart
=
"conditionalPostback"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"rgInquiry"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"rgInquiry"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock2"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
//
<![CDATA[
//On insert and update buttons click temporarily disables ajax to perform upload actions
function conditionalPostback(sender, eventArgs) {
var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
if (eventArgs.get_eventTarget().match(theRegexp)) {
var upload = $find(window['UploadId']);
//AJAX is disabled only if file is selected for upload
if (upload.getFileInputs()[0].value != "") {
eventArgs.set_enableAjax(false);
}
}
}
function validateRadUpload(source, e) {
e.IsValid = false;
var upload = $find(source.parentNode.getElementsByTagName('div')[0].id);
var inputs = upload.getFileInputs();
for (var i = 0; i < inputs.length; i++) {
//check for empty string or invalid extension
if (inputs[i].value != " " && upload.isExtensionValid(inputs[i].value)) {
e.IsValid = true;
break;
}
}
}
// ]]>
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel2"
runat
=
"server"
/>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AutoGenerateColumns
=
"False"
AllowSorting
=
"True"
AllowPaging
=
"True"
PageSize
=
"10"
GridLines
=
"None"
OnUpdateCommand
=
"rgInquiry_ItemUpdated"
OnItemCommand
=
"rgInquiry_ItemCommand"
OnDeleteCommand
=
"rgInquiry_ItemDeleted"
OnCancelCommand
=
"rgInquiry_CancelCommand"
OnInsertCommand
=
"rgInquiry_ItemInserted"
AllowFilteringByColumn
=
"true"
OnNeedDataSource
=
"rgInquiry_NeedDataSource"
OnItemDataBound
=
"rgInquiry_ItemDataBound"
OnItemCreated
=
"rgInquiry_ItemCreated"
>
<
MasterTableView
CommandItemDisplay
=
"Top"
DataKeyNames
=
"InquiryID"
AllowMultiColumnSorting
=
"True"
GroupLoadMode
=
"Server"
CommandItemSettings-AddNewRecordText
=
"Add New Inquiry"
>
<
Columns
>
</
Columns
>
<
EditFormSettings
ColumnNumber
=
"2"
CaptionFormatString
=
"Add/Edit properties of Inquiry : "
EditFormType
=
"Template"
>
<
FormTemplate
>
<
div
>
<
telerik:RadComboBox
ID
=
"rcbClientNew"
runat
=
"server"
Width
=
"300px"
EmptyMessage
=
"Select Client"
DataTextField
=
"ClientID"
Filter
=
"Contains"
AllowCustomText
=
"true"
AutoPostBack
=
"true"
OnSelectedIndexChanged
=
"rcbClient_SelectIndexChanged"
CausesValidation
=
"false"
>
</
telerik:RadComboBox
>
<
asp:Label
ID
=
"lblClientName"
SkinID
=
"LabelU"
runat
=
"server"
>
<
br
/>
<
asp:Label
ID
=
"Label1"
SkinID
=
"LabelU"
runat
=
"server"
Text
=
"Attach File: "
> </
asp:Label
>
<
telerik:RadProgressManager
ID
=
"radProgreesManager1"
runat
=
"server"
EnableTheming
=
"true"
/>
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"AsyncUpload1"
MultipleFileSelection
=
"Automatic"
>
</
telerik:RadAsyncUpload
>
<
telerik:RadProgressArea
ID
=
"radProgressArea1"
runat
=
"server"
EnableTheming
=
"true"
>
</
telerik:RadProgressArea
>
<
br
/>
<
div
class
=
"DynButton"
>
<
asp:Button
ID
=
"btnParentSubmit"
runat
=
"server"
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />
</
div
>
<
div
class
=
"DynButton"
>
<
asp:Button
ID
=
"btnPatentReset"
runat
=
"server"
Text
=
"Cancel"
CausesValidation
=
"false"
CommandName
=
"Cancel"
/>
</
div
>
</
div
>
</
FormTemplate
>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
div
>
We are using Version 2010.3.121735 of the RAD Controls. According to “What's New in RadScheduler for ASP.NET AJAX Q1 SP2 “ there is get_height / set_height property available.
What's New in RadScheduler for ASP.NET AJAX Q1 SP2 2009 (Version Number 2009.1.527)
However, it only seems to work in IE and not other browse; which is a must have for our web application. The following code shows that the change occurs in IE, but not other browsers.
var splitter = $find("<%= RadSplitter1.ClientID %>");
var scheduler = $find("<%=RadScheduler1.ClientID%>");
alert("splitter.get_height = " + splitter.get_height());
scheduler.set_height(splitter.get_height());
alert("scheduler.get_height = " + scheduler.get_height())
In IE the alert displays the correct value; however in other browsers it displays a value that was set by the height attribute of the scheduler .
<telerik:RadScheduler runat="server" ID="RadScheduler1" Height="425px" …
How do we dynamically set the height client-side on all browsers?
Thanks in advance,
Keith E.
In the Telerik Recurrence Editor control I want to hide "No End Date" while leaving "End After" and "End By". I can't allow my clients the ability to make recurring reservations with no end date.
I was able to hide the option button by finding the id of the control but there is no id for the label of that option button. So, I can hide the radio button but not the label for it.
Can anyone provide some code for this?
One work around would be to validate that the No End Date option is not selected after post back but I'd rather not do that.
Thanks,
Rob
Protected
Sub
btn_ModifyPerms_Click(sender
As
Object
, e
As
System.EventArgs)
For
Each
grdItem
As
GridDataItem
In
rgd_TaskPermissions.Items
Dim
cbx_Select
As
CheckBox =
DirectCast
(grdItem.FindControl(
"cbx_Select"
), CheckBox)
'Do Something
If
cbx_Select.Checked =
False
Then
Session(
"PermSelect"
) = 0
Else
Session(
"PermSelect"
) = 1
End
If
Dim
DatabaseName
As
String
= Session(
"DBName"
)
Dim
Table
As
String
= Session(
"Table"
)
Dim
TaskRole
As
String
= Session(
"TaskRole"
)
Dim
connectionString =
New
SqlConnection(
"server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;"
)
Dim
command =
New
SqlCommand(
"aa_task_table_permissions_select"
, connectionString)
command.CommandType = CommandType.StoredProcedure
command.Parameters.Add(
"@dbname"
, SqlDbType.VarChar).Value = DatabaseName
command.Parameters.Add(
"@Table"
, SqlDbType.VarChar).Value = Table
command.Parameters.Add(
"@TaskRole"
, SqlDbType.VarChar).Value = Session(
"TaskRole"
)
command.Parameters.Add(
"@PermSelect"
, SqlDbType.Int).Value = Session(
"PermSelect"
)
command.Connection.Open()
command.ExecuteNonQuery()
command.Connection.Close()
Next
End
Sub
AddNewRecordText for my grid
what do?
<
telerik:GridTemplateColumn
DataField
=
"Qty"
DataType
=
"System.Decimal"
HeaderText
=
"Qty"
SortExpression
=
"Qty"
UniqueName
=
"Qty"
>
<
EditItemTemplate
>
<
telerik:RadNumericTextBox
Width
=
"40px"
MinValue
=
"0"
MaxValue
=
"9999999.99"
Type
=
"Number"
ID
=
"QtyTextBox"
Text='<%# Bind("Qty") %>' InvalidStyleDuration="1000" NumberFormat-DecimalDigits="2"
runat="server" MaxLength="20">
<
ClientEvents
OnLoad
=
"RemoveZeros"
OnBlur
=
"RemoveZeros"
OnValueChanged
=
"RemoveZeros"
/>
</
telerik:RadNumericTextBox
>
<
asp:RangeValidator
ID
=
"rngQty"
runat
=
"server"
ControlToValidate
=
"QtyTextBox"
ErrorMessage="<br />Must be a number"
Display="Dynamic" MinimumValue="0" MaximumValue="999999999" Type="Double"></
asp:RangeValidator
>
<
asp:RequiredFieldValidator
ID
=
"reqQty"
ControlToValidate
=
"QtyTextBox"
runat
=
"server"
Display
=
"Dynamic"
ErrorMessage="<br />A quantity is required."></
asp:RequiredFieldValidator
>
</
EditItemTemplate
>
<
ItemTemplate
>
<
asp:Label
ID
=
"QtyLabel"
runat
=
"server"
Text='<%# FormatDecimalWithoutUnusedDecimals( Eval("Qty")) %>'></
asp:Label
>
</
ItemTemplate
>
<
ItemStyle
Width
=
"55px"
/>
<
HeaderStyle
Width
=
"55px"
/>
<
FooterStyle
HorizontalAlign
=
"Right"
/>
<
FooterTemplate
>
</
FooterTemplate
>
</
telerik:GridTemplateColumn
>
Protected
Sub
RadGrid1_ItemCommand(
ByVal
source
As
Object
, _
ByVal
e
As
Telerik.Web.UI.GridCommandEventArgs) _
Handles
RadGrid1.ItemCommand
Dim
newValues
As
New
Hashtable
If
e.CommandName =
"UpdateAll"
Then
UpdateShipment(
Nothing
,
Nothing
)
For
Each
editedItem
As
GridEditableItem
In
RadGrid1.EditItems
e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)
Dim
QtyTextBox
As
RadNumericTextBox
QtyTextBox =
CType
(editedItem(
"Qty"
).FindControl(
"QtyTextBox"
), RadNumericTextBox)
UpdateRowValue(newValues)
Next
RadGrid1.EditIndexes.Clear()
RadGrid1.Rebind()
End
If
End
Sub
function
RemoveZeros(sender, args) {
var
tbValue = sender._textBoxElement.value;
if
(tbValue.indexOf(
".00"
) != -1)
sender._textBoxElement.value = tbValue.substr(0, tbValue.indexOf(
".00"
));
}
<
meta http-equiv="X-UA-Compatible" content="IE=7" /> tag on the page, but thats not really an acceptable solution.
thanks for any suggestions.
peter