Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
243 views
Hi

I've tried to add some custom text dynamically from code behind to the calendardays based on some different code examples. It's working fine on pageload and all events is displayed in the calendar for the current month. But I'm not able to change month and display events from other months. In fact i can only switch month one time ex: from jan -> feb.

I've tried a coupe of different code examples all with the same month-problem. Any idea what I'm doing wrong?

        protected override void OnInit(EventArgs e)
        {
            Hashtable eventHash = GetEventCollection(false);
            DateTime rcDate = RadCalendar1.CalendarView.ViewStartDate;
            while (rcDate <= RadCalendar1.CalendarView.ViewEndDate)
            {
                string key = rcDate.ToString("yyyy-MM-dd");
                if (eventHash.ContainsKey(key))
                {
                    List<Event> eventList = (List<Event>)eventHash[key];
                    CalendarDayTemplate template = new CalendarDayTemplate(RadCalendar1, rcDate, eventList.Count);
                }
 
                rcDate = rcDate.AddDays(1.0);
            }
            base.OnInit(e);
        }
 
public class CalendarDayTemplate : ITemplate
    {
        private Control cellContent = new Control();
        public CalendarDayTemplate(RadCalendar myCalendar, DateTime cellDate, int myData)
        {
            RadCalendarDay newDay = new RadCalendarDay();
            PlaceHolder myPlaceHolder = new PlaceHolder();
            Page myPage = new Page();
 
            HtmlGenericControl divContainer = new HtmlGenericControl("div");
            divContainer.Attributes.Add("class", "CalendarDayContainer");
 
            HtmlGenericControl divDate = new HtmlGenericControl("div");
            divDate.Attributes.Add("class", "Date");
            divDate.InnerText = cellDate.Day.ToString();
 
            divContainer.Controls.Add(divDate);
 
            HtmlGenericControl divEvent = new HtmlGenericControl("div");
            divEvent.Attributes.Add("class", "Event");
 
            if (myData > 0)
                divEvent.InnerText = string.Concat(myData, " events");
 
            divContainer.Controls.Add(divEvent);
 
            myPlaceHolder.Controls.Add(divContainer);
 
            this.cellContent = myPlaceHolder;
 
            // Create a DayTemplate with a unique ID 
            DayTemplate dayTemplate = new DayTemplate();
            dayTemplate.ID = cellDate.ToString("MMddyyyy");
            dayTemplate.Content = this;
 
            // create a SpecialDay, associate it with the DayTemplate and add to Calendar 
            newDay.Date = cellDate;
            newDay.TemplateID = dayTemplate.ID;
            myCalendar.SpecialDays.Add(newDay);
 
            myCalendar.CalendarDayTemplates.Add(dayTemplate);
        }
 
        // Once the RadCalendar is instantiated this will be called once for each cell
        public void InstantiateIn(Control container)
        {
            container.Controls.Add(this.cellContent);
        }
    }
Marin
Telerik team
 answered on 10 Jan 2011
2 answers
233 views
Hi all,

In my website, every user has his/her own color and background image for Menu which are already saved in the database.
For example, user A has Image1, and Orange color.
Now I would like to apply Image1 for Menu background and Orange for selected Item on Menu.
I don't want to create a CSS for each user. 
What I need is using one CSS for all users and modified the code in the Server side to set the background image and color of selected item for particular user.

Thanks.

Andy.
Andy
Top achievements
Rank 1
 answered on 10 Jan 2011
1 answer
56 views
Hi,

I would like to find out if its possible to create a n-tier application that uses Rad controls that bind to WCF and then bind to Entity Framework. i know my wording might be incorrect but basically what the tittle of this thread imply.

Thanks in advance
Kiara
Top achievements
Rank 1
 answered on 10 Jan 2011
0 answers
65 views
HI;
We are using Telerik Grid /Hierarchy with Templates
 there are two issue first can you please tell us is there any way we can bind the events in the Innertemplate of Grid
since current functionality does not support that.
2. Can you please also tell us how to find Data when we click on the OuterTemplate
for example Indexitem for which row was click.
Please Reply ASAP
Manishkumar
Top achievements
Rank 1
 asked on 10 Jan 2011
4 answers
124 views
Is it possible to bind the scheduler to a dataview that isn't populated by SQL server? I'm familiar with the UDF.. but I work on postgres, so that won't work from me. If not, is there another solution here that I could use?

Right now I'm doing a select on the appointments table, and I see my recurrence rule column is saving properly:

"DTSTART:20110107T171000Z
DTEND:20110107T173000Z
RRULE:FREQ=DAILY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR
"
But I can't seem to figure out how I can get the other days to see that recurring appointment.

Any suggestions?

Mitchell
Top achievements
Rank 1
 answered on 10 Jan 2011
2 answers
120 views
Hello, All,

Could somebody please give some info how to add new fonts to HTML editor control?

Thanks in adnvance, Rodion
Rodion
Top achievements
Rank 1
 answered on 10 Jan 2011
6 answers
815 views
Hello,  I'm using a RadGrid to display some data, and I want to be able to show or hide one of the cells based on the value of another cell on a particular row.  In this particular instance, I want to hide the "Accept" and "Reject" cells based on what the text in "Status" is for that particular row.  So if the "Status" field comes out to = "Accepted", i want the Accept and Reject cells to show. but if it says "Rejected" I don't want those button cells to show up. How can I do this?

<tel:RadGrid ID="rgReferrals" runat="server" DataSourceID="odsReferrals" EnableLinqExpressions="true"
            AllowFilteringByColumn="true" AllowPaging="true" AllowSorting="true"  AutoGenerateHierarchy="true"
            OnDetailTableDataBind="rgReferrals_DetailTableDataBind" OnPreRender="rgReferrals_PreRender" >
        <MasterTableView AutoGenerateColumns="false">
            <Columns>                  
                <tel:GridBoundColumn HeaderText="ID" DataField="ReferralID" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" />
                <tel:GridBoundColumn HeaderText="Status" DataField="Status" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" />
                <tel:GridButtonColumn HeaderText="Accept" ImageUrl="~/Content/Images/Icons/tick.png"
                    CommandName="Accept" ButtonCssClass="InoperatableButton" ButtonType="ImageButton" Text="Accept" />
                <tel:GridButtonColumn HeaderText="Reject" ImageUrl="~/Content/Images/Icons/cross.png"
                    CommandName="Reject" ButtonCssClass="InoperatableButton" ButtonType="ImageButton" Text="Reject" />
Devon
Top achievements
Rank 1
 answered on 10 Jan 2011
5 answers
80 views

Hi,

I would like to show the summary of appointment in monthview,  I am able to get the dataset formonth view. I am able to bind this dataset in month view, there are noexceptions. The problem is that I am not able to see my appointment in monthview.

Design code:

<telerik:RadScheduler ID="schAdminView"

                Width="700px"

                Height="400px"

                DataKeyField="AppoinmentId"

                DataSubjectField="ApptName"

                DataStartField="StrtTime"

                DataEndField="EndTime"

                DisplayDeleteConfirmation="true"

                SelectedView="DayView"

               

                Skin="Web20"

                runat="server"

                OverflowBehavior="Scroll"

                AdvancedForm-Enabled="false"

                ShowViewTabs="true"

                AllowEdit="true"

                ShowDateHeaders="true"      >

<MonthView VisibleAppointmentsPerDay="10"  />

</telerik:RadScheduler>

Sample dataset (Month view)

AppoinmentIdApptName       StrtTime              EndTime

   1        2Appt          3/9/2009 12:00:00 AM  3/9/2009 11:59:59 PM

   2           3Session       3/9/2009 12:00:00 AM  3/9/200911:59:59 PM

   3        2Appt          8/9/2009 12:00:00 AM  3/9/2009 11:59:59 PM

   4           3Session       8/9/2009 12:00:00 AM  3/9/200911:59:59 PM

Thanks

Sabarish

Veronica
Telerik team
 answered on 10 Jan 2011
1 answer
88 views
I have a simple category TreeView control with recID, parentID, categoryNames as datafieldID, dataFieldParentID, dataTextField respectively.

I also have a gridview control, whose datasource control gets recID value from TreeView control in order to populate the GridView control.

Datasource is as follow:

<asp:SqlDataSource ID="DS_catAttribute" runat="server"
        ConnectionString="<%$ ConnectionStrings:myCS %>"
        SelectCommand="sp_paramCatAttributeSelectGV"
        SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:ControlParameter ControlID="categoryTV" Name="catID"
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
</asp:SqlDataSource>

SelectedValue property for categoryTV (treeview control) returns categoryName instead of recID.

How can I get recID to pass it my store procedure?

Thank you
Canis Lupus
Top achievements
Rank 1
 answered on 10 Jan 2011
0 answers
69 views
I have a RadAjaxManagerProxy inside a UserControl. I have an ajaxfied ImageButton. The first time I click the button it sends a normal post-back, but then AJAX works fine.

Any idea?
I'm using Q3 2010.

Thanks
Jorge
Top achievements
Rank 1
 asked on 10 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?