Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
133 views

Hi

How to work with model boxes i have radbutton when i click on button open model box , click again button if model box is open close that else open model box .

find the attachments have better idea what exact scenarios i want any suggestions.

Thanks,

SR.

 

SR
Top achievements
Rank 1
 answered on 25 Apr 2016
1 answer
235 views

We have to use RadToolTipManager for RadGrid control,

We observed that tooltip seems to be working for IE10 although not working in MS Edge browser.

Please note the below specified version as we have with us:

Telerik.Web.UI.dll (2014.1.403.35)

Respective screenshots have been attached herewith for your reference.

Look forward to hearing back from your support at the earliest.

 

Marin Bratanov
Telerik team
 answered on 25 Apr 2016
1 answer
185 views

Hi

I have a radbutton when i click button open radwindow under the button i have done this using open element id of OpenerElementID set the properties as left=1100px and top=40px window opens exact position but when i zoom out and zoom in the browser percentage window position is not related to button .

any suggestions find the attachment.

Thks.

SR.

 

 

 

Marin Bratanov
Telerik team
 answered on 25 Apr 2016
4 answers
220 views
Hello,

I was wondering is there a way to highlight the column that the grid is currently being filtered on?



Similar to what we have for sorting:
 
<SortingSettings SortedBackColor = "Aqua" />
 

Thanks,

Sadiq N.
Eyup
Telerik team
 answered on 25 Apr 2016
2 answers
264 views

I'm trying to export a radgrid to a pdf with pictures that are embedded inside of it.  I currently have a radgrid, and one of the columns is using a grid template column with a radlistview control, and a binary image control inside of that.  Everything renders ok, but the pdfexport won't seem to export images.  My goal with the grid template column is to load a list of photo's in each cell, but also be able to export this to a pdf.

 

protected void QuesGrd_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
 
        using (var db = new IASurvey.Core.IADbContext())
        {
 
            GridDataItem item = (GridDataItem)e.Item;
            Guid AnswerId = Guid.Parse(item["ansId"].Text);
            HyperLink link = (HyperLink)item["link"].Controls[0];
            var answerphoto = db.Photos.Where(p => p.PhotoAnswerId == AnswerId);
            var answerlist = answerphoto.ToList();
            RadListView lv = item.FindControl("RadListView1") as RadListView;
            if (lv != null)
            {
                lv.DataSource = answerlist;
            }
 
            if (answerphoto.Any())
            {
                link.Text = "View/Print Photo(s)";
                string url = "~/PhotoOpen.aspx?AnswerId=" + AnswerId;
                link.Target = "_blank";
                link.NavigateUrl = (url);
                //link.Attributes.Add("onclick", "javascript:window.resizeTo(600,600);");
            }
            else
            {
                link.Text = "No Photos";
            }
        }
 
    }
}

protected void QuesGrid_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.ExportToPdfCommandName)
    {
        foreach (GridHeaderItem item in QuesGrid.MasterTableView.GetItems(GridItemType.Header))
        {
 
            item.Style["font-size"] = "15pt";
            foreach (TableCell cell in item.Cells)
            {
                cell.Style["font-size"] = "6pt";
                cell.Style["vertical-align"] = "middle";
            }
        }
        isPdfExport = true;
        ConfigureExport();
    }
}
 
 
protected void QuesGrid_ItemCreated(object sender, GridItemEventArgs e)
{
    if (isPdfExport && e.Item is GridHeaderItem)
    {
        GridHeaderItem headerItem = (GridHeaderItem)e.Item;
        headerItem.Style["font-size"] = "16pt";
        headerItem.Style["color"] = "#ffffff";
        headerItem.Style["background-color"] = "#BD0034";
        headerItem.Style["height"] = "40px";
        headerItem.Style["horizontal-align"] = "center";
        headerItem.Style["vertical-align"] = "middle";
        headerItem.Style["font-weight"] = "bold";
        headerItem.Style["text-align"] = "center";
 
        foreach (TableCell cell in headerItem.Cells)
        {
 
        }
    }
}
 
public void ConfigureExport()
{
    QuesGrid.ExportSettings.IgnorePaging = true;
    QuesGrid.ExportSettings.ExportOnlyData = true;
    QuesGrid.ExportSettings.OpenInNewWindow = true;
    QuesGrid.ExportSettings.UseItemStyles = true;
    QuesGrid.ClientSettings.Scrolling.AllowScroll = false;
    QuesGrid.ExportSettings.FileName = "Survey (" + DateTime.Now + ")";
}

 

<telerik:GridTemplateColumn UniqueName="photo" HeaderText="Photo(s)"
     <ItemTemplate
     <telerik:RadListView ID="RadListView1" runat="server" DataMember="Binary" GroupItemCount="10" PageSize="10">
        <ItemTemplate>
            <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" DataValue='<%#Eval("Image") %>' Width="200px" Height="200px" ResizeMode="Fit" />
            <p class="pagebreakhere">
                 
        </ItemTemplate>
 
        </telerik:RadListView>
    </ItemTemplate
</telerik:GridTemplateColumn>

RJ
Top achievements
Rank 1
 answered on 25 Apr 2016
1 answer
241 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
174 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
280 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
368 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
450 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
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?