<telerik:RadScriptBlock ID="rsb" runat="server"> <script type="text/javascript"> function toggleDiv(div, st) { $get('div' + div).style.display = st; } function validationFailed(sender, eventArgs) { $(".ErrorHolder").append("<p><span style='color:red;'>Het bestand '" + eventArgs.get_fileName() + "' is te groot.<br />De maximale bestandsgrootte is 100Mb per bestand. Upload afgebroken.</span></p>").fadeIn("slow"); } function filesSelected(sender, eventArgs) { } </script> </telerik:RadScriptBlock><telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="RadioButtons, Textbox, Checkboxes, Buttons" EnableRoundedCorners="false" Skin="Office2007" /><asp:RadioButton ID="rb0post" runat="server" GroupName="g0" Text="per post" TextAlign="Right" onclick="toggleDiv('0', 'none');" /> <br /> <asp:RadioButton ID="rb0email" runat="server" GroupName="g0" Text="digitaal" TextAlign="Right" onclick="toggleDiv('0', '');" /> <br /> <div id="div0"> <telerik:RadAsyncUpload OnClientFilesSelected="filesSelected" MaxFileSize="102400000" ID="RadAsyncUpload0" runat="server" Skin="Office2007" TargetFolder="~/Uploads" AllowedFileExtensions=".doc,.xls,.ppt,.pdf,.jpg,.gif,.bmp,.tif,.tiff,.png,.sif,.zip,.swf,.docx,.xlsx,.pptx,.avi,.mpg,.mpeg,.mp3,.wav,.odt,.ods" Culture="Dutch (Netherlands)" MultipleFileSelection="Automatic" OnClientValidationFailed="validationFailed"> <Localization Cancel="Annuleren" Remove="Verwijderen" Select="Selecteren" /> </telerik:RadAsyncUpload><div id="ErrorHolder"></div> Reeds geüpload: </div><telerik:RadAsyncUpload OnClientFilesSelected="filesSelected" MaxFileSize="102400000" ID="RadAsyncUpload1" runat="server" Skin="Office2007" TargetFolder="~/Uploads" AllowedFileExtensions=".doc,.xls,.ppt,.pdf,.jpg,.gif,.bmp,.tif,.tiff,.png,.sif,.zip,.swf,.docx,.xlsx,.pptx,.avi,.mpg,.mpeg,.mp3,.wav,.odt,.ods" Culture="Dutch (Netherlands)" MultipleFileSelection="Automatic" OnClientValidationFailed="validationFailed"> <Localization Cancel="Annuleren" Remove="Verwijderen" Select="Selecteren" /> </telerik:RadAsyncUpload><div id="ErrorHolder">The application that I am working with has hundreds of style sheets for different clients that are dynamically loaded based on client configuration. All style sheet references are defined in the application's master page. After adding a few newer Telerik controls to some of the pages along with the additional custom skin css references, we have reached the 31+ max css limit for IE and various controls are beggining to experience style/rendering issues. The RadStyleSheetManager seems like a good solution to implement in order to consolidate these multiple css references into one.
From the little documentation available for the RadStyleSheetManager, it seems that it only works for style sheets that are in a separate class library defined as a web resource... is this the only way? Can the RadStyleSheetManager combine css embedded resources that are local to the project? Something like ...
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadStyleSheetManager._Default" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" > |
| <head runat="server"> |
| <title></title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" Runat="server"> |
| <StyleSheets> |
| <telerik:StyleSheetReference Path="Stylesheet1.css" Name="StyleSheet1.css" /> |
| <telerik:StyleSheetReference Path="Stylesheet2.css" Name="StyleSheet2.css" /> |
| <telerik:StyleSheetReference Path="Stylesheet3.css" Name="StyleSheet3.css" /> |
| </StyleSheets> |
| </telerik:RadStyleSheetManager> |
| <div> |
| <div class="Style1">Style 1</div> |
| <div class="Style2">Style 2</div> |
| <div class="Style3">Style 3</div> |
| </div> |
| </form> |
| </body> |
| </html> |
<configuration> <system.web> <authorization> <allow roles="PubAll" /> <allow roles="PubCpi" /> <deny users="*" /> </authorization> </system.web> </configuration>
<%@ Master Language="VB" CodeFile="Design.master.vb" Inherits="Design" %>[...]<telerik:RadWindowManager ID="RadWindowManager1" runat="server"> <Windows> <telerik:RadWindow ID="CommonWindow" runat="server" /> </Windows></telerik:RadWindowManager>[...]<%@ Page Language="VB" MasterPageFile="Design.master" CodeFile="Main.aspx.vb" Inherits="Main" %>[...]<telerik:RadWindowManager ID="RadWindowManager1Proxy" runat="server"> <Windows> <telerik:RadWindow ID="PageSpecific" runat="server" /> </Windows></telerik:RadWindowManager>[...]protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e) { LinkButton lnkPermitName = (LinkButton)e.Container.FindControl("lblDisplayPermitName"); Label labelPermitName = (Label)e.Container.FindControl("labelPermitName"); if (!IsEditable) { lnkPermitName.Visible = false; labelPermitName.Visible = true; } else { lnkPermitName.Visible = true; labelPermitName.Visible = false; } LinkButton lnkButtonMore = new LinkButton(); lnkButtonMore.ID = e.Appointment.ID.ToString(); lnkButtonMore.Text = "More"; RadToolTipManager1.TargetControls.Add(lnkButtonMore.ClientID, e.Appointment.ID.ToString(), true); //RadToolTipManager1.TargetControls.Add(lnkButtonMore.ID, e.Appointment.ID.ToString(), false); if (e.Appointment.CssClass == UIConfigurationConstant.DARKBLUE) lnkButtonMore.Style.Add(HtmlTextWriterStyle.Color, "white"); e.Container.Controls.Add(lnkButtonMore); //LinkButton lnkButtonMore = new LinkButton(); }Else
'if in edit mode, set the date picker to popup on click in input box
SetDatePickerPopop(dataItem, "ctlFollowup_DatePicker")
'enable a scroll bar if there are too many items in the list
GlobalMethods.SetDropDownHeight(CType(dataItem.FindControl("ctlUserNoteType"), RadComboBox))
GlobalMethods.SetDropDownHeight(CType(dataItem.FindControl("ctlUserCombo"), RadComboBox))
RIGHT HERE...I need to access the "ctlUserCombo", compare the text of each RadComboBoxItem, and when I find a match to a value I have, set that RadComboBoxItem to Selected = True and (if possible), Enabled = False. That is, I have a checkbox list of people, and some have already been selected. I want to show the user those that have already been selected, and then disable the user from being able to change the checkbox.
Any suggestions?
Thanks in advance for all the help.
Rich
<%@ Page Title="Home Page" Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="DataFormatting._Default" %> <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> <form id="form1" runat="server"> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> </telerik:RadAjaxManager> <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> </telerik:RadScriptManager> <div class="contributionTable" > <asp:PlaceHolder ID="PlaceHolder1" runat="server" > <telerik:RadGrid ID="clientContribution" runat="server" onitemdatabound="clientContribution_ItemDataBound" > </telerik:RadGrid> </asp:PlaceHolder> </div> </form> using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Diagnostics; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Telerik.Web.UI; namespace DataFormatting { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { BuildTheGrid(); } } protected void clientContribution_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridGroupHeaderItem) { GridGroupHeaderItem item = (GridGroupHeaderItem)e.Item; DataRowView groupDataRow = (DataRowView)e.Item.DataItem; } } #region Build the grid private DataSet BuildTheGrid() { try { clientContribution.DataSource = null; DataSet contributionColumns = LoadGridData(); // Define the main grid for (int loopPos = clientContribution.MasterTableView.Columns.Count; loopPos > 0; loopPos--) { clientContribution.MasterTableView.Columns.RemoveAt(loopPos - 1); } clientContribution.ID = "MyGrid"; clientContribution.DataSource = contributionColumns; clientContribution.Width = Unit.Percentage(98); clientContribution.AutoGenerateColumns = false; clientContribution.ShowStatusBar = true; clientContribution.MasterTableView.Width = Unit.Percentage(100); // now build the hierarchical grid GridBoundColumn boundColumn = new GridBoundColumn(); foreach (DataColumn col in contributionColumns.Tables[0].Columns) { boundColumn = new GridBoundColumn(); clientContribution.MasterTableView.Columns.Add(boundColumn); boundColumn.DataField = col.ColumnName; boundColumn.HeaderText = col.ColumnName; boundColumn.Visible = true; if (col.Ordinal == 1) { boundColumn.DataFormatString = "{0:##,###.0}"; } if (col.Ordinal == 2) { boundColumn.DataFormatString = "{0:###.0%}"; } } clientContribution.DataBind(); } catch (Exception exc) { Debug.WriteLine(exc.Message); return null; } finally { } return null; } #endregion #region Load the Grid Data private DataSet LoadGridData() { // return the data to display DataSet contributionData = new DataSet("MyData"); DataTable gridData = contributionData.Tables.Add("ContData"); gridData.Columns.Add(new DataColumn("DummyValue")); gridData.Columns.Add(new DataColumn("DecimalValue")); gridData.Columns.Add(new DataColumn("PercentageValue")); for (int i = 0; i < 10; i++) { DataRow dataRow = contributionData.Tables[0].NewRow(); dataRow["DummyValue"] = "Value" + i.ToString(); dataRow["DecimalValue"] = 1234.88 * i; dataRow["PercentageValue"] = 2.33 * i; contributionData.Tables[0].Rows.Add(dataRow); } return contributionData; } #endregion } } Protected Sub RadGrid1_ItemInserted(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridInsertedEventArgs) Handles RadGrid1.ItemInserted If e.Exception Is Nothing Then Dim editedItem As GridEditableItem = e.Item If "Placements".Equals(editedItem.OwnerTableView.Name) Then Dim gridRows As GridItemCollection = RadGrid1.Items Dim id As Int32 = 0 For Each data As GridDataItem In gridRows id = Math.Max(id, data.GetDataKeyValue("PlanMasterId")) Next UpdateFarmPerformance(id) ElseIf "Sheds".Equals(editedItem.OwnerTableView.Name) Then 'Update the Placment details from the shed details Dim parentItem As GridDataItem = editedItem.OwnerTableView.ParentItem Dim id As Int32 = parentItem.OwnerTableView.DataKeyValues(parentItem.ItemIndex)("PlanMasterId") updatePlacements(id) Dim gridRows As GridItemCollection = e.Item.OwnerTableView.Items Dim id2 As Int32 = 0 For Each data As GridDataItem In gridRows id2 = Math.Max(id2, data.GetDataKeyValue("PlanMasterShedId")) Next UpdateShedPerformance(id2) UpdateFarmPerformance(id) End If End If End Sub