The compiler throws an error saying:
Error 143 The type or namespace name 'Base' does not exist in the namespace 'Telerik.WebControls' (are you missing an assembly reference?)
I looked in the bin directory of my project and all I saw was the following dll's:
1) RadGrid.dll (used in a previous version of Rad Controls-still works great)
2) Telerik.Web.UI.dll
I used the automatic installation to install RadControls to my VS 2005 IDE and it appears fine in the toolbox. In design mode, I inserted the Rad Calendar control on to my page and have customized it from there.
I keep thinking that there is a way to add a reference/assembly for the Telerik.WebControls.dll to the assemble, but can't locate it anywhere.
Do I even need the Telerik.WebControls.dll in this version of RadControls for ASP.Net Ajax or will the Telerik.Web.UI.dll do the trick for me?
If yes, how do I add that reference to my project?
I've tried several times to add it from the RadControls installation folder at this location:
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q2 2008\Bin
but the only dll's and files I saw in there were:
1) Telerik.Charting.dll
2) Telerik.Charting.xml
3) Telerik.Web.UI.dll
4) Telerik.Web.UI.xml
I already have the Telerik.Web.UI.dll & Telerik.Web.UI.xml files in the bin directory of my project, but can't seem to get the Telerik.WebControls.dll in there.
Can anybody help me here? What am I doing wrong?
And/or - Does anybody have a better suggestion on how to display d/b driven Event data on a RADCalendar for ASP.Net Ajax control?
Any assistance would be greatly appreciated for this rookie programmer.
Thanks
Jeff O'Connell
jboconne@iupui.edu
Here is the C# code behind page I'm using for the RadCalendar:
| using System; | |
| using System.Data; | |
| using System.Data.SqlClient; | |
| using System.Data.Odbc; | |
| using System.Configuration; | |
| using System.Collections; | |
| using System.Web; | |
| using System.Web.Security; | |
| using System.Web.UI; | |
| using System.Web.UI.WebControls; | |
| using System.Web.UI.WebControls.WebParts; | |
| using System.Web.UI.HtmlControls; | |
| using AnnieECasey.DataBase; | |
| using AnnieECasey.Lib; | |
| using Telerik.WebControls; | |
| using Telerik.Web.UI; | |
| namespace AnnieECasey | |
| { | |
| /// <summary> | |
| /// Summary description for resources_websites. | |
| /// </summary> | |
| public partial class resources_events : System.Web.UI.Page | |
| { | |
| public class EventItem | |
| { | |
| //=========================================== | |
| // Class used in building the event calendar | |
| //=========================================== | |
| private int _EventID; | |
| private System.DateTime _EventDate; | |
| private string _EventName; | |
| private string _EventDesc; | |
| private int _EventCategoryID; | |
| public EventItem(int EventID, System.DateTime EventDate, string EventName, string EventDesc, int EventCategoryID) | |
| { | |
| _EventID = EventID; | |
| _EventDate = EventDate; | |
| _EventName = EventName; | |
| _EventDesc = EventDesc; | |
| _EventCategoryID = EventCategoryID; | |
| } | |
| public int EventID | |
| { | |
| get | |
| { | |
| return _EventID; | |
| } | |
| } | |
| public System.DateTime EventDate | |
| { | |
| get | |
| { | |
| return _EventDate; | |
| } | |
| } | |
| public string EventName | |
| { | |
| get | |
| { | |
| return _EventName; | |
| } | |
| } | |
| public string EventDesc | |
| { | |
| get | |
| { | |
| return _EventDesc; | |
| } | |
| } | |
| public int EventCategoryID | |
| { | |
| get | |
| { | |
| return _EventCategoryID; | |
| } | |
| } | |
| } | |
| public void Page_Load(object sender, System.EventArgs e) | |
| { | |
| radCalEvents.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); | |
| if (!IsPostBack) | |
| { | |
| GetEventItems(); | |
| } | |
| } | |
| // setup an array to store all of the events for the month(this is what we will access thru the DayRender event) | |
| private ArrayList EventArrayList = new ArrayList(); | |
| public void GetEventItems() | |
| { | |
| DateTime startDate = ((MonthView)radCalEvents.CalendarView).MonthStartDate; | |
| DateTime endDate = ((MonthView)radCalEvents.CalendarView).MonthEndDate; | |
| SqlDataSource1.SelectParameters["MonthStartDate"].DefaultValue = startDate.ToString(); | |
| SqlDataSource1.SelectParameters["MonthEndDate"].DefaultValue = endDate.ToString(); | |
| SqlDataReader EventReader = ((SqlDataReader)((IEnumerable)SqlDataSource1.Select(DataSourceSelectArguments.Empty))); | |
| while (EventReader.Read()) | |
| { | |
| EventItem objEvent = new EventItem((int)EventReader["nID"], Convert.ToDateTime(EventReader["dEventDate"]), EventReader["sEventName"].ToString(), EventReader["sEventDescription"].ToString(), (int)EventReader["nEventCategoryID"]); | |
| EventArrayList.Add(objEvent); | |
| } | |
| EventReader.Close(); | |
| EventReader = null; | |
| } | |
| protected void radCalEvents_DayRender(object sender, Telerik.WebControls.Base.Calendar.Events.DayRenderEventArgs e) | |
| { | |
| DateTime currentDate = ((Telerik.WebControls.Base.Calendar.Events.DayRenderEventArgs)e).Day.Date; | |
| Table table = new Table(); | |
| e.Cell.Width = 95; | |
| table.Width = e.Cell.Width; | |
| table.Height = e.Cell.Height; | |
| table.CellPadding = 0; | |
| table.CellSpacing = 0; | |
| // Build the row for the day number | |
| TableRow dateRow = new TableRow(); | |
| TableCell dateCell = new TableCell(); | |
| dateCell.Width = e.Cell.Width; | |
| dateCell.CssClass = "DayNumber"; | |
| dateCell.Text = e.Day.Date.Day.ToString(); | |
| dateRow.Cells.Add(dateCell); | |
| table.Rows.Add(dateRow); | |
| // Look in the arraylist for any events on this day | |
| foreach (EventItem objEvent in EventArrayList) | |
| { | |
| if (objEvent.EventDate == currentDate) | |
| { | |
| // Add a row for the event | |
| TableRow itemRow = new TableRow(); | |
| TableCell itemCell = new TableCell(); | |
| itemCell.CssClass = "EventCell"; | |
| itemCell.Width = e.Cell.Width; | |
| // Set up the hyperlink for the event | |
| string itemText = objEvent.EventName; | |
| HyperLink itemLink = new HyperLink(); | |
| //link to a specific page for details of the event with the eventID as the parameter | |
| itemLink.NavigateUrl = "resources_eventDetails.aspx?eventid=" + objEvent.EventID; | |
| itemLink.Text = itemText; | |
| itemLink.CssClass = "EventLink"; | |
| itemLink.ToolTip = objEvent.EventDesc; | |
| itemCell.Controls.Add(itemLink); | |
| itemRow.Cells.Add(itemCell); | |
| table.Rows.Add(itemRow); | |
| } | |
| } | |
| } | |
| protected void radCalEvents_DefaultViewChanged(object sender, Telerik.WebControls.Base.Calendar.Events.DefaultViewChangedEventArgs e) | |
| { | |
| // Select events for the month when the month changes | |
| GetEventItems(); | |
| } | |
and then here is the partial code for the ASPX page:
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" |
| ConnectionString="<%$ ConnectionStrings:aec_devConnectionString %>" |
| DataSourceMode="DataReader" SelectCommand="SELECT * FROM [Event] WHERE (([dEventDate] >= @MonthStartDate) AND ([dEventDate] <= @MonthEndDate)) ORDER BY [dEventDate]"> |
| <SelectParameters> |
| <asp:Parameter Name="MonthStartDate" Type="DateTime" /> |
| <asp:Parameter Name="MonthEndDate" Type="DateTime" /> |
| </SelectParameters> |
| </asp:SqlDataSource> |
| <br /> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <br /> |
| <telerik:radajaxmanager id="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="radCalEvents"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="radCalEvents"></telerik:AjaxUpdatedControl> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:radajaxmanager> |
| <telerik:radcalendar id="radCalEvents" runat="server" OnDayRender="radCalEvents_DayRender" OnDefaultViewChanged="radCalEvents_DefaultViewChanged" font-names="Arial,Verdana,Tahoma" |
| height="500px" width="700px" ShowRowHeaders="False" Skin="WebBlue" CellAlign="Left" CellVAlign="Top" DayNameFormat="Full" ShowOtherMonthsDays="False" SingleViewRows="7" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" EnableMultiSelect="False" NavigationCellPadding="0" PresentationType="Preview" BorderColor="SteelBlue" BorderStyle="Solid" BorderWidth="1px"> |
| <SelectedDayStyle BackColor="LightSteelBlue" ForeColor="Transparent" /> |
| <DayStyle BorderStyle="Solid" BorderWidth="1px" Font-Names="Arial" Font-Size="Medium" |
| Height="100px" Width="100px" Wrap="True" BorderColor="SteelBlue" HorizontalAlign="Left" VerticalAlign="Top" Font-Underline="True" /> |
| <OtherMonthDayStyle ForeColor="Silver" Wrap="False" BorderColor="SteelBlue" BorderStyle="Solid" BorderWidth="1px" /> |
| <TitleStyle BackColor="White" BorderColor="Transparent" Font-Names="Verdana" Font-Size="12pt" /> |
| <WeekendDayStyle BorderStyle="Solid" BorderWidth="1px" Font-Names="Arial" Font-Size="Medium" |
| Height="100px" VerticalAlign="Top" Width="100px" BorderColor="SteelBlue" HorizontalAlign="Left" Wrap="True" /> |
| <CalendarTableStyle BorderColor="Transparent" HorizontalAlign="Left" |
| VerticalAlign="Top" /> |
| </telerik:radcalendar> |
Hi,
I have a problem with adding a toolbar in code in combination with the LoadToolsFile method of the RadEditor. When I use only one of them everything works fine. But when I use them both I only see the toolbar added from code. It doesn't change when I call the SetToolbar method after the creation of the dynamic toolbar.
I have the following code:
SetToolbar();
//add a new Toolbar dynamically
EditorToolGroup dynamicToolbar = new EditorToolGroup();
radTextEditor.Tools.Add(dynamicToolbar);
//add a custom dropdown and set its items and dimension attributes
EditorDropDown ddn = new EditorDropDown("DynamicDropdown");
ddn.Text =
"Dynamic dropdown";
//Set the popup width and height
ddn.Attributes[
"width"] = "110px";
ddn.Attributes[
"popupwidth"] = "240px";
ddn.Attributes[
"popupheight"] = "100px";
//Add items
ddn.Items.Add(
"Project Name", "{Project.Name}");
ddn.Items.Add(
"Person Firstname", "{Person.FirstName}");
ddn.Items.Add(
"Person Zipcode", "{Person.ZipCode}");
//Add tool to toolbar
dynamicToolbar.Tools.Add(ddn);
The method SetToolbar does the following:
private
void SetToolbar()
{
DAData dab = new DAData(ConfigurationManager.ConnectionStrings["configuration"].ConnectionString);
dab.CommandName =
"usp_RadEditorTools_Load";
dab.AddSqlParameter(
"projectId", long.Parse(ConfigurationManager.AppSettings["CNGRSProject"]));
dab.AddSqlParameter(
"resourceId", this.ResourceId);
string ret = (string)dab.GetReturnValue();
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(ret);
radTextEditor.LoadToolsFile(xmlDoc);
radTextEditor.EnsureToolsFileLoaded();
}
I guess I'm forgetting something... but I just cannot see what that is.
Can anybody help me on this one?
Bye,
Aldert
(I appologize if it is duplicate)
I'm trying to load a schedular in appointment mode, and get the appointment parameters like RecurrenceState and RecurrenceRule to save in my DB. How can I get AppointmentCreatedEventArgs params?
<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True"
AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"
DataSourceID="SqlDataSource1" GridLines="None" Skin="Hay"
AllowAutomaticInserts="True"
AllowAutomaticUpdates="True"
AllowAutomaticDeletes="True"
AllowMultiRowEdit="True"
>
<MasterTableView AutoGenerateColumns="False" DataKeyNames="ID_News"
DataSourceID="SqlDataSource1">
<RowIndicatorColumn>
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="ID_News" DataType="System.Int32"
HeaderText="ID_News" ReadOnly="True" SortExpression="ID_News"
UniqueName="ID_News">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Title" HeaderText="Title"
SortExpression="Title" UniqueName="Title">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Text" HeaderText="Text"
SortExpression="Text" UniqueName="Text">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Date" DataType="System.DateTime"
HeaderText="Date" SortExpression="Date" UniqueName="Date">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<FilterMenu EnableTheming="True" Skin="Vista">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
</telerik:RadGrid>
AllowAutomaticInserts="True" : this option is set up.
However, I can't see the Insert button inside the grid.
Update / Delete work fine though.
Any ideas ?
| <INPUT id=ctl15_ctl07_ctl02_ctl03_ctl02_9cfe62be-f27b-4b57-8329-46294c5e2cfe_RadPanelBar1_ClientState type=hidden value='{"expandedItems":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"logEntries":[],"selectedItems":[]}' name=ctl15_ctl07_ctl02_ctl03_ctl02_9cfe62be-f27b-4b57-8329-46294c5e2cfe_RadPanelBar1_ClientState autocomplete="off"> |
| <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Outlook" Width="100%" Height="100%" ExpandMode="SingleExpandedItem"> |
| <Items> |
| <telerik:RadPanelItem Value="Locations" Text="Locations" Expanded="true" PreventCollapse="true" |
| ImageUrl="Images/office-building.png" CssClass="mainPanel"> |
| <Items> |
| <%-- Current Location --%> |
| <telerik:RadPanelItem Value="CurrentLocation" Text="Current Location" Expanded="true" CssClass="subPanel" > |
| <ItemTemplate> |
| <div class="currentLocationDiv" id="LocationAddress"></div> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| <%-- Sub Locations Tree --%> |
| <telerik:RadPanelItem Value="SubLocations" Text="Sub Locations" Expanded="true" CssClass="subPanel"> |
| <ItemTemplate> |
| <asp:PlaceHolder runat="server" id="addTreeHere" /> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelBar> |
<%
@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="GateKeeper.Test" %>
<!
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>
<telerik:RadCodeBlock runat="server">
<script>
function Configuration() {
var oInput = $get('<%= TestTextBox.ClientID%>');
oInput.set_value(
'Test');
}
</script>
</telerik:RadCodeBlock>
</
head>
<
body onload="Configuration()">
<form runat="server" id="form1">
<telerik:RadScriptManager runat="server"></telerik:RadScriptManager>
<telerik:RadTextBox ID="TestTextBox" runat="server"></telerik:RadTextBox>
</form>
</
body>
</
html>
Please help!