I've been using a RadNumericTextBox to fix a min and max values for sizing a div.
Control
<Telerik:RadNumericTextBox ID="txtHeight" runat="server" MinValue="0" MaxValue="128" NumberFormat-DecimalDigits="0" onchange="setHeight();"></Telerik:RadNumericTextBox>
JS function
function setHeight() {
$("#div1").css("height", $("[id$=txtHeight]").val());
}
DIV
<div id="div1" style="border:1px solid black;"></div>
Everything works well, but when I input the value of 500 inside the txtHeight then lost the focus, the RAD control fix the max value to 128 but the div has been already change the height to 500px and it's not refreshed. I put a button to refresh the value of the div but what I really want is to set it in the change or blur client side event of the textbox. If not, it could be seen as a bug. So how can I do to set the div size after the RADControl does the change value to maximum value set?
Hi,
I am having problem when adding filter on Radgrid. When I add a filter the Radgrid generates this error: Collection was modified; enumeration operation may not execute. But when I remove the filter the Radgrid works. Below is my Radgrid code. Please help.
<
telerik:RadGrid
AutoGenerateColumns
=
"False"
ID
=
"RadGrid1"
DataSourceID
=
"SqlDataSource1"
Skin
=
"WebBlue"
AllowFilteringByColumn
=
"True"
AllowSorting
=
"True"
PageSize
=
"15"
OnItemDataBound
=
"OnItemDataBoundHandler"
OnUpdateCommand
=
"RadGrid1_UpdateCommand"
ShowFooter
=
"True"
AllowPaging
=
"True"
runat
=
"server"
GridLines
=
"None"
EnableLinqExpressions
=
"False"
CellSpacing
=
"0"
>
<
MasterTableView
Width
=
"100%"
DataSourceID
=
"SqlDataSource1"
HorizontalAlign
=
"NotSet"
AutoGenerateColumns
=
"False"
DataKeyNames
=
"IdCol"
AllowFilteringByColumn
=
"True"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
></
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
Created
=
"True"
></
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn"
>
<
ItemStyle
CssClass
=
"MyImageButton"
></
ItemStyle
>
</
telerik:GridEditCommandColumn
>
<
telerik:GridBoundColumn
DataField
=
"idCol"
DataType
=
"System.Int64"
FilterControlAltText
=
"Filter idCol column"
HeaderText
=
"idCol"
ReadOnly
=
"True"
SortExpression
=
"idCol"
UniqueName
=
"idCol"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"bondNo"
FilterControlAltText
=
"Filter bondNo column"
HeaderText
=
"bondNo"
SortExpression
=
"bondNo"
UniqueName
=
"bondNo"
EditFormColumnIndex
=
"0"
CurrentFilterFunction
=
"Contains"
AutoPostBackOnFilter
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridDropDownColumn
DataSourceID
=
"SqlDataSource3"
DataField
=
"transporter"
ListTextField
=
"transportername"
ListValueField
=
"transportername"
UniqueName
=
"transporter"
SortExpression
=
"transporter"
HeaderText
=
"transporter"
DropDownControlType
=
"DropDownList"
EditFormColumnIndex
=
"1"
>
</
telerik:GridDropDownColumn
>
<
telerik:GridBoundColumn
DataField
=
"GRN"
ReadOnly
=
"True"
FilterControlAltText
=
"Filter GRN column"
HeaderText
=
"GRN"
SortExpression
=
"GRN"
UniqueName
=
"GRN"
EditFormColumnIndex
=
"3"
>
</
telerik:GridBoundColumn
>
<
telerik:GridNumericColumn
DataField
=
"numberOfUnits"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter numberOfUnits column"
HeaderText
=
"numberOfUnits"
SortExpression
=
"numberOfUnits"
UniqueName
=
"numberOfUnits"
EditFormColumnIndex
=
"3"
>
</
telerik:GridNumericColumn
>
<
telerik:GridHyperLinkColumn
AllowSorting
=
"False"
DataNavigateUrlFields
=
"idcol"
DataNavigateUrlFormatString
=
"PrintGRN.aspx?id={0}&reprint=yes"
FilterControlAltText
=
"Filter column column"
Text
=
"Reprint"
UniqueName
=
"column"
ItemStyle-Font-Underline
=
"true"
>
<
ItemStyle
Font-Underline
=
"True"
>
</
ItemStyle
>
</
telerik:GridHyperLinkColumn
>
</
Columns
>
</
telerik:RadGrid
>
have a radgrid with a nested radgrid containing child records. Everything works ok for purposes of data retrieval. Nested radgrid has in-place editing for data. When I click the edit button, the child grid disappears, leaving just the master grid in edit mode. Example shown in pic1 attached. When I click the pencil on any of the child records, that whole section disappears and the "update/cancel" buttons move up immediately under the wac pricing.
Code attached. Would like to know what I'm doing wrong, or, what I need to adjust to make it work. Thanks.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Products.aspx.cs" Inherits="CIPAS.Web.Admin.Products" MasterPageFile="../Startup/CIPAS.Master" %>
<
asp:Content
runat
=
"server"
ContentPlaceHolderID
=
"body"
>
<
telerik:RadAjaxManagerProxy
ID
=
"RadAjaxManagerProxy1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid_Products"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid_Products"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid_WAC"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid_AMP"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid_BAS"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid_CMS"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManagerProxy
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_Form"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:CIPAS.Web.Properties.Settings.CIPASCS %>" SelectCommand="SELECT * FROM sysComboBoxValues WHERE ComboBox = 'FM' OR ComboBox = '' ORDER BY Code ASC" />
<
asp:SqlDataSource
ID
=
"SqlDataSource_UOM"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:CIPAS.Web.Properties.Settings.CIPASCS %>" SelectCommand="SELECT * FROM sysComboBoxValues WHERE ComboBox = 'UM' OR ComboBox = '' ORDER BY Code ASC" />
<
asp:SqlDataSource
ID
=
"SqlDataSource_Products"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:CIPAS.Web.Properties.Settings.CIPASCS %>"
InsertCommand="INSERT INTO ProductAdministration_Products (RowGUID_Key, NDC, NDC2, Name, Form_GUID, UOM_GUID, UnitsPerPackage, ApprovalDate, IntroductionDate, TerminationDate, ProductCode, Finance_ProductCode, UpdatedOn, UpdatedBy, sysRevision) VALUES (NEWID(), @NDC, @NDC2, @Name, @Form_GUID, @UOM_GUID, @UnitsPerPackage, @ApprovalDate, @IntroductionDate, @TerminationDate, @ProductCode, @Finance_ProductCode, GETDATE(), dbo.udf_GetEmployeeGUID(SUSER_NAME()), 0)"
SelectCommand="SELECT * FROM ProductAdministration_Products"
UpdateCommand="UPDATE ProductAdministration_Products SET NDC = @NDC, NDC2 = @NDC2, Name = @Name, Form_GUID = @Form_GUID, UOM_GUID = @UOM_GUID, UnitsPerPackage = @UnitsPerPackage, ApprovalDate = @ApprovalDate, IntroductionDate = @IntroductionDate, TerminationDate = @TerminationDate, ProductCode = @ProductCode, Finance_ProductCode = @Finance_ProductCode, UpdatedOn = GETDATE(), UpdatedBy = dbo.udf_GetEmployeeGUID(SUSER_NAME()), sysRevision = sysRevision + 1 WHERE RowGUID_Key = @RowGUID_Key" >
<
InsertParameters
>
<
asp:Parameter
Name
=
"NDC"
/>
<
asp:Parameter
Name
=
"NDC2"
/>
<
asp:Parameter
Name
=
"Name"
/>
<
asp:Parameter
Name
=
"Form_GUID"
/>
<
asp:Parameter
Name
=
"UOM_GUID"
/>
<
asp:Parameter
Name
=
"UnitsPerPackage"
/>
<
asp:Parameter
Name
=
"ApprovalDate"
/>
<
asp:Parameter
Name
=
"IntroductionDate"
/>
<
asp:Parameter
Name
=
"TerminationDate"
/>
<
asp:Parameter
Name
=
"ProductCode"
/>
<
asp:Parameter
Name
=
"Finance_ProductCode"
/>
</
InsertParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"NDC"
/>
<
asp:Parameter
Name
=
"NDC2"
/>
<
asp:Parameter
Name
=
"Name"
/>
<
asp:Parameter
Name
=
"Form_GUID"
/>
<
asp:Parameter
Name
=
"UOM_GUID"
/>
<
asp:Parameter
Name
=
"UnitsPerPackage"
/>
<
asp:Parameter
Name
=
"ApprovalDate"
/>
<
asp:Parameter
Name
=
"IntroductionDate"
/>
<
asp:Parameter
Name
=
"TerminationDate"
/>
<
asp:Parameter
Name
=
"ProductCode"
/>
<
asp:Parameter
Name
=
"Finance_ProductCode"
/>
<
asp:Parameter
Name
=
"RowGUID_Key"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_WAC"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:CIPAS.Web.Properties.Settings.CIPASCS %>" >
<
DeleteParameters
>
<
asp:Parameter
Name
=
"RowGUID_Key"
/>
</
DeleteParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"EffectiveDate"
/>
<
asp:Parameter
Name
=
"StartDate"
/>
<
asp:Parameter
Name
=
"EndDate"
/>
<
asp:Parameter
Name
=
"Price"
/>
</
InsertParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"EffectiveDate"
/>
<
asp:Parameter
Name
=
"StartDate"
/>
<
asp:Parameter
Name
=
"EndDate"
/>
<
asp:Parameter
Name
=
"Price"
/>
<
asp:Parameter
Name
=
"RowGUID_Key"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_AMP"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:CIPAS.Web.Properties.Settings.CIPASCS %>" />
<
asp:SqlDataSource
ID
=
"SqlDataSource_BAS"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:CIPAS.Web.Properties.Settings.CIPASCS %>" />
<
asp:SqlDataSource
ID
=
"SqlDataSource_CMS"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:CIPAS.Web.Properties.Settings.CIPASCS %>" />
<
telerik:RadGrid
ID
=
"RadGrid_Products"
runat
=
"server"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
GridLines
=
"None"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
DataSourceID
=
"SqlDataSource_Products"
OnItemCommand
=
"RadGrid_Products_ItemCommand"
OnItemDataBound
=
"RadGrid_Products_ItemDataBound"
>
<
MasterTableView
DataKeyNames
=
"RowGUID_Key"
EditMode
=
"PopUp"
commanditemdisplay
=
"Bottom"
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn_Products"
/>
<
telerik:GridBoundColumn
DataField
=
"Name"
FilterControlAltText
=
"Filter Name column"
HeaderText
=
"Name"
SortExpression
=
"Name"
UniqueName
=
"Name"
ItemStyle-Width
=
"70%"
/>
<
telerik:GridBoundColumn
DataField
=
"NDC"
FilterControlAltText
=
"Filter NDC column"
HeaderText
=
"NDC"
SortExpression
=
"NDC"
UniqueName
=
"NDC"
ItemStyle-Width
=
"10%"
/>
<
telerik:GridBoundColumn
DataField
=
"NDC2"
FilterControlAltText
=
"Filter NDC2 column"
HeaderText
=
"NDC2"
SortExpression
=
"NDC2"
UniqueName
=
"NDC2"
ItemStyle-Width
=
"10%"
/>
</
Columns
>
<
EditFormSettings
EditColumn-UniqueName
=
"EditCommandColumn_Products"
EditFormType
=
"Template"
CaptionDataField
=
"Name"
PopUpSettings-ScrollBars
=
"Auto"
PopUpSettings-Modal
=
"True"
PopUpSettings-Height
=
"768px"
PopUpSettings-Width
=
"1024px"
PopUpSettings-ShowCaptionInEditForm
=
"true"
>
<
FormTemplate
>
<
table
width
=
"100%"
>
<
tr
>
<
td
width
=
"10%"
align
=
"right"
>
Name:
</
td
>
<
td
colspan
=
"3"
>
<
telerik:RadTextBox
ID
=
"RadTextBox_Name"
runat
=
"server"
width
=
"100%"
Text='<%# Bind("Name" ) %>' />
</
td
>
</
tr
>
<
tr
>
<
td
width
=
"10%"
align
=
"right"
>
NDC:
</
td
>
<
td
width
=
"40%"
>
<
telerik:RadTextBox
ID
=
"RadTextBox_NDC"
runat
=
"server"
width
=
"100%"
Text='<%# Bind("NDC" ) %>' />
</
td
>
<
td
width
=
"10%"
align
=
"right"
>
Approval Date:
</
td
>
<
td
width
=
"40%"
>
<
telerik:RadDateInput
ID
=
"RadDateInput_ApprovalDate"
runat
=
"server"
Width
=
"100%"
DBSelectedDate='<%# Bind("ApprovalDate" ) %>' />
</
td
>
</
tr
>
<
tr
>
<
td
width
=
"10%"
align
=
"right"
>
NDC2:
</
td
>
<
td
width
=
"40%"
>
<
telerik:RadTextBox
ID
=
"RadTextBox_NDC2"
runat
=
"server"
width
=
"100%"
Text='<%# Bind("NDC2" ) %>' />
</
td
>
<
td
width
=
"10%"
align
=
"right"
>
Intro Date:
</
td
>
<
td
width
=
"40%"
>
<
telerik:RadDateInput
ID
=
"RadDateInput_IntroDate"
runat
=
"server"
Width
=
"100%"
DBSelectedDate='<%# Bind("IntroductionDate" ) %>' />
</
td
>
</
tr
>
<
tr
>
<
td
width
=
"10%"
align
=
"right"
>
Form:
</
td
>
<
td
width
=
"40%"
>
<
telerik:RadComboBox
ID
=
"RadComboBox_Form"
runat
=
"server"
width
=
"100%"
DataSourceID
=
"SqlDataSource_Form"
DataTextField
=
"Code"
DataValueField
=
"RowGUID_Key"
SelectedValue='<%# Bind("Form_GUID" ) %>' />
</
td
>
<
td
width
=
"10%"
align
=
"right"
>
Term Date:
</
td
>
<
td
width
=
"40%"
>
<
telerik:RadDateInput
ID
=
"RadDateInput_TermDate"
runat
=
"server"
Width
=
"100%"
DbSelectedDate='<%# Bind("TerminationDate" ) %>' />
</
td
>
</
tr
>
<
tr
>
<
td
width
=
"10%"
align
=
"right"
>
UOM:
</
td
>
<
td
width
=
"40%"
>
<
telerik:RadComboBox
ID
=
"RadComboBox_UOM"
runat
=
"server"
width
=
"100%"
DataSourceID
=
"SqlDataSource_UOM"
DataTextField
=
"Code"
DataValueField
=
"RowGUID_Key"
SelectedValue='<%# Bind("UOM_GUID" ) %>' />
</
td
>
<
td
width
=
"10%"
align
=
"right"
>
Units/Pkg:
</
td
>
<
td
width
=
"40%"
>
<
telerik:RadNumericTextBox
ID
=
"RadNumericTextBox_UnitsPerPkg"
runat
=
"server"
Width
=
"100%"
Text='<%# Bind("UnitsPerPackage" ) %>' />
</
td
>
</
tr
>
<
tr
>
<
td
width
=
"10%"
align
=
"right"
>
Product Code:
</
td
>
<
td
width
=
"40%"
>
<
telerik:RadTextBox
ID
=
"RadTextBox_ProductCode"
runat
=
"server"
width
=
"100%"
Text='<%# Bind("ProductCode" ) %>' />
</
td
>
<
td
width
=
"10%"
align
=
"right"
>
Finance Product Code:
</
td
>
<
td
width
=
"40%"
>
<
telerik:RadTextBox
ID
=
"RadTextBox_FinanceProductCode"
runat
=
"server"
width
=
"100%"
Text='<%# Bind("Finance_ProductCode" ) %>' />
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"4"
>
<
telerik:RadTabStrip
ID
=
"RadTabStrip_Pricing"
runat
=
"server"
Width
=
"100%"
MultiPageID
=
"RadMultiPage_Pricing"
SelectedIndex
=
"0"
>
<
Tabs
>
<
telerik:RadTab
runat
=
"server"
Text
=
"WAC Pricing"
Selected
=
"true"
/>
<
telerik:RadTab
runat
=
"server"
Text
=
"AMP Pricing"
/>
<
telerik:RadTab
runat
=
"server"
Text
=
"BAS Pricing"
/>
<
telerik:RadTab
runat
=
"server"
Text
=
"CMS Pricing"
/>
</
Tabs
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
ID
=
"RadMultiPage_Pricing"
runat
=
"server"
SelectedIndex
=
"0"
>
<
telerik:RadPageView
ID
=
"RadPageView_WAC"
runat
=
"server"
>
<
telerik:RadGrid
ID
=
"Inherit"
DataKeyNames
=
"RowGUID_Key"
DataSourceID
=
"SqlDataSource_WAC"
Width
=
"100%"
runat
=
"server"
Name
=
"WAC"
OnItemCommand
=
"Inherit_ItemCommand"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
GridLines
=
"None"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
>
<
MasterTableView
DataSourceID
=
"SqlDataSource_WAC"
DataKeyNames
=
"RowGUID_Key, Product_GUID"
EditMode
=
"InPlace"
CommandItemDisplay
=
"TopAndBottom"
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
DetailKeyField
=
"Product_GUID"
MasterKeyField
=
"RowGUID_Key"
/>
</
ParentTableRelation
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn_WAC"
/>
<
telerik:GridBoundColumn
DataField
=
"EffectiveDate"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter EffectiveDate column"
HeaderText
=
"EffectiveDate"
SortExpression
=
"EffectiveDate"
UniqueName
=
"EffectiveDate"
DataFormatString
=
"{0:d}"
/>
<
telerik:GridBoundColumn
DataField
=
"StartDate"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter StartDate column"
HeaderText
=
"StartDate"
SortExpression
=
"StartDate"
UniqueName
=
"StartDate"
DataFormatString
=
"{0:d}"
/>
<
telerik:GridBoundColumn
DataField
=
"EndDate"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter EndDate column"
HeaderText
=
"EndDate"
SortExpression
=
"EndDate"
UniqueName
=
"EndDate"
DataFormatString
=
"{0:d}"
/>
<
telerik:GridBoundColumn
DataField
=
"Price"
DataType
=
"System.Decimal"
FilterControlAltText
=
"Filter Price column"
HeaderText
=
"Price"
SortExpression
=
"Price"
UniqueName
=
"Price"
DataFormatString
=
"{0:C2}"
/>
</
Columns
>
<
EditFormSettings
EditColumn-UniqueName
=
"EditCommandColumn_WAC"
EditColumn-ButtonType
=
"ImageButton"
EditFormType
=
"AutoGenerated"
/>
</
MasterTableView
>
</
telerik:RadGrid
>
</
telerik:RadPageView
>
<
telerik:RadPageView
ID
=
"RadPageView_AMP"
runat
=
"server"
>
</
telerik:RadPageView
>
<
telerik:RadPageView
ID
=
"RadPageView_BAS"
runat
=
"server"
>
</
telerik:RadPageView
>
<
telerik:RadPageView
ID
=
"RadPageView_CMS"
runat
=
"server"
>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"4"
>
<
br
/>
<
asp:Button
ID
=
"btnUpdate"
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'/>
<
asp:Button
ID
=
"btnCancel"
Text
=
"Cancel"
runat
=
"server"
CausesValidation
=
"False"
CommandName
=
"Cancel"
/>
</
td
>
</
tr
>
</
table
>
</
FormTemplate
>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
asp:Content
>
<
telerik:RadGrid
ID
=
"GridMedical"
runat
=
"server"
ShowStatusBar
=
"True"
OnPreRender
=
"RadGrid1_PreRender"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
AutoGenerateColumns
=
"False"
PageSize
=
"20"
AllowSorting
=
"True"
AllowAutomaticInserts
=
"False"
AllowPaging
=
"True"
AllowAutomaticDeletes
=
"False"
AllowAutomaticUpdates
=
"False"
Width
=
"835px"
FilterType
=
"CheckedList"
AllowFilteringByColumn
=
"True"
GridLines
=
"None"
CellSpacing
=
"0"
>
<
ExportSettings
>
<
Pdf
>
<
PageHeader
>
<
LeftCell
Text
=
""
/>
<
MiddleCell
Text
=
""
/>
<
RightCell
Text
=
""
/>
</
PageHeader
>
<
PageFooter
>
<
LeftCell
Text
=
""
/>
<
MiddleCell
Text
=
""
/>
<
RightCell
Text
=
""
/>
</
PageFooter
>
</
Pdf
>
</
ExportSettings
>
<
MasterTableView
InsertItemDisplay
=
"Top"
InsertItemPageIndexAction
=
"ShowItemOnFirstPage"
DataKeyNames
=
"StudentID"
EditMode
=
"EditForms"
AutoGenerateColumns
=
"false"
AllowMultiColumnSorting
=
"False"
Width
=
"100%"
CommandItemDisplay
=
"Top"
Name
=
"medStudents"
>
<
CommandItemSettings
ShowExportToPdfButton
=
"true"
/>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
Visible
=
"True"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
Visible
=
"True"
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
SortExpression
=
"StudentID"
ShowFilterIcon
=
"false"
AllowFiltering
=
"false"
HeaderText
=
"#"
HeaderButtonType
=
"TextButton"
DataField
=
"StudentID"
UniqueName
=
"StudentID"
MaxLength
=
"7"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"StudentName"
HeaderText
=
"Name"
HeaderButtonType
=
"TextButton"
DataField
=
"StudentName"
UniqueName
=
"StudentName"
MaxLength
=
"40"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"Grade"
HeaderText
=
"Gr"
HeaderButtonType
=
"TextButton"
DataField
=
"Grade"
UniqueName
=
"Grade"
>
<
FilterTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboGrades"
runat
=
"server"
DataSourceID
=
"SqlDataSourceFilterGrades"
DataValueField
=
"Grd"
DataTextField
=
"Grd"
EmptyMessage
=
"All"
AllowCustomText
=
"true"
Width
=
"60px"
>
<
ItemTemplate
>
<
asp:CheckBox
runat
=
"server"
Checked
=
"true"
ID
=
"grades_chk1"
onclick
=
"onCheckBoxClickGrades(this)"
/>
<%# Eval("Grd")%>
</
ItemTemplate
>
<
FooterTemplate
>
<
asp:Button
ID
=
"clrFiltersGrades"
runat
=
"server"
Text
=
"Clear"
OnClick
=
"clrFiltersGrades_Click"
/>
</
FooterTemplate
>
</
telerik:RadComboBox
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock2"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function onCheckBoxClickGrades(chk) {
var text = "", values = "";
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
var combo = $find('<%# ((GridItem)Container).FindControl("RadComboGrades").ClientID %>');
//get the collection of all items
var items = combo.get_items();
//enumerate all items
for (var i = 0; i <
items.get_count
(); i++) {
var
item
=
items
.getItem(i);
//get the checkbox element of the current item
var chk1 = $get(combo.get_id() + "_i" + i + "_grades_chk1");
if (chk1.checked) {
text += item.get_text() + ",";
values += item.get_value() + ",";
}
}
//remove the last comma from the string
text
=
removeLastComma
(text);
values
=
removeLastComma
(values);
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Grades," + values);
}
function removeLastComma(str) {
return str.replace(/,$/, "");
}
</
script
>
</
telerik:RadScriptBlock
>
</
FilterTemplate
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"Class"
HeaderText
=
"Cl"
HeaderButtonType
=
"TextButton"
DataField
=
"Class"
UniqueName
=
"Class"
>
<
FilterTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboClasses"
runat
=
"server"
DataSourceID
=
"SqlDataSourceFilterGrades"
DataValueField
=
"Grd"
DataTextField
=
"Grd"
EmptyMessage
=
"All"
AllowCustomText
=
"true"
Width
=
"60px"
>
<
ItemTemplate
>
<
asp:CheckBox
runat
=
"server"
Checked
=
"true"
ID
=
"classes_chk1"
onclick
=
"onCheckBoxClickClasses(this)"
/>
<%# Eval("Grd")%>
</
ItemTemplate
>
<
FooterTemplate
>
<
asp:Button
ID
=
"clrFiltersClasses"
runat
=
"server"
Text
=
"Clear"
OnClick
=
"clrFiltersGrades_Click"
/>
</
FooterTemplate
>
</
telerik:RadComboBox
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock3"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function onCheckBoxClickClasses(chk) {
var text = "", values = "";
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
var combo = $find('<%# ((GridItem)Container).FindControl("RadComboClasses").ClientID %>');
//get the collection of all items
var items = combo.get_items();
//enumerate all items
for (var i = 0; i <
items.get_count
(); i++) {
var
item
=
items
.getItem(i);
//get the checkbox element of the current item
var chk1 = $get(combo.get_id() + "_i" + i + "_classes_chk1");
if (chk1.checked) {
text += item.get_text() + ",";
values += item.get_value() + ",";
}
}
//remove the last comma from the string
text
=
removeLastComma
(text);
values
=
removeLastComma
(values);
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Classes," + values);
}
function removeLastComma(str) {
return str.replace(/,$/, "");
}
</
script
>
</
telerik:RadScriptBlock
>
</
FilterTemplate
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"MedicalName"
HeaderText
=
"Issue"
HeaderButtonType
=
"TextButton"
DataField
=
"MedicalName"
UniqueName
=
"MedicalName"
>
<
FilterTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
=
"server"
DataSourceID
=
"SqlDataSourceFilterMedical"
DataValueField
=
"MedID"
DataTextField
=
"MedicalName"
EmptyMessage
=
"All"
AllowCustomText
=
"true"
Width
=
"90px"
>
<
ItemTemplate
>
<
asp:CheckBox
runat
=
"server"
Checked
=
"true"
ID
=
"chk1"
onclick
=
"onCheckBoxClick(this)"
/>
<%# Eval("MedicalName")%>
</
ItemTemplate
>
<
FooterTemplate
>
<
asp:Button
ID
=
"clrFilters"
runat
=
"server"
Text
=
"Clear"
OnClick
=
"clrFilters_Click"
/>
</
FooterTemplate
>
</
telerik:RadComboBox
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function onCheckBoxClick(chk) {
var text = "", values = "";
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
var combo = $find('<%# ((GridItem)Container).FindControl("RadComboBox1").ClientID %>');
//get the collection of all items
var items = combo.get_items();
//enumerate all items
for (var i = 0; i <
items.get_count
(); i++) {
var
item
=
items
.getItem(i);
//get the checkbox element of the current item
var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");
if (chk1.checked) {
text += item.get_text() + ",";
values += item.get_value() + ",";
}
}
//remove the last comma from the string
text
=
removeLastComma
(text);
values
=
removeLastComma
(values);
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("MedicalName," + values);
}
function removeLastComma(str) {
return str.replace(/,$/, "");
}
</
script
>
</
telerik:RadScriptBlock
>
</
FilterTemplate
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"MedLevel"
HeaderText
=
"Level"
HeaderButtonType
=
"TextButton"
DataField
=
"MedLevel"
UniqueName
=
"MedLevel"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"Notes"
HeaderText
=
"Notes"
HeaderButtonType
=
"TextButton"
DataField
=
"Notes"
UniqueName
=
"Notes"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"HospitalName"
HeaderText
=
"Hospital"
HeaderButtonType
=
"TextButton"
AllowFiltering
=
"false"
DataField
=
"HospitalName"
UniqueName
=
"HospitalName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"FileNumber"
HeaderText
=
"File #"
HeaderButtonType
=
"TextButton"
AllowFiltering
=
"false"
DataField
=
"FileNumber"
UniqueName
=
"FileNumber"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"PhoneNumber"
HeaderText
=
"Phone"
HeaderButtonType
=
"TextButton"
AllowFiltering
=
"false"
DataField
=
"PhoneNumber"
UniqueName
=
"PhoneNumber"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
BatchEditingSettings
EditType
=
"Cell"
/>
<
PagerStyle
AlwaysVisible
=
"True"
PageSizeControlType
=
"RadComboBox"
/>
</
MasterTableView
>
<
PagerStyle
AlwaysVisible
=
"True"
PageSizeControlType
=
"RadComboBox"
/>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SqlDataSourceFilterGrades"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:EduZeeRep.Properties.Settings.EschoolTestV3Reporting %>"
SelectCommand="SELECT DISTINCT CAST(Grade as int) AS Grd FROM AttStudents ORDER BY CAST(Grade as int) ASC">
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDataSourceFilterMedical"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:EduZeeRep.Properties.Settings.EschoolTestV3Reporting %>"
SelectCommand="SELECT DISTINCT MedID,MedicalName FROM EscMedicalIssues">
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDataSourceMedicalIssues"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:EduZeeRep.Properties.Settings.EschoolTestV3Reporting %>"
SelectCommand="SELECT AttStudents.EnName + ' ' + AttStudents.FamilyEnName AS StudentName, AttStudents.StudentID, EscMedicalIssues.MedicalName, AttStudents.Class,
AttStudents.Grade, EscMedicalLinks.MedLevel, EscMedicalLinks.HospitalName, EscMedicalLinks.FileNumber, EscMedicalLinks.PhoneNumber,
EscMedicalLinks.Notes
FROM AttStudents INNER JOIN
EscMedicalLinks ON AttStudents.StudentID = EscMedicalLinks.StudentID INNER JOIN
EscMedicalIssues ON EscMedicalLinks.MedID = EscMedicalIssues.MedID">
</
asp:SqlDataSource
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
OnAjaxRequest
=
"RadAjaxManager1_AjaxRequest"
>
<
ajaxsettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadAjaxManager1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"GridMedical"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"clrFilters"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"GridMedical"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
ajaxsettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
Skin
=
"Default"
/>
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
if (ViewState["filterRawString"] != null)
{
foreach (GridFilteringItem item in GridMedical.MasterTableView.GetItems(GridItemType.FilteringItem))
{
RadComboBox combo = (RadComboBox)item.FindControl("RadComboBox1");
foreach (RadComboBoxItem comboItem in combo.Items)
{
if (ViewState["filterRawString"].ToString().Contains(comboItem.Value.ToString()))
{
CheckBox chk = (CheckBox)comboItem.FindControl("chk1");
chk.Checked = true;
}
else
{
CheckBox chk = (CheckBox)comboItem.FindControl("chk1");
chk.Checked = false;
}
}
RadComboBox comboGrades = (RadComboBox)item.FindControl("RadComboBoxGrades");
foreach (RadComboBoxItem comboItemGrade in comboGrades.Items)
{
if (ViewState["filterRawString"].ToString().Contains(comboItemGrade.Value.ToString()))
{
CheckBox chk = (CheckBox)comboItemGrade.FindControl("grades_chk1");
chk.Checked = true;
}
else
{
CheckBox chk = (CheckBox)comboItemGrade.FindControl("grades_chk1");
chk.Checked = false;
}
}
}
}
}
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
string str = e.Argument.ToString();
DataSet _dsUs = new DataSet();
//String query = "SELECT usr.*, usr.FirstNameEn+' '+usr.FamilyNameEn AS EnglishName, dept.DepEn AS DepartID,dept.DepID AS DeparID,sub.SubEn,sub.SubID,ad.ADID, ad.ADEn,st.StageID,st.StageEn FROM AttUsers usr,AttStages st, AttAcademicalDegrees ad, AttDepartments dept, AttSubjects sub WHERE st.StageID=usr.Stage AND ad.ADID=usr.AcademicalDegree AND sub.SubID=usr.Subject AND usr.Department=dept.DepID AND sub.SubEn='" + str.Split(',')[1] +"'";
if (str.Split(',')[0] == "MedicalName")
{
String query = "SELECT AttStudents.EnName + ' ' + AttStudents.FamilyEnName AS StudentName, AttStudents.StudentID, EscMedicalIssues.MedicalName, AttStudents.Class, AttStudents.Grade, EscMedicalLinks.MedLevel, EscMedicalLinks.HospitalName, EscMedicalLinks.FileNumber, EscMedicalLinks.PhoneNumber, EscMedicalLinks.Notes FROM AttStudents INNER JOIN EscMedicalLinks ON AttStudents.StudentID = EscMedicalLinks.StudentID INNER JOIN EscMedicalIssues ON EscMedicalLinks.MedID = EscMedicalIssues.MedID WHERE EscMedicalIssues.MedID='" + str.Split(',')[1] + "'";
for (int i = 2; i < str.Split(',').Length; i++)
{
query = query + " OR EscMedicalIssues.MedID='" + str.Split(',')[i] + "'";
}
ViewState["filterRawString"] = str;
_dsUs = GetSQLDataSet(query);
GridMedical.DataSource = _dsUs.Tables[0];
GridMedical.Rebind();
GridFilteringItem filterItem = GridMedical.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
RadComboBox combo = (RadComboBox)filterItem.FindControl("RadComboBox1");
RadAjaxManager1.ResponseScripts.Add("$find('" + combo.ClientID + "').showDropDown();");
}
if (str.Split(',')[0] == "Grades")
{
String query = "SELECT AttStudents.EnName + ' ' + AttStudents.FamilyEnName AS StudentName, AttStudents.StudentID, EscMedicalIssues.MedicalName, AttStudents.Class, AttStudents.Grade, EscMedicalLinks.MedLevel, EscMedicalLinks.HospitalName, EscMedicalLinks.FileNumber, EscMedicalLinks.PhoneNumber, EscMedicalLinks.Notes FROM AttStudents INNER JOIN EscMedicalLinks ON AttStudents.StudentID = EscMedicalLinks.StudentID INNER JOIN EscMedicalIssues ON EscMedicalLinks.MedID = EscMedicalIssues.MedID WHERE AttStudents.Grade='" + str.Split(',')[1] + "'";
for (int i = 2; i < str.Split(',').Length; i++)
{
query = query + " OR AttStudents.Grade='" + str.Split(',')[i] + "'";
}
ViewState["filterRawString"] = str;
_dsUs = GetSQLDataSet(query);
GridMedical.DataSource = _dsUs.Tables[0];
GridMedical.Rebind();
GridFilteringItem filterItem = GridMedical.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
RadComboBox combo = (RadComboBox)filterItem.FindControl("RadComboBoxGrades");
RadAjaxManager1.ResponseScripts.Add("$find('" + combo.ClientID + "').showDropDown();");
}
}
protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
DataSet _dsUsrs = new DataSet();
_dsUsrs = GetSQLDataSet("SELECT AttStudents.EnName + ' ' + AttStudents.FamilyEnName AS StudentName, AttStudents.StudentID, EscMedicalIssues.MedicalName, AttStudents.Class, AttStudents.Grade, EscMedicalLinks.MedLevel, EscMedicalLinks.HospitalName, EscMedicalLinks.FileNumber, EscMedicalLinks.PhoneNumber, EscMedicalLinks.Notes FROM AttStudents INNER JOIN EscMedicalLinks ON AttStudents.StudentID = EscMedicalLinks.StudentID INNER JOIN EscMedicalIssues ON EscMedicalLinks.MedID = EscMedicalIssues.MedID");
if (ViewState["filterRawString"] == null)
{
GridMedical.DataSource = _dsUsrs.Tables[0];
}
}
protected void clrFilters_Click(object sender, EventArgs e)
{
foreach (GridColumn column in GridMedical.MasterTableView.Columns)
{
column.CurrentFilterFunction = GridKnownFunction.NoFilter;
column.CurrentFilterValue = string.Empty;
}
GridMedical.MasterTableView.FilterExpression = string.Empty;
GridMedical.MasterTableView.Rebind();
}
protected void clrFiltersGrades_Click(object sender, EventArgs e)
{
foreach (GridColumn column in GridMedical.MasterTableView.Columns)
{
column.CurrentFilterFunction = GridKnownFunction.NoFilter;
column.CurrentFilterValue = string.Empty;
}
GridMedical.MasterTableView.FilterExpression = string.Empty;
GridMedical.MasterTableView.Rebind();
}
We have a collapsible RadPanelBar which has a RadGrid and the PageIndex is only displayed in one of the following scenario but the PageIndex is not displayed in the other 2 scenarios. We were initially using RadControl 2010 Q3 which was working fine in all scenarios now we have upgraded to RadControl version 2013.3.1015.40.
Scenario 1: Build and run the project under Windows XP environment – IE 7 (localhost)
1 - Create RadPanelBar
2 - Create nested RadPanelItem under point 1
3 - Create nested RadPanelItem under point 2
4 - Create a RadGrid under point 3
The RadGrid is nested within the last RadPanelItem.
The RadPanelItem is collapsable which so RadGrid does.
The PageIndex on the RadGrid is displayed.
Scenario 2: Build and run the project under Windows 7 environment – IE 8 (localhost)
1 - Create RadPanelBar
2 - Create nested RadPanelItem under point 1
3 - Create nested RadPanelItem under point 2
4 - Create a RadGrid under point 3
The RadGrid is nested within the last RadPanelItem.
The RadPanelItem is collapsable which so RadGrid does.
The PageIndex on the RadGrid is missing.
Scenario 3: Deploy the project under Windows 2003 and 2008 server – open the webpage from IE7 and 8.
1 - Create RadPanelBar
2 - Create nested RadPanelItem under point 1
3 - Create nested RadPanelItem under point 2
4 - Create a RadGrid under point 3
The RadGrid is nested within the last RadPanelItem.
The RadPanelItem is collapsable which so RadGrid does.
The PageIndex on the RadGrid is missing.
Following is aspx code:
<
p
><
telerik:RadPanelBar
ID
=
"radPnlBrPrograms"
runat
=
"server"
Width
=
"100%"
Skin
=
"Vista"
>
<
Items
>
<
telerik:RadPanelItem
runat
=
"server"
Text
=
"In Planning"
>
<
Items
>
<
telerik:RadPanelItem
runat
=
"server"
Value
=
"radPnlOpenProg"
>
<
ItemTemplate
>
<
telerik:RadGrid
ID
=
"grdOpenProg"
runat
=
"server"
GridLines
=
"Both"
AllowPaging
=
"True"
AllowSorting="false" AutoGenerateColumns="false" ShowStatusBar="true"
AllowMultiRowSelection="False" AllowFilteringByColumn="false" Skin="Vista"
OnNeedDataSource="grdOpenProg_NeedDataSource"
Height="185px"
>
<
MasterTableView
PageSize
=
"5"
runat
=
"server"
AllowSorting
=
"false"
DataKeyNames="SP_ID" Name="GET_Win" NoMasterRecordsText="No open program found.">
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"SP_ID"
DataField
=
"SP_ID"
Visible
=
"false"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"ProgramNo"
DataField
=
"ProgramNo"
HeaderText
=
"Program No"
HeaderStyle-Width
=
"25%"
/>
<
telerik:GridBoundColumn
UniqueName
=
"SPR_Planned_Isolation_Date"
DataField
=
"Planned_Isolation_Date"
HeaderText
=
"Date Start"
HeaderStyle-Width
=
"25%"
/>
<
telerik:GridBoundColumn
UniqueName
=
"Site_Name"
DataField
=
"Site_Name"
HeaderText
=
"Site"
HeaderStyle-Width
=
"25%"
/>
<
telerik:GridBoundColumn
UniqueName
=
"Status_Name"
DataField
=
"Status_Name"
HeaderText
=
"Status"
HeaderStyle-Width
=
"25%"
/>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
EnableRowHoverStyle
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
/>
</
ClientSettings
>
<
PagerStyle
Mode
=
"NumericPages"
></
PagerStyle
>
</
telerik:RadGrid
>
</
ItemTemplate
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelBar
></
p
>
I'm having a problem where the controls on my popup EditForm are not rendering completely, even though they seem to be fully functional. The situation is much worst in IE than Firefox or Chrome but they both still have minor issues.
For example in IE, the date/time gadget on the right hand side of the controls are invisible but the mouse still changes to a 'hand' when hovering over the place they should be. After clicking, the dropdown calendar/time picker appears but has a transparent background. In Chrome or Firefox, almost everything looks OK except that the control tools in the edit box are monochrome.
I have attached images of screenshots from IE and Firefox plus cut down versions of my aspx and ascx code files. I would be grateful for any help you could give me.
<%@ Page Language="vb" CodeFile="Default.aspx.vb" AutoEventWireup="true" Inherits="Menu.Examples.Programming.ShowPath.DefaultVB" MasterPageFile="~/RAMTrack.master" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"Head"
runat
=
"Server"
>
<!--Page Header content-->
<!--
From Telerik Support Forum:
Title: Incorrect rendering of RadEditor
In case where RadEditor is initially hidden and displayed using AJAX is causing the
editor to render with incorrect width on the first show. This scenario applies for
RadGrid edit template, RadEditor inside a RadPageView, etc.
This problem occurs due to the fact that RadEditor CSS files are not fully loaded
when the editor calculates its’ toolbar size. To avoid this problem you need to
register the RadEditor’s CSS files manually on the page:
Since Q2 2011 you need to use the Telerik.Web.SkinRegistrar.GetWebResourceUrl() method:
-->
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock2"
runat
=
"server"
>
<
link
href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(Me, GetType(RadEditor), "Telerik.Web.UI.Skins.Editor.css") %>' rel="stylesheet" type="text/css" />
<
link
href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(Me, GetType(RadEditor), "Telerik.Web.UI.Skins.Default.Editor.Default.css") %>' rel="stylesheet" type="text/css" />
<
link
href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(Me, GetType(RadWindow), "Telerik.Web.UI.Skins.Window.css") %>' rel="stylesheet" type="text/css" />
<
link
href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(Me, GetType(RadWindow), "Telerik.Web.UI.Skins.Default.Window.Default.css") %>' rel="stylesheet" type="text/css" />
</
telerik:RadCodeBlock
>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"Body"
runat
=
"Server"
>
<!--Page Body content-->
<
telerik:RadScriptBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
// When the user double-clicks a row, then trigger the EditItem event
function RowDblClick(sender, eventArgs) {
sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
}
function refreshGrid(arg) {
__doPostBack("RefreshLogbook");
}
function OnClientPageLoad(sender, args) {
setTimeout(function () {
sender.set_status("");
}, 0);
}
</
script
>
</
telerik:RadScriptBlock
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
></
telerik:AjaxUpdatedControl
>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
>
</
telerik:RadAjaxLoadingPanel
>
<
telerik:RadSplitter
ID
=
"RadSplitter1"
Orientation
=
"Horizontal"
Width
=
"100%"
height
=
"100%"
runat
=
"server"
>
<!--Top Pane-->
<
telerik:RadPane
ID
=
"RadPane1"
Height
=
"25%"
runat
=
"server"
>
</
telerik:RadPane
>
<!--Horizontal split bar-->
<
telerik:RadSplitBar
ID
=
"RadSplitBar1"
CollapseMode
=
"Forward"
CollapseExpandPaneText
=
"Hide/Display Logbook Options"
runat
=
"server"
>
</
telerik:RadSplitBar
>
<!--Bottom Pane-->
<
telerik:RadPane
ID
=
"RadPane2"
Height
=
"75%"
runat
=
"server"
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
CssClass
=
"RadGrid"
GridLines
=
"None"
AllowPaging
=
"True"
PageSize
=
"5"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
ShowStatusBar
=
"True"
AllowAutomaticDeletes
=
"False"
AllowAutomaticInserts
=
"False"
AllowAutomaticUpdates
=
"True"
DataSourceID
=
"ds_Logbook"
EnableLinqExpressions
=
"False"
EnableEmbeddedSkins
=
"false"
Skin
=
"RAMTrackSkin_M"
>
<
MasterTableView
CommandItemDisplay
=
"None"
GridLines
=
"None"
DataSourceID
=
"ds_Logbook"
DataKeyNames
=
"Logbook_Id"
AllowFilteringByColumn
=
"True"
AllowSorting
=
"True"
TableLayout
=
"Fixed"
HeaderStyle-Wrap
=
"true"
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
PopUpSettings
Width
=
"600px"
Height
=
"400px"
Modal
=
"true"
/>
</
EditFormSettings
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
PageSizeLabelText
=
"Page Size: "
PageSizes
=
"5,10,15,25,50,100,250"
/>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"SessionNo"
HeaderText
=
"Session"
DataField
=
"SessionNo"
HeaderStyle-Width
=
"55px"
FilterControlWidth
=
"15px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridDateTimeColumn
FilterControlWidth
=
"120px"
DataField
=
"LogDate"
HeaderText
=
"Log Date"
SortExpression
=
"LogDate"
UniqueName
=
"LogDate"
PickerType
=
"DatePicker"
DataFormatString
=
"{0:D}"
EnableRangeFiltering
=
"true"
>
<
HeaderStyle
Width
=
"180px"
/>
</
telerik:GridDateTimeColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"ActivityCode"
HeaderText
=
"Activity Code"
DataField
=
"ActivityCode"
HeaderStyle-Width
=
"70px"
FilterControlWidth
=
"20px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"StartTime"
HeaderText
=
"Start Time"
DataField
=
"StartTime"
HeaderStyle-Width
=
"70px"
FilterControlWidth
=
"30px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"StopTime"
HeaderText
=
"Stop Time"
DataField
=
"StopTime"
HeaderStyle-Width
=
"70px"
FilterControlWidth
=
"30px"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
UserControlName
=
"WebUserControl.ascx"
EditFormType
=
"WebUserControl"
>
<
EditColumn
UniqueName
=
"WebUserControl1"
>
</
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
ClientSettings
>
<
ClientEvents
OnRowDblClick
=
"RowDblClick"
></
ClientEvents
>
</
ClientSettings
>
</
telerik:RadGrid
>
</
telerik:RadPane
>
</
telerik:RadSplitter
>
<!--Data Source, definition for Grid (Note: the dates are stored as floating point numbers, hence all the conversion) -->
<
asp:SqlDataSource
ID
=
"ds_Logbook"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:RAMtrack %>"
ProviderName="<%$ ConnectionStrings:RAMtrack.ProviderName %>"
SelectCommand="SELECT TOP (200)
Logbook_Id
,SessionNo
,convert(Datetime,LogDate, 103) as LogDate
,convert(nvarchar(10),convert(Datetime,StartTime, 103), 103) as StartDate
,convert(nvarchar(5),convert(Datetime,StartTime, 113), 108) as StartTime
,convert(nvarchar(10),convert(Datetime,StopTime, 103), 103) as StopDate
,convert(nvarchar(5),convert(Datetime,StopTime, 113), 108) as StopTime
,Activity_Id
,ProgComment
FROM tbl_LogBook
ORDER BY LogDate DESC">
<
SelectParameters
>
<
asp:Parameter
Name
=
"StartDate"
DefaultValue
=
"40909"
Type
=
"Decimal"
/>
<
asp:Parameter
Name
=
"EndDate"
DefaultValue
=
"90000"
Type
=
"Decimal"
/>
<
asp:SessionParameter
DefaultValue
=
"65"
Name
=
"Installation_Id"
SessionField
=
"Installation_Id"
Type
=
"Int64"
/>
</
SelectParameters
>
</
asp:SqlDataSource
>
<!--Data Source for drop-down on edit screen -->
<
asp:SqlDataSource
ID
=
"ds_ActivityCodes"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:RAMtrack %>"
ProviderName="<%$ ConnectionStrings:RAMtrack.ProviderName %>"
SelectCommand="SELECT
Activity_Id
,ActivityCode
,ActivityDescription
,ActivityCode + ' - ' + ActivityDescription as ActivityCodeDesc
FROM tbl_activities">
<
SelectParameters
>
<
asp:SessionParameter
DefaultValue
=
"2"
Name
=
"Installation_Id"
SessionField
=
"Installation_Id"
Type
=
"Int64"
/>
<
asp:Parameter
Name
=
"EventTypeAtStart"
DefaultValue
=
"0"
Type
=
"Int64"
/>
</
SelectParameters
>
</
asp:SqlDataSource
>
</
asp:Content
>
Default.aspx.vb
Imports System
Imports System.Collections.Generic
Imports Telerik.Web.UI
Namespace Menu.Examples.Programming.ShowPath
Partial Public Class DefaultVB
Inherits System.Web.UI.Page
Protected Sub RadGrid1_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
Dim filteringItem As GridFilteringItem
Dim literalTo As LiteralControl
Try
filteringItem = e.Item
If Not IsNothing(filteringItem) Then
literalTo = filteringItem("LogDate").Controls(3)
literalTo.Text = "<
br
/> To:"
End If
Catch ex As Exception
' It's OK, just carry on
End Try
End Sub
Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.PreRender
If (Not Page.IsPostBack) Then
' Set the edit mode to either a drop-down form or Pop Up form. Valid values are "EditForms" and "PopUp"
Me.RadGrid1.MasterTableView.EditMode = CType([Enum].Parse(GetType(GridEditMode), "PopUp"), GridEditMode)
Me.RadGrid1.Rebind()
End If
End Sub
End Class
End Namespace
WebUserControl.ascx (edit form)
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="WebUserControl.ascx.vb" Inherits="user_WebUserControl" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<
telerik:RadScriptBlock
runat
=
"server"
ID
=
"RadCodeBlock1"
>
<
script
type
=
"text/javascript"
>
var RadTimePicker1;
var RadTimePicker2;
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
function ConfirmCloseForm() {
//if (confirm('Closing the form will abandon any unsaved changes, OK to close?')) {
GetRadWindow().close();
//}
}
function CloseForm() {
GetRadWindow().close();
}
function ValidateStart(sender, args) {
var Date1 = new Date(dp_StartDate.get_selectedDate());
var Time1 = new Date(tp_StartTime.get_selectedDate());
args.IsValid = true;
if (Date1.getTime() <
1
) {
alert("The Start date is required");
args.IsValid
=
false
;
}
if (Time1.getTime() < 1) {
alert("The Start time is required");
args.IsValid
=
false
;
}
}
function ValidateTimes(sender, args) {
var
Date1
=
new
Date(dp_StartDate.get_selectedDate());
var
Date2
=
new
Date(dp_StopDate.get_selectedDate());
var
Time1
=
new
Date(tp_StartTime.get_selectedDate());
var
Time2
=
new
Date(tp_StopTime.get_selectedDate());
args.IsValid
=
true
;
if (Date2.getTime() < Date1.getTime()) {
alert("The Stop date and time should be greater than the Start time");
args.IsValid
=
false
;
}
else {
if ((Date2.getTime() == Date1.getTime()) && (Time2 < Time1)) {
alert("The Stop date and time should be greater than the Start time");
args.IsValid
=
false
;
}
}
}
function onLoadStartDate(sender, args) {
dp_StartDate
=
sender
;
}
function onLoadStartTime(sender, args) {
tp_StartTime
=
sender
;
}
function onLoadStopDate(sender, args) {
dp_StopDate
=
sender
;
}
function onLoadStopTime(sender, args) {
tp_StopTime
=
sender
;
}
</script>
</
telerik:RadScriptBlock
>
<
telerik:RadTabStrip
runat
=
"server"
ID
=
"RadTabStrip1"
MultiPageID
=
"RadMultiPage1"
SelectedIndex
=
"0"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"Start/Stop Details"
Width
=
"200px"
></
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Incident Details"
Width
=
"200px"
></
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Repair Action Details"
Width
=
"200px"
></
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
runat
=
"server"
ID
=
"RadMultiPage1"
SelectedIndex
=
"0"
CssClass
=
"outerMultiPage"
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"pv_StartStop"
>
<
table
id
=
"Table3"
cellspacing
=
"3"
cellpadding
=
"3"
width
=
"300"
border
=
"0"
>
<
tr
>
<
td
style
=
"text-align:right"
>
Log Date:
</
td
>
<
td
style
=
"white-space:nowrap"
>
<
asp:TextBox
ID
=
"txt_LogDate"
runat
=
"server"
Text='<%# DataBinder.Eval( Container, "DataItem.LogDate" ) %>' Width="30em"></
asp:TextBox
>
</
td
>
<
td
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"text-align:right"
>
Activity Code:
</
td
>
<
td
style
=
"white-space:nowrap"
>
<
telerik:RadDropDownList
runat
=
"server"
ID
=
"cbo_ActivityCode"
DataValueField
=
"Activity_id"
DataTextField
=
"ActivityCodeDesc"
DataSourceID
=
"ds_ActivityCodes"
Width
=
"30em"
>
</
telerik:RadDropDownList
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator2"
ControlToValidate
=
"cbo_ActivityCode"
ErrorMessage
=
"Please select an Activity Code"
ForeColor
=
"Red"
runat
=
"server"
>*</
asp:RequiredFieldValidator
>
</
td
>
<
td
>
</
td
>
</
tr
>
<
tr
>
<
td
align
=
"right"
valign
=
"top"
>
<
asp:label
ID
=
"lbl_StartTime"
Text
=
"Start Time:"
runat
=
"server"
></
asp:label
>
</
td
>
<
td
>
<
telerik:RadDatePicker
ID
=
"dp_StartDate"
Width
=
"100px"
runat
=
"server"
>
<
DateInput
ID
=
"DateInput1"
runat
=
"server"
>
<
ClientEvents
OnLoad
=
"onLoadStartDate"
></
ClientEvents
>
</
DateInput
>
</
telerik:RadDatePicker
>
<
telerik:RadTimePicker
ID
=
"tp_StartTime"
Width
=
"80px"
runat
=
"server"
>
<
DateInput
ID
=
"DateInput2"
runat
=
"server"
>
<
ClientEvents
OnLoad
=
"onLoadStartTime"
></
ClientEvents
>
</
DateInput
>
<
TimeView
ID
=
"TimeView1"
Interval
=
"00:30:00"
Columns
=
"6"
runat
=
"server"
></
TimeView
>
</
telerik:RadTimePicker
>
<
asp:CustomValidator
ID
=
"val_StartDate"
EnableClientScript
=
"true"
ControlToValidate
=
"dp_StartDate"
ClientValidationFunction
=
"ValidateStart"
ForeColor
=
"Red"
runat
=
"server"
>*</
asp:CustomValidator
>
<
asp:CustomValidator
ID
=
"val_StartTime"
EnableClientScript
=
"true"
ControlToValidate
=
"tp_StartTime"
ClientValidationFunction
=
"ValidateStart"
ForeColor
=
"Red"
runat
=
"server"
>*</
asp:CustomValidator
>
</
td
>
<
td
>
</
td
>
</
tr
>
<
tr
>
<
td
align
=
"right"
valign
=
"top"
>
<
asp:label
ID
=
"lbl_StopTime"
Text
=
"Stop Time:"
runat
=
"server"
></
asp:label
>
</
td
>
<
td
>
<
telerik:RadDatePicker
ID
=
"dp_StopDate"
Width
=
"100px"
runat
=
"server"
>
<
DateInput
ID
=
"DateInput3"
runat
=
"server"
>
<
ClientEvents
OnLoad
=
"onLoadStopDate"
></
ClientEvents
>
</
DateInput
>
</
telerik:RadDatePicker
>
<
telerik:RadTimePicker
ID
=
"tp_StopTime"
Width
=
"80px"
runat
=
"server"
>
<
DateInput
ID
=
"DateInput4"
runat
=
"server"
>
<
ClientEvents
OnLoad
=
"onLoadStopTime"
></
ClientEvents
>
</
DateInput
>
<
TimeView
ID
=
"TimeView2"
Interval
=
"00:30:00"
Columns
=
"6"
runat
=
"server"
></
TimeView
>
</
telerik:RadTimePicker
>
<
asp:CustomValidator
ID
=
"val_StopDate"
EnableClientScript
=
"true"
ControlToValidate
=
"dp_StopDate"
ClientValidationFunction
=
"ValidateTimes"
ForeColor
=
"Red"
runat
=
"server"
>*</
asp:CustomValidator
>
<
asp:CustomValidator
ID
=
"val_StopTime"
EnableClientScript
=
"true"
ControlToValidate
=
"tp_StopTime"
ClientValidationFunction
=
"ValidateTimes"
ForeColor
=
"Red"
runat
=
"server"
>*</
asp:CustomValidator
>
</
td
>
<
td
>
</
td
>
</
tr
>
<
tr
>
<
td
align
=
"right"
valign
=
"top"
>
<
asp:label
ID
=
"lbl_Comment"
Text
=
"Comments:"
runat
=
"server"
></
asp:label
>
</
td
>
<
td
>
<
telerik:RadEditor
ID
=
"RE_ProgComment"
Width
=
"400px"
Height
=
"150px"
EditModes
=
"Design"
Skin
=
"Metro"
runat
=
"server"
>
<
Tools
>
<
telerik:EditorToolGroup
>
<
telerik:EditorTool
Name
=
"Bold"
></
telerik:EditorTool
>
<
telerik:EditorTool
Name
=
"Italic"
></
telerik:EditorTool
>
<
telerik:EditorTool
Name
=
"Underline"
></
telerik:EditorTool
>
<
telerik:EditorTool
Name
=
"InsertLink"
></
telerik:EditorTool
>
<
telerik:EditorTool
Name
=
"Unlink"
></
telerik:EditorTool
>
<
telerik:EditorTool
Name
=
"AjaxSpellCheck"
></
telerik:EditorTool
>
</
telerik:EditorToolGroup
>
</
Tools
>
</
telerik:RadEditor
>
</
td
>
<
td
>
</
td
>
</
tr
>
</
table
>
</
telerik:RadPageView
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"pv_Incident"
>
</
telerik:RadPageView
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"pv_RepairAction"
>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
WebUserControl.ascx.vb
Partial Class user_WebUserControl
Inherits System.Web.UI.UserControl
Private _dataItem As Object = Nothing
#Region "Web Form Designer generated code"
Protected Overrides Sub OnInit(ByVal e As EventArgs)
'
' CODEGEN: This call is required by the ASP.NET Web Form Designer.
'
InitializeComponent()
MyBase.OnInit(e)
End Sub 'OnInit
'/ <
summary
>
'/ Required method for Designer support - do not modify
'/ the contents of this method with the code editor.
'/ </
summary
>
Private Sub InitializeComponent()
AddHandler DataBinding, AddressOf Me.LogbookDetails_DataBinding
End Sub 'InitializeComponent
#End Region
Public Property DataItem() As Object
Get
Return Me._dataItem
End Get
Set(ByVal value As Object)
Me._dataItem = value
End Set
End Property
Protected Sub LogbookDetails_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ActivityCodeValue As Object
Dim CommentsValue As Object
' The drop-down lists and checkboxes to not set their selections automatically
' so this is being done here during the databinding
ActivityCodeValue = DataBinder.Eval(DataItem, "Activity_id")
If ActivityCodeValue.Equals(DBNull.Value) Then
ActivityCodeValue = 0
End If
CommentsValue = DataBinder.Eval(DataItem, "ProgComment")
If CommentsValue.Equals(DBNull.Value) Then
CommentsValue = ""
End If
' Populate the controls with data
Me.cbo_ActivityCode.SelectedIndex = ActivityCodeValue
Me.RE_ProgComment.Content = CommentsValue
If Not IsDBNull(DataBinder.Eval(DataItem, "StartDate")) Then
Me.dp_StartDate.SelectedDate = CDate(DataBinder.Eval(DataItem, "StartDate").ToString)
End If
If Not IsDBNull(DataBinder.Eval(DataItem, "StartTime")) Then
Me.tp_StartTime.SelectedTime = ts_ExtractTime(DataBinder.Eval(DataItem, "StartTime").ToString)
End If
If Not IsDBNull(DataBinder.Eval(DataItem, "StopDate")) Then
Me.dp_StopDate.SelectedDate = CDate(DataBinder.Eval(DataItem, "StopDate").ToString)
End If
If Not IsDBNull(DataBinder.Eval(DataItem, "StopTime")) Then
Me.tp_StopTime.SelectedTime = ts_ExtractTime(DataBinder.Eval(DataItem, "StopTime").ToString)
End If
End Sub
Function ts_ExtractTime(TimeFromDB_s As String) As TimeSpan
Dim Hours_l As Long
Dim Minutes_l As Long
Dim ColonPos_l As Long
ColonPos_l = InStr(TimeFromDB_s, ":")
If ColonPos_l > 0 Then
Hours_l = Left(TimeFromDB_s, ColonPos_l - 1)
Minutes_l = Right(TimeFromDB_s, Len(TimeFromDB_s) - ColonPos_l)
Else
Hours_l = Hour(Now)
Minutes_l = Minute(Now)
End If
ts_ExtractTime = New TimeSpan(Hours_l, Minutes_l, 0)
End Function
End Class