Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
120 views
I have a textbox in a template column. I can't get the value using the same technique as for a bound column. What is the syntax for retrieving this value both in client-side JavaScript and server-side C#?

I would like to sum the values for all the textboxes in the column in codebehind TextChanged and also sum them clientside with Javascript.


....
 <telerik:GridTemplateColumn HeaderText="Amount Approved" UniqueName="AmtApproved" HeaderStyle-Width="55px"
                            ItemStyle-Width="55px" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right">
                            <ItemTemplate>
                                <asp:TextBox ID="AmountApproved" runat="server" Width="55px" OnTextChanged="AmountApproved_TextChanged"
                                    AutoPostBack="true" CssClass="numericAlign"></asp:TextBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right">
                        </telerik:GridClientSelectColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowKeyboardNavigation="true" EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                    <ClientEvents OnRowSelected="handleTextBoxValue" OnRowDeselected="handleTextBoxValue" OnActiveRowChanged="sumAmtApproved" />
                    <Selecting AllowRowSelect="true" />
                </ClientSettings>
            </telerik:RadGrid>
Thomas Derenthal
Top achievements
Rank 1
 asked on 31 Oct 2014
1 answer
111 views
I've been trying to make the RadEditor DocumentManger control work with a UNC path. Admin on the forum gave me this link but it's only for the <Telerik:RadFileExplorer> control.

How do I override the file provider for <telerik:RadEditor><telerik:EditorTool name="DocumentManager">
Andrew
Top achievements
Rank 1
 answered on 30 Oct 2014
2 answers
185 views
Can anyone explain why I get the following error?

System.Web.HttpParseException (0x80004005): Type 'Telerik.Web.UI.Calendar.DatePickerClientEvents' does not have a public property named 'OnLoad'. ---> System.Web.HttpException (0x80004005): Type 'Telerik.Web.UI.Calendar.DatePickerClientEvents' does not have a public property named 'OnLoad'.

The Telerik documentation on this page http://www.telerik.com/help/aspnet-ajax/input-client-side-onload.html states the following:
  The OnLoad event is supported by all RadInput controls.

Here's my markup:
<telerik:RadDateTimePicker
      ID="m_dpTargetDate"
      runat="server">
         <ClientEvents OnLoad="m_dpEventBegin_Load" />
</telerik:RadDateTimePicker>

<script type="text/javascript">
var m_dpEventBegin = null;
function m_dpEventBegin_Load(sender, args) {
      m_dpEventBegin = sender;
}
</script>

I can get other client-side events to fire.

Any help would be greatly appreciated.
Kennon McCaa
Top achievements
Rank 1
 answered on 30 Oct 2014
1 answer
462 views
Dear Support,

I am getting above error when radmenu is getting its datasource dynamically. please check the below code.

Create PROCEDURE [dbo].[HGetSubMenu]
(
@categoryid int
)
AS
begin
DECLARE @level int
  
    /* Creating temporary table for tree storage*/
    CREATE TABLE #temp_tree
    (
        level int,
        id int NOT NULL PRIMARY KEY,
        ptr int,
        f1 char(20)
    )
  
    INSERT #temp_tree (level, id, ptr, f1)
    SELECT 0, categoryid, parentid, categoryname FROM HCategroyNew WHERE categoryid = @categoryid
    SELECT @level = 0
  
    WHILE 1 = 1
    BEGIN
        INSERT #temp_tree (level, id, ptr, f1)
        SELECT
            @level + 1, HCategroyNew.categoryid, HCategroyNew.parentid, HCategroyNew.categoryname  
        FROM
            HCategroyNew, #temp_tree tt
        WHERE
                HCategroyNew.parentid = tt.id
            AND tt.level = @level
  
        IF @@rowcount = 0 BREAK
         
        SELECT @level = @level + 1
    END
  
    SELECT id, ptr, f1,level
    FROM #temp_tree
    DROP TABLE #temp_Tree
end

Dataset Table Structure
id  ptr f1                     level
3   1   Bedrooms                0
13  3   Classical               1
14  3   Modern                  1
15  3   Contemporary            1
16  3   Transitional            1
17  3   Arte Deco               1

Radmenu Binding.
RadMenu1.DataSource = ds.Tables[0];
             
            RadMenu1.Flow = ItemFlow.Horizontal;
            RadMenu1.DataTextField = "f1";
            RadMenu1.DataFieldID = "ptr";
            RadMenu1.DataValueField = "id";
            RadMenu1.DataFieldParentID = "level";
            RadMenu1.DataBind();

Please help me urgent.

Thanks
Rizwan
Hristo Valyavicharski
Telerik team
 answered on 30 Oct 2014
1 answer
190 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
96 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
248 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
177 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
260 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
700 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?