Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
105 views


Hi Telerik Support, 


I'm using a singlemonth calendar with autopostback false, showcolumn/row headers true, enablemultiselect true and all code on client side and i need to know all the days that  are going to be selected when i click on the column/header row. From what i saw i can get the row/column index but dont know how to get all the days in that row/column in the currentview.

Need this to see if the days exist in another array and see if i want to select/deselect or only select the dates that dont exist on the other array.

Thanks, 
António
Viktor Tachev
Telerik team
 answered on 08 Nov 2013
1 answer
146 views
Hi.
I am using a RadSearchBox in the filter template of a column "Country" .  But its not getting filtered . Can some one help me with some sample .
Princy
Top achievements
Rank 2
 answered on 08 Nov 2013
8 answers
524 views
Hi all 
Greeting of the day

I  have a problem
The problem is that i have a rad drop down with check box and in this drop down  user can select more than one value in this list 
select the check box from drop down and click  on search button ,system doesn't make search  untill we again click on search button. System perform search on first click if we we click any where on page after selecting check box .




Thanks 
Sushobhit Raman



Princy
Top achievements
Rank 2
 answered on 08 Nov 2013
6 answers
114 views
Hi, i have this problem, i have 30 minutes appointments and 30 minutes slots in the radscheduler, but some appointments are shifted,you can see it in the image.
It's happend with appointments that start after 16:00 only, i tried with just one appointment and it's shiffed to left.
I tried with 60 minutes slots and it's works perfectly, but with 30 minutes slots it'doesn't, why?
Boyan Dimitrov
Telerik team
 answered on 08 Nov 2013
1 answer
76 views
Hi 

There are few input fields and required field validators and I tried to display the error message inside the control which is not completely possible due to browser related issues. So I thought of alerting the error messages on validation failed. But how can I get the error messages in javascript so that I can display them in an alert box? Is this a possible requirement?

Thanks
Ivy
Shinu
Top achievements
Rank 2
 answered on 08 Nov 2013
4 answers
156 views
I'm just getting started with the Window control. I've placed a RadWindowManager on my form and created a window inside of it:

<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow ID="CVC" runat="server" Animation="Slide"
                Behavior="Resize, Close, Move, Reload" Behaviors="Resize, Close, Move, Reload"
                EnableShadow="True" Height="450px" NavigateUrl="/what_is_cvc.html"
                style="display:none;" Title="Security Code" Width="340px"
                KeepInScreenBounds="True" OffsetElementID="aCvc" VisibleStatusbar="False"
                VisibleTitlebar="True" ShowContentDuringLoad="True" Skin="Windows7">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

I'm opening the window when a link is clicked:
<a id="aCvc" href="#" onclick='radopen(null, "CVC");' >What is this? </a>

When I run it, it works, but the shadow is applied after the Window is shown. When I had a Top and Left offset defined, these were also applied after the Window was shown causing it to jump to a new position. How can I get the properties to apply before the Window is visible?
Marin Bratanov
Telerik team
 answered on 08 Nov 2013
6 answers
518 views
In my site we allow users to create html emails.  We create HTML templates that users edit using the RadEditor.  Afterwards they download the edited HTML and send the email using their own system.  The problem I'm having is with the Image Manager.  A user will upload an image and insert into the HTML but when they download the HTML the image no longer works.  Looking at the HTML that was generated, the image path is relative which is why it doesn't work.  My question is, is there a way to use a URL instead of a relative file path?

Thanks!
Ianko
Telerik team
 answered on 08 Nov 2013
3 answers
104 views
I have a RadAutoCompleteTextbox that loads a list of descriptions that a user is able to start typing and choose from, but i want to be able to do the following, as soon as  user chooses one of the available descriptions it loads the amount text box for it. How can i accomplish that?

I have the folllwing code for the autocomplete box, which works fine

private void grid_ItemCreated(object sender, GridItemEventArgs e)
    {

        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem editableItem = e.Item as GridEditableItem;
            TableCell cell = editableItem["Description"];
            if (cell.Controls.Count > 0 && cell.Controls[0] is RadAutoCompleteBox)
            {
                ((RadAutoCompleteBox)(cell.Controls[0])).TextSettings.SelectionMode = RadAutoCompleteSelectionMode.Single;
                ((RadAutoCompleteBox)(cell.Controls[0])).AllowCustomEntry = false;
                ((RadAutoCompleteBox)(cell.Controls[0])).DataSource = GetTableForAuto();
            }
        }

    }

What event is called when a user chooses a selection from the autocompletebox, and how would i be able to add the text for a different textbox?
Princy
Top achievements
Rank 2
 answered on 08 Nov 2013
1 answer
251 views
Hi,

I have successfully created a project with RadScheduler where I use a custom Appointment class (AllocationViewDataItem) and a custom Resource class (ExtendedResource). This project uses postbacks and a DataSource set in by calling a provider in Page_Load using the required parameters and setting the retrieved list of AllocationViewDataItems (custom appointments) as the DataSource of the scheduler.

var dataSource = DataManager.GetData(WebPart.ViewType, WebPart.DataFiltering, WebPart.ShowAllocationInLabel, selectedDate, numberOfWeeks, selectedRole);
 
Scheduler.DataSource = dataSource;

The custom appointments (AllocationViewDataItems) contain a string property called Resource that contains the key of the resource they are related to.

public class AllocationViewDataItem
    {
        public int Id { get; set; }
 
        public string Resource { get; set; }  //<------ This Property
        public DateTime Start { get; set; }
        public DateTime End { get; set; }
        public Color Color { get; set; }
         
        public string CustomText { get; set; }
 
        ...
    }

The resources and appointments are connected by setting the ForeignKeyField on the ResourceType:
var rType = new ResourceType("User") { ForeignKeyField = "Resource" };
Scheduler.ResourceTypes.Add(rType);
Scheduler.GroupBy = "User";

The scheduler uses the custom appointment class by defining these properties:

<telerik:RadScheduler runat="server"
    ID="Scheduler"
    DataStartField="Start"
    DataEndField="End"
    DataSubjectField="CustomText"
    DataKeyField="Id"
    ...
    >


 This works perfectly and the resources and allocations are shown as they should.

Now, I'd like to change the project so that the data is retrieved using web services because they constant postbacks are not too pretty. I have created a branch of the project that contains a web service that calls the same DataManager and returns a list of AllocationViewDataItems (just like the GetData method in the old Page_Load that was set as DataSource). However, the appointments are no longer matched with resources based on the ForeignKeyField of the ResourceType. No appointments are shown and when I hook into the OnClientAppointmentDataBound event I can see that the appointments are databound, but their collection of Resources is empty. Below is a dummy example of the web service methods (which does not work either):

[WebMethod]
public IEnumerable<AllocationViewDataItem> GetAppointments(ExtendedSchedulerInfo schedulerInfo)
{     
    return new List<AllocationViewDataItem>
               {
                   new AllocationViewDataItem
                       {
                           Id = 1,
                           Start = DateTime.Now,
                           End = DateTime.Now.AddHours(1),
                           CustomText = "Subject",
                           Resource = "test",
                           Color = Color.Red
                       }
               };
}
 
[WebMethod]
public IEnumerable<ResourceData> GetResources(ExtendedSchedulerInfo schedulerInfo)
{
    var res = new List<ResourceData>
               {
                   new ResourceData
                       {
                           Key = "test",
                           Type = "User",
                           Text = "Test"                                 
                       }
               };
    res[0].Attributes.Add("TestAttribute", "testvalue");
    return res;
}

The Scheduler defines the use of the web service and the AllocationViewDataItems as such:

<telerik:RadScheduler runat="server"
    ID="Scheduler"
    DataStartField="Start"
    DataEndField="End"
    DataSubjectField="CustomText"
    DataKeyField="Id"
    ...
    >
<WebServiceSettings Path="/_layouts/TestProject/ProjectAllocationDataService.asmx" ResourcePopulationMode="ServerSide" />
</telerik:RadScheduler>

The custom appointments are simply not connected to the resources so they are not shown. If I use AppointmentData instead and assigns a specific ResourceData object to the Resources property it works, but would mean that I would have to redo a quite a bit of code so I would prefer not to.

Is it not possible to use the ForeignKeyField to combine a custom Appointment class to resources when using Web Services to retrieve data?

Another issue is that I can't successfully use the Attributes property of the ResourceData class. When I add an item to the Attributes collection in the web service method it is not transfered to the Resource class created behind the scenes. I have checked this by adding an item to the Attributes collection in the web service method "GetResources" and then inspecting the Resource class retrieved in the OnResourceHeaderCreated event (here the Attribute collection is empty). See the two attached images. This is an issue as I need to transfer a custom URL property to the resource to make it clickable. 
The attributes are successfully transfered from AppointmentData to the Appointment (adding attribute to AppointmentData object in web service method and retrieving the attribute value in OnClientAppointmentDataBound).

I hope you can help me with either of the two issues.

/Michael
Boyan Dimitrov
Telerik team
 answered on 08 Nov 2013
1 answer
125 views
the default view,  such as
  • id       name 
  • 1          tom
  • 2          jack

but when I user the custom sort,the radgrid view become follows:

  • id       name 
  • 1          tom            system.data.datarowview     system.data.datarowview
  • 2          jack           system.data.datarowview       system.data.datarowview
when I sort one time,the view will add two columns,who can help me?
the source code:
protected void Page_Init(object sender, EventArgs e)
      {
              GridBoundColumn idColumn = new GridBoundColumn();
              idColumn.DataField = "Id";
              idColumn.Display = true;
              idColumn.SortExpression = "Id";
              idColumn.UniqueName = "Id";
              idColumn.HeaderText = "Id";
              RadGrid1.MasterTableView.Columns.Add(idColumn);
          
              GridBoundColumn realNameColumn = new GridBoundColumn();
              realNameColumn.DataField = "RealName";
              realNameColumn.Display = true;
              realNameColumn.HeaderText = "name";
              realNameColumn.UniqueName = "RealName";
              realNameColumn.SortExpression = "RealName";
              RadGrid1.MasterTableView.Columns.Add(realNameColumn);
 
      }
 
protected void Page_Load(object sender, EventArgs e)
      {
              IDAL.IBaseRepository<Model.HS_Docter> doctors = new DAl.BaseRepository<Model.HS_Docter>();
              RadGrid1.DataSource = doctors.GetDataTable("select * from Hs_doctor");  
      }
 
protected void RadGrid1_SortCommand(object sender, GridSortCommandEventArgs e)
      {
 
 
          IDAL.IBaseRepository<Model.HS_Docter> doctors = new DAl.BaseRepository<Model.HS_Docter>();
          switch (e.OldSortOrder)
          {
               
              case GridSortOrder.Ascending:
               
                  e.Item.OwnerTableView.DataSource = doctors.GetDataTable("select * from hs_doctor").Select("", e.CommandArgument.ToString() + " asc");
                  break;
              case GridSortOrder.Descending:
                  e.Item.OwnerTableView.DataSource = doctors.GetDataTable("select * from  hs_doctor" ).Select("", e.CommandArgument.ToString() + " desc"); ;
                
              break;
          }
         
          
 
         
      }

Princy
Top achievements
Rank 2
 answered on 08 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?