Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
300 views

I have a telerik:RadTreeNodeBinding within a telerik:RadComboBox.

Is there a way to format the parent node in bold text of a databound radtreeview?

Thanks,

Roger

 

 

Roger
Top achievements
Rank 1
 answered on 22 Apr 2016
2 answers
214 views
On my site, from the main page a user will click and a RadWindow will open (set a Modal), and when the user clicks in the window, a second RadWindow opens (contained in the first RadWindow, and also a Modal).  From this second window, if a user clicks one of three buttons, there should be a confirmation dialog (handled through a radconfirm dialog).  Unfortunately, the dialog is not shown (it's probably hidden behind one of the two RadWindows).  I tried playing with the z-indexes but can't figure out how to get the confirmation dialog to be shown.  How can I get my confirmation dialog to be the top-most window?
Mike
Top achievements
Rank 1
 answered on 22 Apr 2016
4 answers
323 views

Is it possible to get a DatePicker as the editor when doing client-side batch editing? I've tried:

<telerik:GridDateTimeColumn DataField="FirstPaymentDate" PickerType="DatePicker" HeaderText="1st Pmt. Due" UniqueName="FirstPaymentDate" HeaderStyle-Width="100px" ItemStyle-Width="100px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AllowSorting="false" />

 and

<telerik:GridTemplateColumn HeaderText="1st Pmt. Due" UniqueName="FirstPaymentDate" DataType="System.DateTime" HeaderStyle-Width="100px" ItemStyle-Width="100px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AllowSorting="false"><br>                                <ItemTemplate><br>                                    <asp:Label runat="server" ID="date"Text='<%# Eval("FirstPaymentDate") %>'><br>                                    </asp:Label><br>                                </ItemTemplate><br>                                <EditItemTemplate><br>                                    <telerik:RadDateTimePicker ID="picker1" runat="server" DbSelectedDate='<%# Bind("date") %>'><br>                                    </telerik:RadDateTimePicker><br>                                </EditItemTemplate><br>                            </telerik:GridTemplateColumn>

 and in neither case do I get a DatePicker control when I click to enter edit mode.

I've searched extensively and haven't been able to find an example that does this. Is it possible? Can someone provide or point me to an example?​

Augusto
Top achievements
Rank 1
 answered on 22 Apr 2016
0 answers
415 views
I make a form in Wordpress Template that makes certain calculation and displays the result in a modal Bootstrap.

HTML:
 

     //FORM
    <form method="post" id="myForm">   
     <span>Name</span><br><input type="text" name="name" id="name" required>

     <span>Email</span><br>
     <input type="email" name="email"  id="email" required>

     <span>Altura</span><br>
     <input type="number" name="altura" id="altura" required>
       
    <span>Peso</span><br>
    <input type="number" name="peso" id="peso" required>
       <br><br>

    <button type="submit" id="enviar" onclick="calcularIMC();">Enviar</button>

     //MODAL
    <div class="modal fade" id="ajax-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
       <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-body">
            <div id="corpo_modal">
                      <p> ALL FIELDS </p>
             </div>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          </div>
       </div>
      </div>
    </div>

JAVASCRIPT:

    function calcularIMC(){  
    var nome = document.getElementById("nome").value; 
    var email = document.getElementById("email").value; 
    var estilo = document.getElementById("estilo").value; 
    var experiencia = document.getElementById("experiencia").value; 
    var altura = document.getElementById("altura").value; 
    var peso = document.getElementById("peso").value;  
    var resultado = 5;
    
    var corpo = document.getElementById("corpo_modal");
    
    
    var imc = 0;
    if(altura >0 && peso >0){
      imc = peso / (altura * altura);
    }
    
    
     if(estilo == "Surf"){            
             if((imc<=25) && (resultado == 5)){          
              corpo.innerHTML = '<img src="1.png" style="width: 150px; height:150px">';
            }
          else{         
             corpo.innerHTML = '<img src="2.png" style="width: 150px; height:150px">';
              }
         } 
    
    
      else if(estilo == "SUP"){  
    
            if((experiencia >= 3) && (imc <=29)){
              corpo.innerHTML = '<img src="3.png" style="width: 150px; height:150px">';
            } else{
              corpo.innerHTML = '<img src="4.png" style="width: 150px; height:150px">';
            }                       
         }
    }

The problem is that when I send the form, it updates the page and does not display the modal.<br>
After some research, I found that to solve this problem I will need to use Ajax - jQuery.ajax.

I found this code:

    $(function() {
      $('form#myForm').on('submit', function(e) {
          $.post('', $(this).serialize(), function (data) {
              // This is executed when the call to mail.php was succesful.
              // 'data' contains the response from the request
          }).error(function() {
              // This is executed when the call to mail.php failed.
          });
          e.preventDefault();
      });
    });

When I create a form in a SEPARATE page without putting in wordpress template, it works. But when I put the code in wordpress template it updates the page after 3 seconds.

I also discovered that I can use a native function `ajax` in `jquery`, the function `$.ajax();` and inside of oneself I use tags like `url`, `type`, `data` and so on. I'm a beginner in Ajax and I'm lost on how to do this.

> Why the function `e.preventDefaul();` not works when I put in wordpress template?? It's possible make it work in wordpress template?

or

> How I can use the `$.ajax()` to solve this problem??

I want send the form without refresh the page! 
Luiz
Top achievements
Rank 1
 asked on 22 Apr 2016
7 answers
526 views

Is there an easy way to repeat headers for each record in a radgrid master/detail table?

In records with a lot of children, the headers can scroll off the screen, and then the user has to scroll up and down to read the headers. It would be nice if there were a way to automatically repeat the header each time you write a new MasterHeader, for instance, since RadGrid doesn't have a "freeze" feature where the headers will remain frozen at the top of the screen while the user scrolls down.

Is there an easy way to do this?

MasterHeader
MasterDetail
ChildHeader
ChildDetail
ChildHeader
ChildDetail
ChildHeader
ChildDetail
MasterHeader
MasterDetail

ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
 answered on 22 Apr 2016
4 answers
340 views
I know absolutely nothing about responsive design.  

I was wondering if someone could point me to some small example of this.  

What I'd like is to set up (hopefully quickly) two extremely simple pages in my web app to be compatible with multiple devices.  

One page contains a RadGrid with only a few columns and a template popup with a few controls including a RadEditor.

The other page contains two RadComboBoxes, a RadEditor, and two buttons.
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 22 Apr 2016
1 answer
420 views

Hello,

I am calling a telerik radbutton's click event via javascript from within a RadAjaxPanel and it is causing a postback rather than a call back. When I click the button manually all works as expected (a callback occurs).

Example:

document.getElementById('<% = SaveEditorButton.ClientID %>').click();

Please help.

Maria Ilieva
Telerik team
 answered on 22 Apr 2016
0 answers
78 views
I have scenario where the values of textbox inside rad grid is getting loss when Filter has done.

Example

COLUMN1            COLUMN2                COLUMN3                    COLUMN4

   A                            B                        TEXTBOX1                     TEXTBOX2

   C                            D                       TEXTBOX3                     TEXTBOX4

I am giving value for TEXTBOX1 and TEXTBOX2. When I search for "C" in COLUMN1 using FILTER which is available in radgrid all the values

entered in TEXTBOX1 and TEXTBOX2 are getting loss.



My scenario is not to get loss when I Filter for any record.



Please assist me on this
Govindon
Top achievements
Rank 1
 asked on 22 Apr 2016
9 answers
1.9K+ views
HI there

I have a radlistbox on my page that displays a list of items with checkboxes that I programatically add items to:

 <telerik:RadListBox ID="NewslettersRadListBox" runat="server" Width="100%" CheckBoxes="true" Height="200px"></telerik:RadListBox>

What I need to do is to display the items in 2 columns. Is this at all possible?

I have attenpted to do this by modifying the styles as descibedin the following thread: http://www.telerik.com/community/forums/aspnet-ajax/listbox/how-to-show-two-columns-when-use-checkboxes.aspx but this doesn't work.

Thanks in advance!





Sridhar
Top achievements
Rank 1
 answered on 22 Apr 2016
1 answer
125 views
For some reason my drop down is getting reset on my page load i popuplate the dropdown by trapping the post back.
protected void Page_Load(object sender, EventArgs e)
       {
           tblApertureNetShiftPattern _shifts = new tblApertureNetShiftPattern();
           string timeCode = "";
 
           string id = Request.QueryString["id"];
 
           Guid _guid = string.IsNullOrEmpty(id) ? new Guid() : new Guid(id);
 
           _shifts = _dal.GetShiftPatternById(_guid);
 
           if (Request.Browser.Browser == "Firefox")
               Form.Attributes.Add("autocomplete", "off");
 
 
           if (!IsPostBack)
           {
               var dlManagersSource = _dal.GetManagers();
               rdManagers.DataSource = dlManagersSource;
               rdManagers.DataValueField = "LookupValue";
               rdManagers.DataTextField = "LookupDescription";
               rdManagers.DataBind();
 
               // Then add your first item
               var ddlDaysOfWeek = _dal.GetDaysOfWeek().OrderBy(o => o.Order);
               rdDayOfWeek.DataSource = ddlDaysOfWeek;
               rdDayOfWeek.DataValueField = "LookupValue";
               rdDayOfWeek.DataTextField = "LookupDescription";
               rdDayOfWeek.DataBind();
 
               var ddlShiftPatterns = _dal.GetShiftPatternTypes();
               rdAppointmentType.DataSource = ddlShiftPatterns;
               rdAppointmentType.DataValueField = "LookupValue";
               rdAppointmentType.DataTextField = "LookupDescription";
               rdAppointmentType.DataBind();
           }
 
           txtDescription.Text = _shifts.Description;
               rdStartShift.SelectedDate = _shifts.startdate;
               rdShiftEnd.SelectedDate = _shifts.endDate;
               rdDayOfWeek.SelectedValue = _shifts.dayOfWeek.ToString();
               rdAppointmentType.SelectedValue = _shifts.appointmentType.ToString();
               rdManagers.SelectedValue = _shifts.manager_Id.ToString();
          
           
       }

 

/// <summary>
/// Gets the days of week.
/// </summary>
/// <returns></returns>
public List<StandardLookup> GetDaysOfWeek()
{
    List<StandardLookup> lookups = new List<StandardLookup>();
 
    try
    {
        var q = from lookup in apertureNetEntities.tblApertureNetLookUps.Where(a => a.lookup_type == Constants.daysOfWeek).OrderByDescending(o => o.colOrder)
                orderby lookup.lookup_description
                select new
                {
                    LookLookupValue = lookup.lookup_Code,
                    LookupDescription = lookup.lookup_description.Trim(),
                    Order = lookup.colOrder
                };
 
        if (q != null)
        {
            Array.ForEach(q.ToArray(), l =>
            {
                lookups.Add(new StandardLookup(l.LookLookupValue, l.LookupDescription, l.Order));
            });
        }
    }
    catch (Exception ex)
 
    {
        string inner = string.Empty;
        if (ex.InnerException != null)
        {
            inner = ex.InnerException.ToString();
        }
        logger.Error("Error in GetDaysOfWeek function aperturenetdal " + ex.ToString() + " " + inner);
        return null;
    }
 
    return lookups;
}

Nencho
Telerik team
 answered on 22 Apr 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?