Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
169 views
Sometimes my Elmah logs shows(note there is no namespace of my application code),

System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Web.UI.AsyncPostBackTrigger.HasTriggered()
   at System.Web.UI.UpdatePanelTriggerCollection.HasTriggered()
   at System.Web.UI.PageRequestManager.ProcessUpdatePanels()
   at System.Web.UI.PageRequestManager.RenderPageCallback(HtmlTextWriter writer, Control pageControl)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Page.Render(HtmlTextWriter writer)
   at Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Page.Render(HtmlTextWriter writer)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Maria Ilieva
Telerik team
 answered on 30 Oct 2014
0 answers
80 views
Hi, 

I have a grid, where i had done a grouping with InvoiceNumber, and also i need to sum a particular column. Everything was fine, but now i want sum the column based on some condition. (i.e) i have column called "Cancelled".   need to sum the column where Cancelled > 5. How can i achieve this? 


Velkumar
Top achievements
Rank 1
 asked on 30 Oct 2014
1 answer
216 views
Is it possible to trigger the notification show() on the call back update function? Especially when the notification was created dynamically.

RadNotification notification = new RadNotification();
notification.LoadContentOn = Telerik.Web.UI.NotificationLoad.TimeInterval;  
notification.UpdateInterval = 20000;
notification.CallbackUpdate +=_notification_CallbackUpdateOnTime;
 
 
        protected void _notification_CallbackUpdateOnTime(object sender, RadNotificationEventArgs e)
        {
             if( <some condition>)
             {
                ((Telerik.Web.UI.RadNotification)(sender)).Show();
             }
        }


Marin Bratanov
Telerik team
 answered on 30 Oct 2014
5 answers
166 views
Just curious if anyone has figured a way to dynamically resize the Gannt chart on the client side. I've tried resizing the entire div container but it looks like I'd have to do every container inside the main div. Is there an easier way?
Sam
Top achievements
Rank 1
 answered on 30 Oct 2014
3 answers
221 views
Hello,

     I am hoping that someone can help with a requirement I'm trying to accomplish.  What I am trying to accomplish is when a new record is added I am wanting to hide the label and entry textbox based on the value of a dropdown.  I have been able to successfully hide the textbox but I can't find a way to hide the label.  From browsing the net and reading other forums I used the EditFormHeaderTextFormat property to set to empty and it does hide the label, but the issue now is setting the value in the code behind in the selectedindexchanged event back to a value.  I have included sample code for what I have below.  If anyone knows an alternate solution that would work please let me know.

Aspx
<telerik:GridTemplateColumn EditFormHeaderTextFormat="" DataField="CHIPReasonOther" DataType="System.String" FilterControlAltText="Filter Reason column" HeaderText="Define Other" SortExpression="ReasonOther" UniqueName="CHIPReasonOther">
                        <EditItemTemplate>
                            <telerik:RadTextBox ID="txtCHIPReasonOther" runat="server" Width="275px" MaxLength="50" Visible="false"></telerik:RadTextBox>
                            <asp:RequiredFieldValidator ID="rqdReasonOther" ControlToValidate="txtCHIPReasonOther" runat="server" ErrorMessage="Required" CssClass="validation" Enabled="false" Display="Dynamic"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblCHIPReasonOther" runat="server" Text='<%# Bind("CHIPReasonOther") %>' Enabled="True" Visible="true" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>

Code behind
protected void rcbTempOOH_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            RadComboBox rcbSender = (RadComboBox)o;
            GridEditFormItem item = rcbSender.NamingContainer as GridEditFormItem;
            RadTextBox txtCHIPReasonOther = item.FindControl("txtCHIPReasonOther") as RadTextBox;
            RequiredFieldValidator rqdReasonOther = item.FindControl("rqdReasonOther") as RequiredFieldValidator;
            var selectedItem = e.Text;
            selectedItem = Regex.Replace(selectedItem, @"\s+", "");
            txtCHIPReasonOther.Text = string.Empty;
 
            if (selectedItem == "Other")
            {
                txtCHIPReasonOther.Visible = true;
                rqdReasonOther.Enabled = true;
            }
            else
            {
                txtCHIPReasonOther.Visible = false;
                rqdReasonOther.Enabled = false;
            }
        }

Eyup
Telerik team
 answered on 30 Oct 2014
18 answers
656 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
101 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
328 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
113 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
57 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
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?