
Requirement is to replace the < and > links in the Calendar titlebar to the text 'Previous Year' and 'Next Year' and make those links highlighted when the cursor hovers over them for both Firefox 3.5 and IE 7+ browsers. The CSS I defined in the .aspx file is below. It works fine in IE but the old 'CSS width property' issue with FF/IE is making the highlighted text appear inconsistent with IE (with the padding around the text). Any ideas on how to fix this?
<style type="text/css">
td.rcTitle{
color: black;
height: 3em;
}
/* provide extra room for the previous/next year text at the title edges */
.RadCalendar_Default .rcTitlebar .rcTitle{
width: 85%;
}
/* remove the fast previous/next <</>> links in the title bar */
.RadCalendar_Default .rcTitlebar .rcFastNext,
.RadCalendar_Default .rcTitlebar .rcFastPrev {
display: none;
}
.RadCalendar_Default .rcTitlebar a.rcNext:hover,
.RadCalendar_Default .rcTitlebar a.rcPrev:hover {
background-color: #c2cfe5;
border:1px solid #335ea8;
}
.RadCalendar_Default .rcTitlebar a.rcNext:active,
.RadCalendar_Default .rcTitlebar a.rcPrev:active {
background-color: #99afd4;
border:1px solid #335ea8;
}
/* display the previous/next year text */
.RadCalendar_Default .rcTitlebar a.rcNext,
.RadCalendar_Default .rcTitlebar a.rcPrev {
display: inline;
background: none;
overflow: visible;
text-decoration: underline;
color: black;
width: 110px;
text-indent:0px;
}
</style>


| private GridDateTimeColumn CreateDateGridColumn(string fieldname) |
| { |
| GridDateTimeColumn DT = new GridDateTimeColumn(); |
| DT.UniqueName = fieldname; |
| DT.HeaderText = "fieldname"; |
| DT.PickerType = GridDateTimeColumnPickerType.DatePicker; |
| DT.DataFormatString = "{0:MM/dd/yyyy}"; |
| DT.ColumnEditorID = fieldname + "Editor"; |
| DT.DataField = fieldname; |
| DT.SortExpression = fieldname; |
| DT.ItemStyle.Width = Unit.Pixel(120); |
| DT.FilterControlWidth = Unit.Pixel(50); |
| DT.EmptyDataText = " "; |
| return DT; |
| } |
Hi,
I am facing a problem while using RadDatePicker in IE8, below is the code:
| <script language="javascript" type="text/javascript"> |
| function fireHiddenButton(sender, args) { |
| var textBox1 = $find("<%= startDate.ClientID %>").get_selectedDate(); |
| var textBox2 = $find("<%= endDate.ClientID %>").get_selectedDate(); |
| if (textBox1 != null && textBox2 != null ) { |
| $get("<%= submitForm.ClientId %>").click(); |
| } |
| } |
| </script> |
| <table> |
| <tr> |
| <td> |
| Start Date |
| </td> |
| <td> |
| <telerik:RadDatePicker ID="startDate" ShowPopupOnFocus="true" runat="server"> |
| <ClientEvents OnPopupClosing="fireHiddenButton" /> |
| </telerik:RadDatePicker> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| End Date |
| </td> |
| <td> |
| <telerik:RadDatePicker ID="endDate" ShowPopupOnFocus="true" runat="server"> |
| <ClientEvents OnPopupClosing="fireHiddenButton" /> |
| </telerik:RadDatePicker> |
| </td> |
| </tr> |
| </table> |
| <asp:LinkButton style="display:none" ID="submitForm" runat="server"> |
| private void RenderExpand(HtmlTextWriter writer) |
| { |
| if (this.Expanded && (this.ExpandMode != TreeNodeExpandMode.ServerSideCallBack)) |
| { |
| writer.AddAttribute(HtmlTextWriterAttribute.Class, "rtMinus"); |
| } |
| else |
| { |
| writer.AddAttribute(HtmlTextWriterAttribute.Class, "rtPlus"); |
| } |
| writer.RenderBeginTag(HtmlTextWriterTag.Span); |
| writer.RenderEndTag(); |
| } |
| .RadPanelBar_JonDan |
| { |
| background: #f8f8f8 !Important; |
| font-family: Verdana, Arial, helvetica, sans-serif !Important; |
| font-size: 11px !Important; |
| line-height: 24px !Important; |
| } |
| .RadPanelBar_JonDan .rpRootGroup |
| { |
| border: solid 1px #f0f0f0; |
| } |
| .RadPanelBar_JonDan .rpRootGroup .rpLink |
| { |
| background: #fff !Important; |
| font-weight: bold; |
| font-size: 12px; |
| border: none !Important; |
| color: #cc0000; |
| } |
| .RadPanelBar_JonDan .rpRootGroup .rpFocused, |
| .RadPanelBar_JonDan .rpRootGroup .rpLink:hover |
| { |
| background: #fff url('PanelBar/RootItemBg.png') 0 -1px !Important; |
| color: #fff; |
| } |
| .RadPanelBar_JonDan .rpGroup .rpLink |
| { |
| background: #f8f8f8 none !Important; |
| border-top: solid 1px #fff !Important; |
| border-bottom: solid 1px #f0f0f0 !Important; |
| border-left: solid 1px #f8f8f8 !Important; |
| border-right: solid 1px #f8f8f8 !Important; |
| font-weight: normal; |
| color: #666 !Important; |
| } |
| .RadPanelBar_JonDan .rpGroup .rpFocused, |
| .RadPanelBar_JonDan .rpGroup .rpLink:hover |
| { |
| background: #fff none !Important; |
| border-top: solid 1px #fff !Important; |
| border-bottom: solid 1px #e6e6e6 !Important; |
| border-left: solid 1px #f8f8f8 !Important; |
| border-right: solid 1px #f8f8f8 !Important; |
| font-weight: normal; |
| color: #ff0000 !Important; |
| } |
| .RadPanelBar_JonDan .rpOut |
| { |
| border-color: #f8f8f8 !Important; |
| } |
| .RadPanelBar_JonDan .rpExpanded |
| { |
| border-color: #f8f8f8; |
| } |
| /* <disabled items> */ |
| .RadPanelBar_JonDan .rpDisabled, |
| .RadPanelBar_JonDan .rpDisabled:hover |
| { |
| color: #ccc; |
| } |
| .RadPanelBar_JonDan .rpDisabled:hover |
| { |
| border-color: #002d96; |
| } |
| .RadPanelBar_JonDan .rpDisabled .rpOut, |
| .RadPanelBar_JonDan .rpDisabled:hover .rpOut |
| { |
| border-color: #89aee5; |
| } |
| /* </disabled items> */ |
| /* <expand arrows> */ |
| .RadPanelBar_JonDan .rpExpandable .rpText, |
| .RadPanelBar_JonDan .rpExpanded .rpText |
| { |
| background-color: transparent; |
| background-image: url('PanelBar/Expandable.gif'); |
| } |
| /* </expand arrows> */ |
| /* <expand arrows override> */ |
| .RadPanelBar .rpExpandable .rpText, |
| .RadPanelBar .rpExpanded .rpText |
| { |
| padding-right: 20px; |
| background-repeat: no-repeat; |
| } |
| .RadPanelBar_rtl .rpExpandable .rpText, |
| .RadPanelBar_rtl .rpExpanded .rpText |
| { |
| padding-left: 20px; |
| } |
| .RadPanelBar_rtl .rpGroup .rpText |
| { |
| padding: 0 10px; |
| } |
| .RadPanelBar .rpExpandable .rpText { background-position: 100% 0; } |
| .RadPanelBar .rpExpanded .rpText { background-position: 100% -176px; } |
| .RadPanelBar_rtl .rpExpandable .rpText { background-position: 0 0; } |
| .RadPanelBar_rtl .rpExpanded .rpText { background-position: 0 -176px; } |
| .RadPanelBar .rpExpandable:hover .rpText, |
| .RadPanelBar .rpExpandable.rpSelected .rpText, |
| .RadPanelBar .rpExpandable.rpSelected:hover .rpText |
| { |
| background-position: 100% -337px; |
| } |
| .RadPanelBar .rpExpanded:hover .rpText, |
| .RadPanelBar .rpExpanded.rpSelected .rpText, |
| .RadPanelBar .rpExpanded.rpSelected:hover .rpText |
| { |
| background-position: 100% -476px; |
| } |
| .RadPanelBar_rtl .rpExpandable:hover .rpText, |
| .RadPanelBar_rtl .rpExpandable.rpSelected .rpText, |
| .RadPanelBar_rtl .rpExpandable.rpSelected:hover .rpText |
| { |
| background-position: 0 -337px; |
| } |
| .RadPanelBar_rtl .rpExpanded:hover .rpText, |
| .RadPanelBar_rtl .rpExpanded.rpSelected .rpText, |
| .RadPanelBar_rtl .rpExpanded.rpSelected:hover .rpText |
| { |
| background-position: 0 -476px; |
| } |
| /* </expand arrows override> */ |
| /* <subitems> */ |
| .RadPanelBar_JonDan .rpGroup |
| { |
| background-color: #fff; |
| } |
| .RadPanelBar_JonDan .rpGroup .rpLink, |
| .RadPanelBar_JonDan .rpGroup .rpTemplate |
| { |
| color: #000; |
| background-color: transparent; |
| background-image: none; |
| line-height: 20px; |
| min-height: 20px; |
| } |
| * html .RadPanelBar_JonDan .rpGroup .rpLink { height: 20px; } |
| .RadPanelBar_JonDan .rpGroup .rpLink |
| { |
| background-color: transparent; |
| background-image: none; |
| padding: 1px; |
| margin: 0 1px; |
| } |
| .RadPanelBar_JonDan .rpGroup .rpOut |
| { |
| border-bottom: 0; |
| margin-right: 3px; |
| } |
| /* <subitems (disabled)> */ |
| .RadPanelBar_JonDan .rpGroup .rpItem .rpDisabled, |
| .RadPanelBar_JonDan .rpGroup .rpItem .rpDisabled:hover, |
| .RadPanelBar_JonDan .rpGroup .rpItem .rpDisabled:hover .rpOut |
| { |
| background-image: none; |
| } |
| .RadPanelBar_JonDan .rpGroup .rpItem .rpDisabled, |
| .RadPanelBar_JonDan .rpGroup .rpItem .rpDisabled:hover |
| { |
| color: #999; |
| text-decoration: none; |
| background-color: #fff; |
| border: 0; |
| padding: 1px; |
| } |
| .RadPanelBar_JonDan .rpGroup .rpItem .rpDisabled:hover .rpOut |
| { |
| border-bottom: 0; |
| } |
| /* </subitems (disabled)> */ |
| /* <subitems> */ |
| <link href="../Styling/ProductPanel.css" rel="stylesheet" type="text/css" /> <telerik:RadPanelBar ID="RadPanelBar1" Runat="server" DataFieldID="productID" |
| DataFieldParentID="productParentID" DataSourceID="adsProducts" |
| DataTextField="productTitle" DataValueField="productID" Width="250px" EnableEmbeddedSkins="false" Skin="RadPanelBar_JonDan"> |
| </telerik:RadPanelBar> |
RadGrid1.DataSource = handler.Find(); ->
| public IList<Company1.Grid.Data.DataTransferObjects.KravDTO> Find() |
| { |
| using (Company1LinqDSDataContext context = new Company1LinqDSDataContext()) |
| { |
| return (from k in context.Kravs |
| select new Company1.Grid.Data.DataTransferObjects.KravDTO() |
| { |
| Anr=k.anrr, |
| ID=k.ID, |
| Kund=k.Kund |
| }).ToList(); |
| } |
| } |
Hence the RadGrid is populated with an IList as datasource.
This works fine! However the filtering and paging functions only work once every refresh. E.g: Navigate to the page containing the RadGrid. Filter/change page or anything like that and the filtering and ability to change number of items per page stops working.
The paging itself (clicking the navigation) and sorting still works.
If i refresh the page the filtering and "number per page" function works again until the next action.
The only error message i get is: "'null' is null or not an object".
My .ascx code:
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <telerik:RadGrid ID="RadGrid1" Width="97%" |
| AllowPaging="True" PageSize="25" runat="server" AllowFilteringByColumn="True" AllowSorting="True" |
| OnNeedDataSource="RadGrid1_NeedDataSource" GridLines="None"> |
| <MasterTableView Width="100%" /> |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| <FilterMenu EnableTheming="True"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </FilterMenu> |
| </telerik:RadGrid> |
Any ideas?
| protected override void Page_Init(object sender, EventArgs e) |
| { |
| base.Page_Init(sender, e); |
| CreateGrid(); |
| } |
| protected void Page_Load(object sender, System.EventArgs e) |
| { |
| lblLocation.Text = Location.Title; |
| if (!IsPublished) |
| { |
| lblStatus.Text = " - " + _location.Status.ToString(); |
| lblStatus.Visible = true; |
| } |
| if (_ajaxmanager != null) |
| { |
| _ajaxmanager.AjaxSettings.AddAjaxSetting(Grid, Grid); |
| } |
| } |
| public void CreateGrid() |
| { |
| GridButtonColumn edit_col = new GridButtonColumn(); |
| edit_col.Text = "wijzig"; |
| edit_col.UniqueName = "EditColumn"; |
| edit_col.CommandName = "Edit"; |
| edit_col.ItemStyle.Width = Unit.Pixel(35); |
| GridButtonColumn copy_col = new GridButtonColumn(); |
| copy_col.Text = "kopieer"; |
| copy_col.UniqueName = "CopyColumn"; |
| copy_col.CommandName = "Copy"; |
| copy_col.ItemStyle.Width = Unit.Pixel(40); |
| GridButtonColumn del_col = new GridButtonColumn(); |
| del_col.Text = "verwijder"; |
| del_col.UniqueName = "DeleteColumn"; |
| del_col.CommandName = "Delete"; |
| del_col.ItemStyle.Width = Unit.Pixel(50); |
| RadGrid grid = new RadGrid(); |
| grid.UpdateCommand += new GridCommandEventHandler(grid_UpdateCommand); |
| grid.DeleteCommand += new GridCommandEventHandler(grid_DeleteCommand); |
| //grid.ItemDataBound += new GridItemEventHandler(grid_ItemDataBound); |
| grid.ID = "grdFreeplaces"; |
| grid.AutoGenerateColumns = false; |
| grid.ShowStatusBar = true; |
| grid.Width = Unit.Pixel(737); |
| grid.ClientSettings.AllowKeyboardNavigation = true; |
| grid.ClientSettings.KeyboardNavigationSettings.InitInsertKey = GridFocusKeys.I; |
| grid.MasterTableView.EditFormSettings.EditFormType = GridEditFormType.Template; |
| grid.MasterTableView.EditFormSettings.FormTemplate = new VisualObjectEditorFreeDaysFormTemplate(this, _location); |
| grid.MasterTableView.CommandItemSettings.AddNewRecordText = "Toevoegen"; |
| grid.MasterTableView.CommandItemSettings.RefreshText = "Herladen"; |
| if (IsPublished) |
| grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.TopAndBottom; |
| else |
| grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None; |
| grid.MasterTableView.EditMode = GridEditMode.PopUp; |
| grid.MasterTableView.EditFormSettings.PopUpSettings.Width = Unit.Pixel(765); |
| grid.MasterTableView.EditFormSettings.PopUpSettings.Height = Unit.Pixel(240); |
| grid.DataSource = Location.FreePlaces; |
| grid.MasterTableView.DataKeyNames = new string[] { "LexiconItemID" }; |
| if (IsPublished) grid.MasterTableView.Columns.Add(edit_col); |
| if (IsPublished) grid.MasterTableView.Columns.Add(del_col); |
| grid.MasterTableView.Columns.Add(CreateDataColumn("Omschrijving", "Description")); |
| grid.MasterTableView.Columns.Add(CreateDataColumn("Leeftijd", "AgeRangeDescription")); |
| phFreePlace.Controls.Add(grid); |
| } |
| protected void grid_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) |
| { |
| bool isnew = false; |
| GridEditableItem item = e.Item as GridEditableItem; |
| VisualObjectEditor editor = (e.CommandSource as Button).Parent.FindControl("edtFormTemplate") as VisualObjectEditor; |
| LexiconItem freeplace = null; |
| Location.Location.Document.ContentControl.CheckOut(Framework, Framework.ActiveUser); |
| if (item.ItemIndex < 0) |
| { |
| freeplace = _location.Location.CreateNewFreePlace().LexiconItem; |
| isnew = true; |
| } |
| else |
| freeplace = Location.FindFreePlace(item.OwnerTableView.DataKeyValues[item.ItemIndex]["LexiconItemID"].ToString()).LexiconItem; |
| editor.GetContentStorageValues(freeplace.Content.DocumentType, freeplace.Content); |
| if (editor.Validate(freeplace)) |
| { |
| Location.Location.GetFreePlaceContentField().LexiconItems.Add(freeplace); |
| Location.Location.Document.ContentControl.Publish(Framework, Framework.ActiveUser); |
| Grid.DataSource = Location.FreePlaces; |
| Grid.Rebind(); |
| } |
| else |
| { |
| Location.Location.Document.ContentControl.UndoCheckOut(Framework, Framework.ActiveUser); |
| e.Canceled = true; |
| } |
| } |
| protected void grid_DeleteCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) |
| { |
| Location.Location.Document.ContentControl.CheckOut(Framework, Framework.ActiveUser); |
| string lexiconitemid = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["LexiconItemID"].ToString(); |
| Location.Location.DeleteFreePlace(lexiconitemid); |
| Location.Location.Document.ContentControl.Publish(Framework, Framework.ActiveUser); |
| Grid.DataSource = Location.FreePlaces; |
| Grid.Rebind(); |
| } |