Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
1.5K+ views
Hi
I am trying to generate telerik controls dynamically on a page using xml and xslt.
I am getting "unknown server tag telerik:RadTextBox" error while trying to create the control.
Below is my aspx code:
<%@ Page language="c#" Codebehind="XmlTransformerForm.aspx.cs" AutoEventWireup="false" Inherits="PubsWeb.XmlTransform.XmlTransformerForm" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    <HEAD>
        <TITLE>XmlTransformerForm</TITLE>
        <META name="GENERATOR" content="Microsoft Visual Studio 7.0">
        <META name="CODE_LANGUAGE" content="C#">
        <META name="vs_defaultClientScript" content="JavaScript">
        <META name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <BODY ms_positioning="GridLayout">
        <FORM id="XmlTransformerForm" method="post" runat="server">
            <ASP:PANEL runat="server" id="PnlForm"></ASP:PANEL>
            <!--<div id="abc" runat="server"> </div>-->
            <ASP:BUTTON runat="server" id="BtnSave" text="Save"></ASP:BUTTON>
        </FORM>
    </BODY>
</HTML>
Xslt Code:
<xsl:element name="telerik:{@type}">
                                        <xsl:attribute name="runat">server</xsl:attribute>
                                        <xsl:for-each select="./PROPERTIES/PROPERTY">
                                            <xsl:attribute name="{@name}"><xsl:value-of select="current()"></xsl:value-of></xsl:attribute>
                                        </xsl:for-each>
                                        <xsl:for-each select="./LISTITEMS/LISTITEM">
                                            <telerik:ListItem value="{@value}"><xsl:value-of select="current()"></xsl:value-of></telerik:ListItem>
                                        </xsl:for-each>
                                    </xsl:element>

Xml Code:
<FIELD type="RadTextBox" label="Requestor:" required="true">
          <PROPERTIES>
            <PROPERTY name="ID">txtRequestor</PROPERTY>
            <PROPERTY name="ReadOnly">True</PROPERTY>
          </PROPERTIES>
        </FIELD>

Thanks and Regards,
Annapurna
Doncho
Telerik team
 answered on 04 Jun 2020
22 answers
636 views
Can anyone suggest a solution to our problem?

We have a number of nested container divs set at 100% height. This is causing the popup from the RadDatePicker to be positioned incorrectly at the top of the page or sometimes off the screen.
Doncho
Telerik team
 answered on 04 Jun 2020
1 answer
222 views

RadDatePicker icon showing below after media query applies on it. 
In normal Desktop view it is ok and showing at the right,but in mobile view it goes below. Please help me where i am wrong in css. Here is the sample html and css.

Also i am attaching both screen shot for reference.

<table class="table" id="tlSearch">
 <thead>
  <tr>
   <th id="thFromDate">From Date</th>
   <th id="thToDate">To Date</th>
   <th id="badgeno">
    <asp:Label ID="lblSelectedBadgeNo" runat="server" Text="" Font-Bold="true"></asp:Label>
   </th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td data-th="From Date">
    <telerik:RadDatePicker ID="dtAttendanceFrom" runat="server"></telerik:RadDatePicker>
    <asp:RequiredFieldValidator ID="rfvDateFrom" runat="server" ControlToValidate="dtAttendanceFrom" CssClass="validator" ValidationGroup="gRequired" ErrorMessage="*" ToolTip="Date From is Required!">
    </asp:RequiredFieldValidator>
   </td>
   <td data-th="To Date">
    <telerik:RadDatePicker ID="dtAttendanceTo" runat="server"></telerik:RadDatePicker>
    <asp:RequiredFieldValidator ID="rfvAttendanceTo" runat="server" ControlToValidate="dtAttendanceTo" CssClass="validator" ValidationGroup="gRequired" ErrorMessage="*" ToolTip="Date From is Required!">
    </asp:RequiredFieldValidator>
   </td>
   <td>
    <asp:Button CssClass="Button" ID="btnLoadAttendance" ValidationGroup="gRequired" CausesValidation="true" runat="server" Text="Display Record" OnClick="btnLoadAttendance_Click">
    </asp:Button>
   </td>
  </tr>
 </tbody>
</table>
@media screen and (max-width: 767px) {
           table#tlSearch caption {
                background-image: none;
            }
             
            th#thFromDate {
                display:none;
            }
            th#thToDate {
                display:none;
            }
            th {
                text-align:center !important;
            }
            table#tlSearch tbody td {
                display: block;
                padding: .6rem;
            }
             
            table#tlSearch tbody tr td:before {
                content: attr(data-th);
                font-weight: bold;
                display: inline-block;
                width: 10rem;
            }
}
Doncho
Telerik team
 answered on 04 Jun 2020
5 answers
178 views

When EnableTrackChanges = true and after the user makes changes ..... and Accept All Track Changes or Reject All Track Changes a popup window is displayed. How do i disable or hide the popup windows? 

 

thanks in advance

Rumen
Telerik team
 answered on 04 Jun 2020
2 answers
325 views

Hi,

Is there any way i can trigger autosave in RadSpreadSheet?

Or

Is there a way to determine the user have edited the spread so that i can trigger a function to get the values to a hidden variable?

Can ActiveCellModeChanged be used for this? if so how do i do it?

Please help me with this.

Suresh Krishna
Top achievements
Rank 1
 answered on 04 Jun 2020
1 answer
199 views

there is any way to set visible or invisible in the control through javascript?

there is a method set_enabled, but I want to hide the control

I've tried with querySelector in the event onClientLoad

sender._element.querySelector('.RadMultiSelect');

but the resul is null

thanks

Doncho
Telerik team
 answered on 03 Jun 2020
5 answers
1.8K+ views

I have did app scan on a ASP.Net Application developed with Telerik Controls,

 I received following vulnerabilities related to telerik Controls 

 

1. Catchable SSL Page Found

2. Client Side (Javascript) Cookie References 

3.Query parameter in SSL Request

 

As per our Security feedback , these issues should be rectified, I had already explained that these are just assemblies which doesnt do any database operation and can be treated as false positive. But they suggested to refer Australian Cyber Security Centre report on Advisory: Vulnerable versions of Telerik
UI being actively exploited by APT actor.

 

Please support in order to resolve the issue. 

Rumen
Telerik team
 answered on 03 Jun 2020
4 answers
128 views

I have the following treeview

<telerik:RadTreeView ID="tvProcInst" runat="server" CheckBoxes="True" CausesValidation="False"
    DataTextField="LEVEL_NAME" DataValueField="LEVEL_CODE" RenderMode="Lightweight"
    CssClass="Left" MultipleSelect="True">
</telerik:RadTreeView>

 

that is loaded from a linq query once in the page load.  That all works fine.  Each time a user checks a node I add a combobox with the following code

Private Sub tvProcInst_NodeCheck(sender As Object, e As RadTreeNodeEventArgs) Handles tvProcInst.NodeCheck
    Dim cb As New RadComboBox
    Dim cn As New RadTreeNode
 
    If e.Node.ParentNode IsNot Nothing Then
        Return
    End If
 
    If e.Node.HasControls Then
        If Not e.Node.Checked Then
            e.Node.Controls.Clear()
        End If
        Return
    End If
 
    Dim row As New RadComboBoxItem
    row.Value = "R"
    row.Text = "Recurring"
    cb.Items.Add(row)
 
    row = New RadComboBoxItem
    row.Value = "N"
    row.Text = "Non-Recurring"
 
    cb.Items.Add(row)
    cb.ID = "cb" & e.Node.Value
 
    cn.Controls.Add(cb)
    cn.Checkable = False
 
    e.Node.Nodes.Add(cn)
    e.Node.Expanded = True
End Sub

 

it will add the combobox no problem, but will not clear it upon unchecking the checkbox, and when checking another checkbox it will create the new one, but the previously created combobox goes away or goes invisible I can't figure out which because the controls.count is still 1 but yet I can't see it.

Hopefully this makes sense.  If screen shots will help I can supply them if needed.

SSirica
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 03 Jun 2020
3 answers
412 views

Hi, I want to move my styles to a css class:

 

From:

<EnabledStyle BorderColor="#e0e0e0" BorderWidth="1" Width="48" Height="36px" HorizontalAlign="Center" />

To:

<EnabledStyle CssClass="my-class" />

    .my-class {
        border: 12px solid #e0e0e0; 
        width: 48px; 
        height: 36px;
        text-align: center;
    }

But that is not working, the NumericTextbox never gets styled ....

Please enlightenme what I have to do to make it work, thank you!

Tom

Rumen
Telerik team
 answered on 03 Jun 2020
1 answer
104 views

I am having a problem that I have been trying for a while to figure out.

I have a RadGrid that has a GridButtonColumn connected to c# function that I use to pull path and file info from a database and open the file from a file server.

If I use this on an ASPX page by itself, it works like a charm.

If I include this same RadGrid control and code in another RadGrid Edit Form, the function runs and appears to complete successfully.

I debug it and it runs and completes just the same, the file.FullName is right, just like when it tuns in the other form, but the Response.Flush does not open the file.

When the Response.Flush runs in the debugger, I see the focus go back to the browser for a flash and back to the debugger, but no file open dialog or anything else.

I bet someone out there knows what is going on.  Help!

Thanks!

Here is my ItemCommand call:

protected void OpenAttchTable_ItemCommand(object sender, GridCommandEventArgs e)
{
 
    if (e.CommandName == "Open")// CommandName of LinkButton
    {
 
        GridDataItem item = e.Item as GridDataItem;
        String filePath = @item["filePath"].Text;
        String fileName = item["fileName"].Text;
        String FullFilePath = @filePath + fileName;
        FileInfo file = new FileInfo(FullFilePath);
 
        String fileExt = file.Extension;
        switch (fileExt)
        {
            case ".csv":
                Response.ContentType = "text/csv";
                break;
            case ".doc":
                Response.ContentType = "application/msword";
                break;
            case ".docx":
                Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
                break;
            case ".gif":
                Response.ContentType = "image/gif";
                break;
            case ".jpeg":
                Response.ContentType = "image/jpeg";
                break;
            case ".jpg":
                Response.ContentType = "image/jpeg";
                break;
            case ".pdf":
                Response.ContentType = "application/pdf";
                break;
            case ".png":
                Response.ContentType = "image/png";
                break;
            case ".ppt":
                Response.ContentType = "application/vnd.ms-powerpoint";
                break;
            case ".pptx":
                Response.ContentType = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
                break;
            case ".txt":
                Response.ContentType = "text/plain";
                break;
            case ".xls":
                Response.ContentType = "application/vnd.ms-excel";
                break;
            case ".xlsx":
                Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                break;
            default:
                Response.ContentType = "application/octet-stream";
                break;
        }
 
        if (file.Exists)
        {
            if (file.Length > 30000000)
            {
                String Message = "The file exceeds the Maximum length of 30 Megabytess.";
                ClientScript.RegisterStartupScript(this.GetType(), "Warnings", "alert('" + Message + "');", true);
            }
            else
            {
                Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
                Response.AddHeader("Content-Length", file.Length.ToString());
                Response.ClearContent();
                Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
                Response.AddHeader("Content-Length", file.Length.ToString());
                Response.TransmitFile(file.FullName);
                Response.Flush();
                Response.End();
 
            }
        }
    }
}

 

 Here is my ASPX Markup:
<asp:Panel runat="server" Visible="true">
    <div class="row">
        <div class="col-sm-12">
        <div id="OpenAttchGridDiv" runat="server" Visible ="true">
        <telerik:RadGrid ID="OpenAttchTable" EnableViewState="true" runat="server" AutoGenerateColumns="false" GridLines="Both" AllowPaging="false"
        PageSize="10" AllowFilteringByColumn="False" AllowSorting="true" ShowStatusBar="false" MasterTableView-CommandItemDisplay="None"
        AllowAutomaticDeletes="true" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
        MasterTableView-EditMode="EditForms" Skin="Metro"
        OnNeedDataSource="OpenAttchTable_NeedDataSource"
        OnItemCommand="OpenAttchTable_ItemCommand" >
        <GroupingSettings CaseSensitive="false" />
            <ClientSettings>
                    <ClientEvents OnPopUpShowing="PopUpShowing" />
            </ClientSettings>
            <MasterTableView Width="100%" UseAllDataFields="true" ShowHeader="true" InsertItemDisplay="Top" CommandItemDisplay="None" InsertItemPageIndexAction="ShowItemOnFirstPage">
                <EditFormSettings>
                    <PopUpSettings Modal="true" ZIndex="10" ScrollBars="Vertical" />
                </EditFormSettings>
                <Columns>
                    <%--<telerik:GridEditCommandColumn UniqueName="EditCommandcolumn"></telerik:GridEditCommandColumn>--%>
                    <telerik:GridBoundColumn UniqueName="helpDeskTicketID" DataField="helpDeskTicketID" Visible="false"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="helpDeskAttachmentID" DataField="helpDeskAttachmentID" Display="false"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="attachmentTypeID" DataField="attachmentTypeID" Visible="false"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="attachmentTypeDesc" DataField="attachmentTypeDesc" Visible="true" HeaderText="Attachment Type" AllowFiltering="false"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="attachmentVersionID" DataField="attachmentVersionID" Visible="false"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="attachmentVersionDesc" DataField="attachmentVersionDesc" Visible="false" HeaderText="Version" AllowFiltering="false"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="fileDescription" DataField="fileDescription" Visible="true" HeaderText="Description" AllowFiltering="false"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="filePath" DataField="filePath" Display="false"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="fileName" DataField="fileName" Display="false"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="originalFileName" DataField="originalFileName" Visible="false" HeaderText="Original File Name"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="active" DataField="active" Visible="false"></telerik:GridBoundColumn>
                    <telerik:GridButtonColumn CommandName="Open" Text="Open" UniqueName="OpenFile" HeaderText=""></telerik:GridButtonColumn>
                </Columns>
                <CommandItemSettings AddNewRecordText="Add New Attachment" RefreshText="Refresh" ShowAddNewRecordButton="false" />
                <EditFormSettings EditFormType="Template"  FormStyle-Height="100%" FormStyle-Width="100%" PopUpSettings-ScrollBars="Vertical">
                    <FormTemplate>
                        <div class="row" style="padding-left:10px">
                            <div class="col-sm-1"
                                    <asp:TextBox ID="FileNameText" runat="server"
                                        CssClass="form-control"
                                        Text='<%# Bind("fileName") %>' >
                                    </asp:TextBox>                              
 
                                </div>
                                <div class="col-sm-1"
                                    <asp:TextBox ID="FilePathText" runat="server"
                                        CssClass="form-control"
                                        Text='<%# Bind("filePath") %>' >
                                    </asp:TextBox>                              
                                </div>
                            </div>
 
                            <div class="col-sm-3"
                                <div class="form-group">
                                    <label>Version<span style="color:red; font-size:large"> *</span></label>
                                    <asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server"
                                    ControlToValidate="attachmentVersionList"
                                    ErrorMessage="REQUIRED!"
                                    ForeColor="Red"
                                    Font-Size="Medium"
                                    Font-Bold="true" >
                                    </asp:RequiredFieldValidator>
                                    <asp:DropDownList ID="attachmentVersionList" runat="server" CssClass="form-control"
                                        AutoPostBack="false" ToolTip="Required" Width="66%"></asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-sm-1">
                            <asp:TextBox ID ="TextBox1" runat="server" Visible="true" Text='<%# Bind("filePath") %>'></asp:TextBox>
                            <asp:TextBox ID ="TextBox2" runat="server" Visible="true" Text='<%# Bind("fileName") %>'></asp:TextBox>
 
                            </div>
                        </div>
                </FormTemplate>
            </EditFormSettings>
            <NoRecordsTemplate>
                <div>
                    There are no attachments for this ticket.
                </div>
            </NoRecordsTemplate>        
        </MasterTableView>
    </telerik:RadGrid>
 
    </div>
 </div>
</div>
</asp:Panel>


 

 

 

 

Eyup
Telerik team
 answered on 03 Jun 2020
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?