Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
85 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
222 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
169 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
239 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
663 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
105 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
333 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
118 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
4 answers
77 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?