Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
224 views
Hey,
I'm working on fileExplorer and I need to do the following scenario:
- When the user clicks on the file/folder => the path of the file/folder should be posted to the server side.
I've tried to invoke server side method from onClientSide event using PageMethods, but that didn't work !!
Can you help me?

Here's the code using PageMethods:
JavaScript
  
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server" EnablePageMethods="true">
 </telerik:RadScriptManager>
 <telerik:RadFileExplorer ID=
"RadFileExplorer1" runat="server" Skin="WebBlue"   onitemcommand="RadFileExplorer1_ItemCommand" OnClientItemSelected="GetMessage()">


<script type="text/javascript">
 
function OnGetMessageSuccess(result, userContext, methodName) {
        alert(result);<br>    }
 
function OnGetMessageFailure(error, userContext, methodName) {
     alert(error.get_message());  }
   
function GetMessage(sender, args) {     
   PageMethods.Message();}
</script>

CS
 
     [System.Web.Services.WebMethod]
      
public static void Message()
     { label1.Text =
"YES!";<br>        }

Dobromir
Telerik team
 answered on 03 Aug 2011
4 answers
316 views
Hi,

I want to change the current window icon url on radio button click.
i have tried that with following code but its not working .
Please suggest for the same.

 function test() {         

         var parentPage = GetRadWindow().BrowserWindow;
          var currentwindow = parentPage.GetRadWindowManager().getActiveWindow();
         var reportType =2;
         iconUrl='../images/icon2.png';

          if(reportType==1)
               currentwindow .set_iconUrl(iconUrl);    
          else if (reportType == 2)
              currentwindow .set_iconUrl(iconUrl);  
          else
               currentwindow .set_iconUrl(iconUrl);    

     }  
set_iconUrl(iconUrl);     this method is working in parent page, where radwindow is defined.
Marin Bratanov
Telerik team
 answered on 03 Aug 2011
1 answer
122 views

It seems that I am missing something when I tried to change the style of an appointment.  I am catching the AppointmentDataBound event, and I set the CssClass, but it seems that it gets changed to “rsAptContent” after this event and I don’t know where.  Any help someone could provide would be much appreciated.

 

    Protected Sub RadSchedulerInterventions_AppointmentDataBound(ByVal sender As Object, ByVal e As SchedulerEventArgs)

        Dim EndDateFinalized As Boolean = e.Appointment.Attributes("EndDateFinalized")

 

        If EndDateFinalized Then

            e.Appointment.CssClass = "rsCategoryPattern"

            e.Appointment.BorderColor = Drawing.Color.FromName("#B0CC9B")

        Else

            e.Appointment.BackColor = Drawing.Color.FromName("#edd5b7")

            e.Appointment.BorderColor = Drawing.Color.FromName("#cdb597")

        End If

    End Sub

Peter
Telerik team
 answered on 03 Aug 2011
1 answer
90 views
Hi,

I have 2 class files.

public class Employee
    {
        public int EmpId { get; set; }
        public string EmpName { get; set; }
        public IList<Dept> DeptCollection { get; set; }
    }

public class Department
    {
        public int DeptId { get; set; }
        public string DeptName { get; set; }
    }

I am fetching ILIST<Employee> and binding it to my radgrid.

I want to display something like
EmpId   EmpName   DeptName

in the
<telerik:GridBoundColumn ReadOnly="true" HeaderText="Employee Name"DataField="EMP_NAME" />

but how can I bind the deptname field from the nested object?

Regards,
aradhya
           



Daniel
Telerik team
 answered on 03 Aug 2011
1 answer
36 views
In a telerik grid(dynamically created.) when we are checking on the checkbox,the back color of that row is disappering. I want the color to remain as is it,while checking on the check box.



In our telerik grid ,  we gave skin="Windows7". After new insertion of records, that particular row of the grid is becoming megenta colour(backgroundcolour). Now when we are clicking(checking the checkbox) on the chechbox(telerik:GridClientSelectColumn) , the background colour of the particular row is vanishing. But again if we uncheck the checkbox , the colour is coming back. 
I want the background colour to remain as it is , even if we r checking the chechkbox.
Maria Ilieva
Telerik team
 answered on 03 Aug 2011
3 answers
280 views
Hi all,
I have develop a Telerik Radscheduler in that i have write the code like below in iwant disable/Enable the perticuler time-slot for an event,in this disable is working fine but enable not working i can't understand why it is not enable to allow-insert.please help me where i need to change to resolve this problem...


            protected void RadScheduler1_TimeSlotCreated1(object sender, TimeSlotCreatedEventArgs e)
      {


        //Getting Business hour time
        mybusinesscalendarEntities objEntity = new mybusinesscalendarEntities();
        var Result = from bhours in objEntity.businesshours where bhours.BusinessId == businessid select bhours;
        if (Result.Count() > 0)
        {
            var Hours = (from bhours in objEntity.businesshours where bhours.BusinessId == businessid select bhours).First();
           


            //Get particular day businee hour timings and disable the time slot 


            string Day = System.DateTime.Today.DayOfWeek.ToString();
            if (Day == "Monday")
            {
                string WorkDay = Hours.MondayFromTime.Value.ToShortTimeString();
                string WorkDayStart = WorkDay.Remove(WorkDay.Length - 2, 2);
                string WorkDayEnd = Hours.MondayToTime.Value.ToShortTimeString();
                string WorkDayEndTime = WorkDayEnd.Remove(WorkDayEnd.Length - 2, 2);
                if ((e.TimeSlot.Start.TimeOfDay < TimeSpan.Parse(WorkDayStart.Trim())) || (e.TimeSlot.Start.TimeOfDay > TimeSpan.Parse(WorkDayEndTime.Trim())))
                {
                    e.TimeSlot.CssClass = "Disabled";
                    RadScheduler1.ReadOnly = true;
                }


                else


                {
                  
                    RadScheduler1.ReadOnly = false;
                    RadScheduler1.AllowInsert = true;
                    RadScheduler1.AllowEdit = true;
                    RadScheduler1.AllowDelete = true;
                    
                }
Peter
Telerik team
 answered on 03 Aug 2011
1 answer
148 views
Is it possible to use use the sitemap as a breadcrumb with a tabstrip that is binding to a web.sitemap . Something like is provided for the menu control in the http://demos.telerik.com/aspnet-ajax/menu/examples/programming/showpath/defaultcs.aspx demo but using a tabstrip instead.

Thanks,
Brian
Kate
Telerik team
 answered on 03 Aug 2011
1 answer
30 views
Hi,

I have the grid bound to the list of objects. Object properties are two types:
Simple (just value) and HTMLRepresentation (which build the custom HTML based on the value of the simple property), which is binded to the row cell value.

What I need is to show the Simple Value on the Edit row command. Saving this value will update the HTMLRepresentation property and the grid will show what I need.

Another question is that what should I do, if the list of edited values different from the being shown. So, how can I create some kind of custom row editor?

Thanks in advance,
Mykhaylo
Andrey
Telerik team
 answered on 03 Aug 2011
5 answers
215 views
Hi, I am having a very silly issue, but I just can't see what I am doing wrong.

Basically, I have a standard System ComboBox that contains three items and I have added a SelectionChanged event.  This all works nicely and does what I expect.   I want to change this to a Telerik RadComboBox, so I change the gadget type to RadComboBox and change the eventArgs from System to Telerik.

My problem comes when I run the page, I can drop down the combo list, but selecting one of the values doesn't work.  Clicking on an option does nothing most of the time, occationally it will select but I can't find a way to repeat it.   With the drop down list closed I can use the mouse wheel and the cursor key to scroll through the options without a problem and the event fires as expected.

Any ideas why the mouse selection isn't working consistantly?

Many thanks.
Thad
Top achievements
Rank 2
 answered on 03 Aug 2011
1 answer
87 views
Hi, 

I would like to know if it's possible for a window (modal) to open another window modal as well.

Also, I tried multiple ways to open a window using server code but none seems to work if your window is used as a control container.

Here an example

I have this page :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Page1.aspx.cs" Inherits="RadWindowTest.Page1" %>
 
<%@ 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">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Button1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <asp:Label ID="lbl" runat="server" Text="PAGE 1" Font-Size="Larger"></asp:Label><br />
        <asp:Button ID="Button1" runat="server" Text="Show Second Window"
            onclick="Button1_Click" />
        <telerik:RadWindow ID="RadWindow1" runat="server"  runat="server" Behaviors="Close" DestroyOnClose="true" VisibleStatusbar="false" AutoSize="true" Modal="true">
            <ContentTemplate>
                <asp:DropDownList ID="DropDownList1" runat="server"></asp:DropDownList>
            </ContentTemplate>
        </telerik:RadWindow>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        </telerik:RadWindowManager>
    </div>
    </form>

     <script>
         function open() {
            /*
             var x = $find("<%= RadWindow1.ClientID %>");
             x.show();
             return false;
            */
         }
    </script>
</body>
</html>

Which open the window on the button click
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace RadWindowTest
{
    public partial class Page1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void Button1_Click(object sender, EventArgs e)
        {
            DropDownList1.Items.Add(new ListItem(DateTime.Now.ToShortDateString(), DateTime.Now.ToShortDateString()));
            RadWindowManager1.Windows.Add(RadWindow1);
//ClientScript.RegisterClientScriptBlock(this.GetType(), "open", "<script>open();</script>");
        }
    }
}


What am I missing here ?



Marin Bratanov
Telerik team
 answered on 03 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?