
| <telerik:RadGrid ID="rgScenario" runat="server" Width="100%" Skin="Custom" EnableEmbeddedSkins="false" |
| AutoGenerateColumns="false" AllowSorting="false" AllowPaging="false" AllowFilteringByColumn="false" OnDetailTableDataBind="rgScenario_DetailTableDataBind" OnNeedDataSource="rgScenario_NeedDataSource"> |
| <MasterTableView DataKeyNames="xxxx" runat="server" EnableColumnsViewState="true"> |
| <DetailTables> |
| <telerik:GridTableView DataKeyNames="yyyy" runat="server" Name="Detail1" Width="100%" EnableColumnsViewState="true" > |
| <DetailTables> |
| <telerik:GridTableView DataKeyNames="zzzz" runat="server" Name="Detail2" Width="100%" EnableColumnsViewState="true"> |
| <Columns> |
| <telerik:GridBoundColumn HeaderText="Area" DataField="Area" UniqueName="Area"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Days" DataField="Days" UniqueName="Days"></telerik:GridBoundColumn> |
| </Columns> |
| </telerik:GridTableView> |
| </DetailTables> |
| <Columns> |
| <telerik:GridBoundColumn HeaderText="Start Area" DataField="StartAreaName" UniqueName="StartAreaName"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="End Area" DataField="EndAreaName" UniqueName="EndAreaName"></telerik:GridBoundColumn> |
| </Columns> |
| </telerik:GridTableView> |
| </DetailTables> |
| <Columns> |
| <telerik:GridBoundColumn HeaderText="Vessel" DataField="VesselType" UniqueName="Vessel"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Days" DataField="TotalVoyageDaysNum" UniqueName="TotalVoyageDaysNum"></telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
| public partial class ComparisonReport : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| try |
| { |
| if (!IsPostBack) |
| { |
| //Populate data into an IList say ParentIList |
| ShowHideRiskColumns(input); |
| } |
| rgScenario.DataSource = ParentIList; |
| } |
| } |
| catch(Exception ex) |
| { |
| } |
| } |
| private void ShowHideRiskColumns(string input) |
| { |
| GridBoundColumn parentDynamicColumn = new GridBoundColumn(); |
| parentDynamicColumn.HeaderText = "Some text"; |
| parentDynamicColumn.UniqueName = "Some text"; |
| parentDynamicColumn.DataFormatString = "{0:#,###.##}"; |
| GridBoundColumn childDynamicColumn= new GridBoundColumn(); |
| childDynamicColumn.HeaderText = "Some text"; |
| childDynamicColumn.UniqueName = "Some text"; |
| GridBoundColumn subChildDynamicColumn = new GridBoundColumn(); |
| subChildDynamicColumn.HeaderText = "Some text"; |
| subChildDynamicColumn.UniqueName = "Some text"; |
| rgScenario.MasterTableView.Columns.Add(parentDynamicColumn); |
| rgScenario.MasterTableView.DetailTables[0].Columns.Add(childDynamicColumn); |
| rgScenario.MasterTableView.DetailTables[0].DetailTables[0].Columns.Add(subChildDynamicColumn); |
| switch(input) |
| { |
| case 1: |
| //Set the datafield according to the input |
| break; |
| case 2: |
| //Set the datafield according to the input |
| break; |
| } |
| } |
| protected void rgScenario_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
| { |
| if (!e.IsFromDetailTable) |
| { |
| rgScenario.DataSource = iList; |
| } |
| } |
| protected void rgScenario_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) |
| { |
| GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; |
| switch (e.DetailTableView.Name) |
| { |
| case "Detail1": |
| { |
| e.DetailTableView.DataSource = detailList1; |
| break; |
| } |
| case "Detail2": |
| { |
| e.DetailTableView.DataSource = detailList2; |
| break; |
| } |
| } |
| } |
| } |
Hi,
1.I am using RadScheduler.
2. In my page. I have usedmy own css class file.
2.I have set the propertyfor H2 in Css file (for standard heding to all the pages).
h2{
margin:0px0px 0px 0px;
padding:0px0px 0px 10px;
width:406px;
height:28px;
background-image:url(../images/welcom.png);background-repeat:no-repeat;
font-size:18px;font-weight:bold;
line-height:1.4em;
}
3.If I applying the css to my page, Scheduler control Headingsould conflit with my h2 property.
4. How can I solve this problem.
Hi everyone,
I am using many RadDatePicker controls on the form that are customized to a month/year pickers with solution found here:
http://www.telerik.com/community/code-library/submission/b311D-mdkhb.aspx
Because of performance issue I have to use shared calendar for all date pickers on the form. When I set SharedCalendarID property for each RadDatePicker there is a problem.
No matter witch picker I set date on it sets date on one picker only.
Here is my simple web page:
| <%@ Page Language="C#" AutoEventWireup="true" Culture="en-US" CodeFile="Default.aspx.cs" |
| Inherits="_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>Untitled Page</title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <asp:ScriptManager ID="ScriptManager1" runat="server"> |
| </asp:ScriptManager> |
| <br /> |
| <br /> |
| <div> |
| <script type="text/javascript"> |
| //override the onload event handler to change the picker after the page is loaded |
| window.onload = function() |
| { |
| window.setTimeout(function() {setCalendars();}, 200) |
| } |
| function setCalendars() |
| { |
| setCalendarTable($find("<%= RadDatePicker1.ClientID %>")); |
| setCalendarTable($find("<%= RadDatePicker2.ClientID %>")); |
| } |
| function setCalendarTable(picker) |
| { |
| var calendar = picker.get_calendar(); |
| var fastNavigation = calendar._getFastNavigation(); |
| $clearHandlers(picker.get_popupButton()); |
| $addHandler(picker.get_popupButton(), "click", function() |
| { |
| var textbox = picker.get_textBox(); |
| //adjust where to show the popup table |
| var x, y; |
| var adjustElement = textbox; |
| if (textbox.style.display == "none") |
| adjustElement = picker.get_popupImage(); |
| var pos = picker.getElementPosition(adjustElement); |
| x = pos.x; |
| y = pos.y + adjustElement.offsetHeight; |
| var e = { |
| clientX: x, |
| clientY: y |
| }; |
| //synchronize the input date if set with the picker one |
| var date = picker.get_selectedDate(); |
| if (date) |
| { |
| calendar.get_focusedDate()[0] = date.getFullYear(); |
| calendar.get_focusedDate()[1] = date.getMonth() + 1; |
| } |
| $get(calendar._titleID).onclick(e); |
| }); |
| fastNavigation.OnOK = |
| function() |
| { |
| var date = new Date(fastNavigation.Year, fastNavigation.Month, 1); |
| picker.get_dateInput().set_selectedDate(date); |
| fastNavigation.Popup.Hide(); |
| } |
| fastNavigation.OnToday = |
| function() |
| { |
| var date = new Date(); |
| picker.get_dateInput().set_selectedDate(date); |
| fastNavigation.Popup.Hide(); |
| } |
| } |
| </script> |
| <telerik:RadDatePicker ID="RadDatePicker1" runat="server" SharedCalendarID="sharedCalendar"> |
| <DateInput DateFormat="MMMM yyyy" runat="server"> |
| </DateInput> |
| <Calendar ID="Calendar1" runat="server" > |
| </Calendar> |
| </telerik:RadDatePicker> |
| <telerik:RadDatePicker ID="RadDatePicker2" runat="server" SharedCalendarID="sharedCalendar"> |
| <DateInput DateFormat="MMMM yyyy" runat="server"> |
| </DateInput> |
| <Calendar ID="Calendar2" runat="server" > |
| </Calendar> |
| </telerik:RadDatePicker> |
| <telerik:RadCalendar runat="server" ID="sharedCalendar" Width="100px"> |
| </telerik:RadCalendar> |
| </div> |
| </form> |
| </body> |
| </html> |
I am using 2008.1.515.20 version of RadDatePicker control.
Please help me to fix/solve this.
Thanks in advance,
Igor.
| function OnDateError(sender, args) |
| { |
| if (args.Reason == RadInputErrorReason.ParseError) |
| { |
| alert(args.InputText + " is an incorrect date format.\n\nThe format must be: MM/DD/YYYY"); |
| } |
| else if (args.Reason == RadInputErrorReason.OutOfRange) |
| { |
| alert("The date is out of range"); |
| } |
| sender.Clear(); |
| sender.Focus(); |
| event.cancelBubble=true; |
| } |
<?
xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<
configuration>
<
configSections>
<
sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<
sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<
section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<
sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<
section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
<
section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<
section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
</
sectionGroup>
</
sectionGroup>
</
sectionGroup>
</
configSections>
<
appSettings>
<
add key="net.interfax.ws.dfs" value="http://ws.interfax.net/dfs.asmx"/>
</
appSettings>
<
connectionStrings>
<
add name="connstring [info removed ] providerName="System.Data.SqlClient"/>
</
connectionStrings>
<
system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<
pages>
<
namespaces>
<
clear/>
<
add namespace="System"/>
<
add namespace="System.Collections"/>
<
add namespace="System.Collections.Generic"/>
<
add namespace="System.Collections.Specialized"/>
<
add namespace="System.Configuration"/>
<
add namespace="System.Text"/>
<
add namespace="System.Text.RegularExpressions"/>
<
add namespace="System.Web"/>
<
add namespace="System.Web.Caching"/>
<
add namespace="System.Web.SessionState"/>
<
add namespace="System.Web.Security"/>
<
add namespace="System.Web.Profile"/>
<
add namespace="System.Web.UI"/>
<
add namespace="System.Web.UI.WebControls"/>
<
add namespace="System.Web.UI.WebControls.WebParts"/>
<
add namespace="System.Web.UI.HtmlControls"/>
</
namespaces>
<
controls>
<
add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</
controls>
</
pages>
<
sessionState timeout="120"></sessionState>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<
compilation debug="true">
<
assemblies>
<
add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<
add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<
add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<
add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</
assemblies>
</
compilation>
<
httpHandlers>
<
remove verb="*" path="*.asmx"/>
<
add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<
add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<
add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<
add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2008.1.515.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />
</
httpHandlers>
<
httpModules>
<
add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</
httpModules>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<
authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</
system.web>
<
system.webServer>
<
validation validateIntegratedModeConfiguration="false"/>
<
modules>
<
add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</
modules>
<
handlers>
<
remove name="WebServiceHandlerFactory-Integrated"/>
<
add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<
add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<
add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</
handlers>
</
system.webServer>
</
configuration>

Error:
'addEventListner' is null or not an object
inside onload method:
panel.ID =
"Panel1";
this.Controls.Add(panel);
RadComboBox cbxName =
new RadComboBox();
cbxName.ID =
"cbxName";
cbxName.ItemsRequested +=
new RadComboBoxItemsRequestedEventHandler(cbxName_ItemsRequested);
cbxName.Skin = Skin;
panel.Controls.Add(cbxName);
RadAjaxManager
ajaxManager = RadAjaxManager.GetCurrent(this.Page);
if (ajaxManager == null)
{
ajaxManager =
new RadAjaxManager();
ajaxManager.ID =
"RadAjaxManager1";
Controls.Add(ajaxManager);
this.Page.Items.Add(typeof(RadAjaxManager), ajaxManager);
}
ajaxManager.AjaxSettings.AddAjaxSetting(cbxName, panel);
private
DataTable GetData(string text, string connString)
{
using (SqlConnection conn = new SqlConnection(connectionString))
{
conn.Open();
using (SqlCommand command = new SqlCommand("mystoredproc", conn))
{
command.CommandType =
CommandType.StoredProcedure;
command.Parameters.Add(
new SqlParameter("@paramName", text));
SqlDataAdapter adapter = new SqlDataAdapter(command);
DataTable data = new DataTable();
adapter.Fill(data);
return data;
}
}
}
protected
void cbxName_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
try
{
int itemsPerRequest = 10;
if (e.Text.Length >= 3)
{
DataTable table = GetData(e.Text, connectionString);
int itemOffset = e.NumberOfItems;
int endOffset = Math.Min(itemOffset + itemsPerRequest, table.Rows.Count);
e.EndOfItems = endOffset == table.Rows.Count;
for (int i = itemOffset; i < endOffset; i++)
{
cbxName.Items.Add(
new RadComboBoxItem(table.Rows[i]["Name"].ToString(), table.Rows[i]["ID"].ToString()));
}
}
else
{
cbxName.Items.Clear();
}
}
catch (Exception ex)
{
throw ex;
}
}
