Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
152 views
I create an Appointment template dynamically and I want to create a Hyperlink as subject. The problem that I have is that I need to use a value of the Datatable that is datasource of the RadScheduler. See definition of the DataTable.  IN the AppointmentDataBound I know I can use the DataRowVIew to get the values of the DataItem but in the Appointment Template does not work. How can I get the values of the DataItem in the appointment Template? See the appointment template below.


 

 

protected void RadScheduler_AppointmentDataBound(object sender, SchedulerEventArgs e)

 

{

 

 

if (e.Appointment.DataItem != null)

 

{

 

 

int argb = Int32.Parse(((System.Data.DataRowView)(e.Appointment.DataItem)).Row.ItemArray[11].ToString().Replace("#", ""), NumberStyles.HexNumber);

 

e.Appointment.BackColor =

 

Color.FromArgb(argb);

 

}

 

}


/*****DataTable definition*****/

DataTable

 

 

dtAppointments = new DataTable("Appointments");

 

dtAppointments.Columns.Add(

 

"ItemID", typeof(string));

 

dtAppointments.Columns.Add(

 

"Title", typeof(string));

 

dtAppointments.Columns.Add(

 

"CalendarType", typeof(string));

 

dtAppointments.Columns.Add(

 

"StartDate", typeof(DateTime));

 

dtAppointments.Columns.Add(

 

"EndDate", typeof(DateTime));

 

dtAppointments.Columns.Add(

 

"hasEndDate", typeof(bool));

 

dtAppointments.Columns.Add(

 

"Description", typeof(string));

 

dtAppointments.Columns.Add(

 

"Location", typeof(string));

 

dtAppointments.Columns.Add(

 

"RecurrenceRule", typeof(string));

 

dtAppointments.Columns.Add(

 

"RecurrenceParentID", typeof(Int64));

 

dtAppointments.Columns.Add(

 

"IsRecurrence", typeof(bool));

 

dtAppointments.Columns.Add(

 

"Color", typeof(string));

 

dtAppointments.Columns.Add(

 

"NavigationUrl",typeof(string));

/******* AppointTemplate Class.I took this from the forum*****/

 

 

 

public class AppTemplate : ITemplate

 

 

 

 

 

{

 

 

public void InstantiateIn(Control container)

 

{

 

 

Literal subject = new Literal();

 

subject.DataBinding += subject_DataBinding;

container.Controls.Add(subject);

}

 

 

private void subject_DataBinding(object sender, EventArgs e)

 

{

 

 

Literal subject = (Literal)sender;

 

 

 

IDataItemContainer aptContainer = (IDataItemContainer)subject.BindingContainer;

 

 

 

 

 

int argb = Int32.Parse(((System.Data.DataRowView)(aptContainer.DataItem)).Row.ItemArray[11].ToString().Replace("#", ""), NumberStyles.HexNumber);

 

 

 

int lId = Convert.ToInt32(DataBinder.Eval(aptContainer.DataItem, "ID"));

 

 

 

string strSubject = HttpUtility.HtmlEncode((string)DataBinder.Eval(aptContainer.DataItem, "Subject"));

 

 

 

SPWeb oWeb = null;

 

oWeb =

 

SPContext.Current.Web;

 

 

 

String requestListName = "TravelCalendarList";

 

 

 

SPListItem itm = oWeb.Lists[requestListName].GetItemById(Convert.ToInt32(lId));

 

 

 

if (itm != null)

 

{

 

 

if (null != itm["RequestId"])

 

{

subject.Text =

 

"<a href=\"" + oWeb.Url + "/default.aspx?ListId=" + lId + "\">" + strSubject + "</a>";

 

}

 

 

else

 

 

 

 

 

{

subject.Text = strSubject;

}

}

}

}

}

Peter
Telerik team
 answered on 14 Sep 2011
1 answer
90 views
Hello,

in our current development, we make heavy use of fixed size buttons, decorated in Vista style.

the issue we have is that, when testing in IE9, the button is not rendered correctly, looks like a space appears between the rounded part of the button on the right and the rest of the button

I do not have a screenshot at hand, but is this issue already identified ? Is there a workaround out of getting rid of fixed sized buttons ?

Best regards

Philippe
Bozhidar
Telerik team
 answered on 14 Sep 2011
3 answers
365 views
Under ASP.NET 4.0,  when using System.Web.Routing  (URL Routing)  with telerik controls on the rendered page.  I am encountering ASP.NET Ajax client-side framework failed to load.

<

 

 

script src="/ThriventPromoRad40/WebResource.axd?d=kuV-9BW9vUE9mrfKFZ3iarEeZ53VRoFdPvU6l_eVkRJWggZVCdkkPTfmCxIghLXyMbupWxfy9hdfoXjjTxbduMDzGQNVIEKoR1dpIpiTxB81&amp;t=634226478236080422" type="text/javascript"></script>

 

<

 

 

script src="/ThriventPromoRad40/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&amp;compress=1&amp;_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1f68db6e-ab92-4c56-8744-13e09bf43565%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%3aen-US%3aaa801ad7-53c4-4f5c-9fd3-11d99e4b92f4%3a16e4e7cd%3aed16cbdc%3a7165f74" type="text/javascript"></script>

 

<

 

 

script type="text/javascript">

 

//<![CDATA[

if

 

 

(typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');

 


 
If I remove the routing options or if I replace the Telerik controls with generic ASP.NET controls.  (IE: Radbutton with ImageButton).  The page functions correctly. 

Any suggestions?

Brete


Erik
Top achievements
Rank 2
 answered on 14 Sep 2011
3 answers
164 views
Having another issue with the RadSplitter, in that if you had a minimum size, or the header is smaller than a certain size... then when trying to reduce it past this size.. we get a transparent splitter.. as you can see in the following video (from the telerik demo) (this was tested in IE7, 8 and 9.. the video shows IE9)

http://www.youtube.com/watch?v=8pUvnGGpTOA

Niko
Telerik team
 answered on 14 Sep 2011
3 answers
143 views

Is there any way to put image in right side of the toolbar , while RadButtons are in left order?

I have a lot of space in my toolbar and I need to use it for Logo.

The best is if I can have some of RadButtons in right order

 

Kate
Telerik team
 answered on 14 Sep 2011
3 answers
160 views
Hi,

I'm currently working on a website that needs a 'price' slider from £100 to £100,000, with two pickers.

Most customers will slide values between £100 - £4,000 with perhaps 5% or less looking in a range up to £100,000

Other than writing custom multipliers when the slider reaches certain points, is there any built-in property of the rad slider which allows you to have 50% of the physical slider represent half the range (e.g. £100 to £4,000) and then the remaining 50% to represent the final half (e.g. £4,100 - £100,000)?

This would be useful for people who want to dynamically represent min and max values in their databases too, especially if they have a few records with exceptionally high or low values.

Cheers!
Niko
Telerik team
 answered on 14 Sep 2011
1 answer
86 views
Hi,
            I am using Radscheduler to show appointments, but here the problem is when ever i am trying to decrease the Radscheduler size by giving Daystart and Dayend time, the calender popup is going beyond to scheduler, i am attaching the screen shot with this thread, the problem which i am facing. Please look into that and help me out as early as possible, its very urgent requirement.
Peter
Telerik team
 answered on 14 Sep 2011
8 answers
254 views
am using assembly RadSplitter.Net2

The method 
splitter.GetPaneById('EndPane')
throws error as object doesnt support this property or method...
This is where am calling the method...OnClientLoaded="CollapsePane()".
code is
function CollapsePane()
{
var splitter = "<%= RadSplitter1.ClientID %>";
var pane = splitter.GetPaneById('EndPane');
}

The following is the pane code
 <radspl:RadSplitter ID="RadSplitter1" runat="server" Height="100%" LiveResize="true" OnClientLoaded="CollapsePane()"
                        ResizeWithBrowserWindow="true" Width="100%" Skin="Outlook" BorderSize="0" BorderStyle="None">
 <radspl:RadPane ID="EndPane" runat="server" Scrolling="none" Width="22" MinWidth="22"
                            Visible="false">
                            <radspl:RadSlidingZone ID="Radslidingzone1" runat="server" Width="22"  SlideDirection="Left"
                                ClickToOpen="false">
                                <radspl:RadSlidingPane ID="Radslidingpane5" Title="Sections" runat="server" Width="150"
                                    TabView="TextAndImage" IconUrl="../assets/favorites.gif" >
                                    <div id="radSecSub">
                                    <table class="right_navigation" id="tblRightPane" runat="server">
                                    </table>
                                    </div>
                                </radspl:RadSlidingPane>
                            </radspl:RadSlidingZone>
                        </radspl:RadPane>
                    </radspl:RadSplitter>
Niko
Telerik team
 answered on 14 Sep 2011
5 answers
243 views
Hi,

I am working on Telerik RadScheduler.

I have different sessions called screening, evaluation, discussions and etc....

So depending upon the dates of the above sessions, I have to highlight the calendar in Radscheduler.
All the other dates other than this should be blocked.

For example:
Screening : 2/23/2011 to 3/29/2011
Evaluation :4/12/2011-4/30/2011
Discussions-1/2/2011-1/5/2011.

All the dates other than this should be blocked and not be highlighted to the user.Is there any way to do it?
Peter
Telerik team
 answered on 14 Sep 2011
10 answers
355 views
We're trying to use a RadWindow for printing some information entered by the user:

Here are the basic steps we're using in code behind:
  • New up a RadWindow

RadWindow window = new RadWindow();
window.ID = "windowShowPrintDialog";
//window.NavigateUrl = "PrintAdHoc.aspx";
window.VisibleOnPageLoad = true;
window.Modal = true;
window.Width = 200;
window.Height = 300;

  • Use LiteralControl to add info and JavaScript to window

string jsPrint = null;
using (StreamReader sr = new StreamReader(Server.MapPath("PrintWindowJavaScript.txt")))
{
    jsPrint = sr.ReadToEnd();
}
 
window.ContentContainer.Controls.Add(new LiteralControl(jsPrint));
 
...
 
 
 
window.ContentContainer.Controls.Add(new LiteralControl(name));
window.ContentContainer.Controls.Add(new LiteralControl(startdate));
window.ContentContainer.Controls.Add(new LiteralControl(enddate));
window.ContentContainer.Controls.Add(new LiteralControl("<button onclick=\"printWin(); return false\">print content</button><br />"));


  • PrintWindowJavaScript.txt is:

<script type="text/javascript">
function GetRadWindow()
{
    var oWindow = null;
    if (window.radWindow) oWindow = window.radWindow;
    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
    return oWindow;
}
 
 
 function printWin()
            {
                var oWnd = GetRadWindow();
                var content = oWnd.GetContentFrame().contentWindow;
                var printDocument = content.document;
                if (document.all)
                {
                    printDocument.execCommand( "Print");
                }
                else
                {
                    content.print();
                }
 
            }  
 
</script>
  • Show window by adding it to the for controls

this.Form1.Controls.Add(window);


The RadWindow is displayed along with the print button.  When the print button is clicked, we get a java script error:

Microsoft JScript runtime error: Object required

at (see bold text):

function GetRadWindow()
{
    var oWindow = null;
    if (window.radWindow) oWindow = window.radWindow;
    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
    return oWindow;
}

Is it possible to print and/or run javascript code from a RadWindow created like this?

Thanks,

Jerry



Marin Bratanov
Telerik team
 answered on 14 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?