Telerik Forums
UI for ASP.NET AJAX Forum
18 answers
768 views
Hello Telerik team,
I tried to found a solution how update RadScheduler after appoinment update but without success. For create/update appoinment I use iframe. On OnClientAppointmentInserting or OnClientAppointmentEditing I use   jQuery plugin PrettyPhoto to open iframe.
function onAppointmentInserting(sender, eventArgs) {
        eventArgs.set_cancel(true);
        var targetSlot = eventArgs.get_targetSlot();
        var categoryId = targetSlot.get_resource().get_key();
        var day = eventArgs.get_startTime();
        var date = '' + (1 + day.getMonth()) + '/' + day.getDate() + '/' + day.getFullYear();
        jQuery.prettyPhoto.open('../PopUpAppoinmentInsert.aspx?categoryId=' + categoryId + '&start=' + date + '&end=' + date + '&iframe=true&width=700&height=500', 'Calendar item..');
        jQuery('a.pp_close').css("display", "none");
    }
function OnAppointmentEditing(sender, eventArgs) {
   eventArgs.set_cancel(true);
   var eventId = eventArgs.get_appointment().get_id()
   jQuery.prettyPhoto.open('../PopUpAppoinmentInsert.aspx?eventId=' + eventId + '&iframe=true&width=700&height=500', 'Calendar item..');
   jQuery('a.pp_close').css("display", "none");
}
After user click Save 
protected void bSave_Click(object sender, EventArgs e)
       {
           try
           {
               CalendarCategory category = null;
               CalendarEvent calendarEvent = null;
               CalendarEventGovernor governor = new CalendarEventGovernor();
               CalendarCategoryGovernor categoryGov = new CalendarCategoryGovernor();
 
               //create entity
              // ...
              // then save
              governor.Save(calendarEvent);
               // after I write a javascript to close iframe and run my rebind method
               ClientScriptsHelper.RegisterScript("window.parent.jQuery.prettyPhoto.close();window.parent.rebind(1);", true);
           }
           catch
           {
            
           }             
       }

How I rebind data from javascript
<telerik:RadAjaxManager ID="RadAjaxManager2" runat="server" OnAjaxRequest="RadAjaxManager2_AjaxRequest" DefaultLoadingPanelID="RadAjaxLoadingPanel2" >
    <AjaxSettings>    
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager2">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadScheduler1"  />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
function rebind(schedule)
   {
       var ajax = $find('<%= RadAjaxManager2.ClientID%>');
       ajax.ajaxRequest("ReBindRadScheduler" + schedule);
   }
and server part
protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
 
            if (!IsPostBack)
            {
                cboCategory.DataSource = GetCategories();
                cboCategory.DataBind();
                cboCategory.Items[0].Selected = true;
                cboCategory.Visible = false;
                FillSchedule(RadScheduler1, 1);
                FillSchedule(RadScheduler2, 2);
                FillSchedule(RadScheduler3, 3);
                FillSchedule(RadScheduler4, 4);
                FillSchedule(RadScheduler5, 5);
            }         
        } 
 
protected void RadAjaxManager2_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e.Argument == "ReBindRadScheduler1")
                FillSchedule(RadScheduler1, 1);
           //......
            if (e.Argument == "ReBindRadScheduler5")
                FillSchedule(RadScheduler5, 5);
        }      
 
 private void FillSchedule(RadScheduler MainScheduler, int categoryId)
        {
            var defualtMinTime = TimeSpan.FromHours(6);
            var defualtMaxTime = TimeSpan.FromHours(23);
 
            MainScheduler.DayStartTime = defualtMinTime;
            MainScheduler.WorkDayStartTime = MainScheduler.DayStartTime;
 
            MainScheduler.DayEndTime = defualtMaxTime;
            MainScheduler.WorkDayEndTime = MainScheduler.DayEndTime;
 
            
            MainScheduler.Appointments.Clear();
 
            MainScheduler.DataSource = null;
            MainScheduler.DataBind();
            var categories=GetCategoriesResources(categoryId);  
            MainScheduler.ResourceTypes.First().DataSource =   categories;     
            //SchedulerToolTipManager.TargetControls.Clear();
            CalendarEventGovernor governor = new CalendarEventGovernor();
 
            MainScheduler.DataSource = governor.GetAllBy(categories.Select(x => x.Id).ToArray(), MainScheduler.SelectedDate, MainScheduler.SelectedDate.AddDays(MainScheduler.TimelineView.NumberOfSlots));
            MainScheduler.DataBind();
 
            MainScheduler.OnClientAppointmentInserting =  "onAppointmentInserting";
            MainScheduler.OnClientAppointmentEditing = "OnAppointmentEditing";
            MainScheduler.OnClientAppointmentMoveEnd = "OnClientAppointmentMoveEnd";
            MainScheduler.OnClientAppointmentMoveStart = "OnClientAppointmentMoveStart";
        }

RadScheduler populated on Init but not rebind after insert/update.  If I refresh page changes appear
David
Top achievements
Rank 1
 answered on 30 Oct 2014
1 answer
130 views
I need to execute some code if the user enters value rather than selecting it from the list, on a RadComboBox with AllowCustomText=true.  I am new to this tool so any suggestions will be appreciated.
Thanks!
Plamen
Telerik team
 answered on 30 Oct 2014
11 answers
398 views
Hello Again,

I am facing another issue. Again, there is a mix of controls. The problem is that c is null and an exception is thrown. I am using IE 10 to test by the way. Let me know if you require any additional information and I will post it.

Thanks,
John.

,_removeHandler:function(c,d,e){var a=null;
var b=c._events[d]||[];
for(var f=0,g=b.length;
f<g;
f++){if(b[f].handler===e){a=b[f].browserHandler;
break;
}}if($telerik.useDetachEvent(c)){c.detachEvent("on"+d,a);
}else{if(c.removeEventListener){c.removeEventListener(d,a,false);
}}b.splice(f,1);
Vessy
Telerik team
 answered on 30 Oct 2014
3 answers
157 views
GridGroupByExpression exp = GridGroupByExpression.Parse("group by " + name);
GridGroupByField field = new GridGroupByField();
field.FieldAlias = "Group";
field.FieldName = name;
exp.SelectFields.Add(field);
rg.MasterTableView.GroupByExpressions.Add(exp);
I have a rad grid that I am creating dynamicaly.
The grid has a drop down box control in it along with other fields such as text.

GridDropDownColumn gdc = new GridDropDownColumn();
gdc.Visible = visible;
gdc.DataField = uniqueName;
gdc.HeaderText = headerText;
gdc.ListTextField = "Value";
gdc.ListValueField = "ListValueId";
gdc.UniqueName = uniqueName;
gdc.DropDownControlType = GridDropDownColumnControlType.DropDownList;
When I group by the drop down column, I get it grouped by the value instead of the text. 

Is there a way to specify which one?

I need value and text to be different so making them the same is not a solution.
Eyup
Telerik team
 answered on 30 Oct 2014
1 answer
83 views
Filter is not working when GridHyperLinkColumn  is placed inside the DetailTables...............

I am using the telerik latest Version.
Tried in all these browsers. No luck
IE 9 and plus
Chrome
Firefox


Please help to resolve it.
Eyup
Telerik team
 answered on 30 Oct 2014
4 answers
107 views
I am trying to prevent wrapping of too long columns to the second line.
I was able to do it by cutting size of the

Protected Sub AllGrids_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)

        Dim intMaxLength As Integer = 60

        Dim grd As RadGrid = CType(sender, RadGrid)

        If (TypeOf e.Item Is GridDataItem) Then

            Dim gridItem As GridDataItem = CType(e.Item, GridDataItem)

            gridItem("Description").ToolTip = gridItem("Description").Text

            If gridItem("Description").Text.Length > intMaxLength Then
                gridItem("Description").Text = gridItem("Description").Text.Substring(0, intMaxLength) + "..."
            End If

        End If

    End Sub

In addition i have to do some manipulation on export to export full size field.

There are gotta be a better way though, right?
Eyup
Telerik team
 answered on 30 Oct 2014
3 answers
318 views
People accessing a page with Telerik controls using Apple device with Safari 7 all of a sudden get this error (all other web browsers are ok) ::

TypeError: undefined is not an object (evaluating 'Sys.WebForms.PageRequestManager')       Ajax.js:84
TypeError: undefined is not an object (evaluating 'Sys.WebForms.PageRequestManager')     Ajax.js:105

I'm not sure what code you need to see - so here is a link to the page on a staging server :: http://staging.oreb.ca/main/FindListings.aspx (make take a minute to load).

Rather urgent issue.  Timely response would be appreciated.

Thank you.

Paul


Dimitar
Telerik team
 answered on 30 Oct 2014
1 answer
98 views
We are creating an app where we want client to adjust (customize) the viewable grid form based on their prefrence.
So in some casses we want to show the grid 20 minutes.

For example 1 to 2 PM would have 3 time slot each for 20 minutes instead of 30 minutes. However, if another client want to set these slot to 30 or 40 minutes they could also do it.

So that can happen in this control?  
Bozhidar
Telerik team
 answered on 30 Oct 2014
1 answer
112 views
I had enabled the check all checkbox to let user select all records.

But I found that the check all function can select the rows in the current page only, it cannot select all other records in other page when paging is enabled.

because it will have several hundred records, user don't want to disable the paging function.

Is there any solution can select records in other page ?  Thanks.

Joe
Eyup
Telerik team
 answered on 30 Oct 2014
1 answer
157 views
Hi,

We use the grouping feature of RadGrid and would like it to display the total number of items in each group next to each group. It does this automatically if a group extends to another page. How do we get it to display the total number of items for each group? We will not know in advance which fields the end user groups by. We have looked at the RadGrid documentation for GroupHeaderTemplate but it is not clear how to achieve what we need.

Thanks

Tim Metcalfe
Eyup
Telerik team
 answered on 30 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?