Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
65 views
Hello, 

I am rendering an asp:panel and putting the html into the content of a RadEditor before exporting a pdf. 

Sometimes only header tags show up on the pdf, and the tables do not appear, but sometimes they do appear. 

If I debug and check the RadEditor content before calling ExportToPdf all of the HTML for the tables are present, but for some reason they do not appear in the PDF. 

Any ideas?
Rumen
Telerik team
 answered on 08 Feb 2012
1 answer
142 views
Hi,

I'm running the latest version of Telerik Controls and am hooking up a RadFilter to a RadGrid. When I have a GridCalculatedColumn set up as "Filterable" on my grid, the RadFilter displays duplicate items for that column. When I turn off filtering for that column, it removes both items from the filter. I've attached an image as an example.

<telerik:GridCalculatedColumn  DataFields="GetPercent" UniqueName="GetPercent" HeaderText="Tarpon Get %" Expression="{0}/100" Aggregate="Avg" Display="false" DataFormatString="{0:P0}" DataType="System.Double" />


Is this a bug in the RadFilter? Or is there a way of preventing this duplication while still being able to filter on those columns?

Thanks,
Landon
Mira
Telerik team
 answered on 08 Feb 2012
2 answers
97 views
Hi,
I would like to Insert child item on ItemDataBound event.
My code:
If TypeOf e.Item Is TreeListDataItem Then
            Dim dataItem = DirectCast(e.Item, TreeListDataItem)
            If dataItem.HierarchyIndex.NestedLevel <> 0 Then
                dataItem("InsertCommandColumn").Controls(0).Visible = False
            End If
            dataItem("FileName").Text = ""
            dataItem("VisitName").Text = ""
            'dataItem.InsertChildItem()
        End If

<Columns>
                            <telerik:TreeListEditCommandColumn UniqueName="InsertCommandColumn" ButtonType="ImageButton"
                                HeaderStyle-Width="60px" ItemStyle-HorizontalAlign="Center" InsertText="Create Subject" />
                            <telerik:TreeListTemplateColumn AllowSorting="false" ItemStyle-Width="140px" HeaderStyle-Width="140px">
                                <ItemTemplate>
                                    <telerik:RadButton ID="btnCancel" Text="Upload" runat="server" CausesValidation="False"
                                        CommandName="UploadFiles" CommandArgument='<%# Bind("Patient_Id") %>'>
                                        <Icon PrimaryIconUrl="~/Images/upload16X16.png" PrimaryIconLeft="5px" />
                                    </telerik:RadButton>
                                </ItemTemplate>
                            </telerik:TreeListTemplateColumn>
                            <telerik:TreeListBoundColumn DataField="ClientPatient_Id" HeaderText="Subject ID"
                                ReadOnly="true" UniqueName="ClientPatientId" HeaderStyle-Width="60px" ForceExtractValue="Always" />
                            <telerik:TreeListBoundColumn DataField="FileName" HeaderText="File Name" UniqueName="FileName"
                                HeaderStyle-Width="300px" />
                            <telerik:TreeListBoundColumn DataField="Visit_Name" HeaderText="Visit" UniqueName="VisitName"
                                HeaderStyle-Width="60px" />
                            <telerik:TreeListBoundColumn DataField="CreationDate" HeaderText="Date Created" UniqueName="CreationDate"
                                HeaderStyle-Width="60px" DataFormatString="{0:d}" />
                        </Columns>

Thank you for the help.
Valdas
Top achievements
Rank 1
 answered on 08 Feb 2012
2 answers
96 views
Hello

I have a RadGrid and use the page size as a paging option.  If my grid has less than 25 records in the search result, then no navigation bar is displayed - This is okay, as I don't need it at this point.  However if I have more than 25 results, but less then 50 results, and I change my page size to 50; the grid will show all results, but the navigation bar is no longer displayed.  This means that I am no longer able to change the page size back to 25 without having to reload the whole page.

Is it possible to force the navigation bar to always display?

Many thanks,

Mark
Mark
Top achievements
Rank 1
 answered on 08 Feb 2012
1 answer
90 views
I have a .net listview in which i placed a radrating control. For each record in the listview a radrating control gets rendered. When someone clicks on the control to submit a rating, the whole page refreshes. I was wondering if anyone could suggest what i might be missing that's causing the whole page to refresh? I thought one of the great benefits of the telerik controls is that i just need to drop a scriptmanager on the page and it handles all the postback events.

If there's an online tutorial which demonstrates this, please post the link. Otherwise I am open to any suggestions.

Thanks
Slav
Telerik team
 answered on 08 Feb 2012
1 answer
82 views
I was moving from the latest (2-3 weeks old) trial to 2011.3.1305.40 build of the ASP.NET Ajax components, when I startet getting the following error message:

Microsoft JScript runtime error: Unable to get value of the property 'Name': object is null or undefined

After getting this, you start receiving all kind of JS errors, formatting errors in the RadGrid, etc. I spend a few hrs debugging it, when I eventually figured out it is something to do with the empty ODataSettings tag, which you get when working with the designer. I started removing the components from the page so I can figure out which one is breaking the runtime, turned out it is the RadComboBox. Below is the source of a page which will break 10 out of 10 times - tought I save someone else some time figuring it out.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadComboBox ID="rcbSites" runat="server" DropDownWidth="200px" MaxHeight="300px"
            Sort="Ascending" Width="200px">
            <Items>
                <telerik:RadComboBoxItem runat="server" Text="Athens" Value="Athens" Owner="rcbSites" />
                <telerik:RadComboBoxItem runat="server" Text="Beijing" Value="Beijing" Owner="rcbSites" />
                <telerik:RadComboBoxItem runat="server" Text="Belgrade" Value="Belgrade" Owner="rcbSites" />
                <telerik:RadComboBoxItem runat="server" Text="Bristol" Value="Bristol" Owner="rcbSites" />
                <telerik:RadComboBoxItem runat="server" Text="Copenhagen" Value="Copenhagen" Owner="rcbSites" />
            </Items>
            <WebServiceSettings>
                <ODataSettings InitialContainerName="">
                </ODataSettings>
            </WebServiceSettings>
        </telerik:RadComboBox>
    </div>
    </form>
</body>
</html>

Removing the following will fix it:

<WebServiceSettings>
         <ODataSettings InitialContainerName="">
         </ODataSettings>
</WebServiceSettings>


Thx,
Branimir

Branimir Giurov
C# MVP
Genady Sergeev
Telerik team
 answered on 08 Feb 2012
1 answer
105 views
Hello Team,

I am trying to apply telerik skin for RadToolTip which is inside the RadListView. Skin is not working inside the RadListView but its working fine outside the RadListView.

PFB code and kindly help me to resolve this issue.

    <telerik:RadListView ID="RadListView 1"runat="server" AllowCustomSorting="true" AllowPaging="false" DataSource="<%# Model.Test%>" ItemPlaceholderID="RadListView1" Skin="Default">
  <ItemTemplate>
 <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Picture.png">
  <telerik:RadToolTip ID="RadToolTip1" runat="server" RegisterWithScriptManager="false" EnableAjaxSkinRendering="true"
TargetControlID="imgAuditAppeals" EnableEmbeddedSkins="true" Skin="Default">
  </ItemTemplate>
</telerik:RadListView>

Richard
Top achievements
Rank 1
 answered on 08 Feb 2012
3 answers
266 views
I would like to know if there is a way to set a maximum number of levels to render when binding to a datasource?

We are using radtreeview with Sharepoint 2007 like this:
<asp:ContentPlaceHolder ID="PlaceHolderVerticalNav" runat="server">
    <telerik:RadTreeView Runat="server" id="RadTreeView1"  datasourceid="topSiteMap" EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false"></telerik:RadTreeView>
    <PublishingNavigation:PortalSiteMapDataSource ID="topSiteMap" Runat="server" SiteMapProvider="CombinedNavSiteMapProvider"
EnableViewState="true" StartFromCurrentNode="false" StartingNodeOffset="0" ShowStartingNode="false"/>
</asp:ContentPlaceHolder>

Our datasource has 10 levels deep, but I want to restrict it to displaying just the first 3 levels.  

Any tips would be helpful.
Jordan
Top achievements
Rank 1
 answered on 08 Feb 2012
3 answers
383 views
Hello,
I am trying to clear the content of a RadTextBox when user focuses on the textbox. I tried several ways but could not clear the content using javascript.

"LASTNAME" is written into a RadTextbox and when user focuses to this RadTextbox, "LASTNAME" should be cleared so that the user can write his/her name...

I tried to clear it using javascript;

<script type="text/javascript">

function clear()
{
$find("<%=RadTextBox1.ClientID %>").clear();
}
</script>

But it did not work. It reads the clear method but does nothing. So how can I clear the content, any ideas?

Thanks,
Ervin
ervin
Top achievements
Rank 1
 answered on 08 Feb 2012
1 answer
89 views
Hi there,
   We are adding the telerick dlls dynamcially through reflection dynamically at run time. We had the issue of loading the embeded resources in reflection . So, we disabled the telerick embeded resources and loadin it dynamically. Our user controls are not designed in ascx rather they are defined as webcontrols.  The issue that i am facing is, i am able to add all the required resources dynamically to my customer control dll and while executing the telerick dll resrouces, say the Radbutton.js file, i am getting $(telerick) is undefined.

Please let me know is it possible to load the telerick resource files dynamically in webcontrols using scriptreferences, if so, what are the additional parameters that i need to add? Any help would be appreciated.

Please note that i have added all the required js / css files also.

Thanks,
My script reference method, passin the dll and the reousrce details,

 

public IEnumerable<ScriptReference> GetScriptReferences()

{

 

this.EnableEmbeddedScripts = false;

 

// ClientScriptResource("Telerik.Web.UI.RadButton", "Telerik.Web.UI.Button.RadButton.js"),

ScriptReference reference =

 

new ScriptReference();

reference.Name =

 

"Telerik.Web.UI.Button.RadButton.js";

reference.Assembly =

 

"Telerik.Web.UI, Version=2010.3.1215.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4";

 

string[] Names = reference.Assembly.Split(',');

 

string DLLName = Names[0].Replace("\\", "");

 

string VersionNumber = Names[1].Split('=')[1].Replace("\\", "");

 

string Culture = Names[2].Split('=')[1].Replace("\\", "");

 

string PublicKeyToken = Names[3].Split('=')[1].Replace("\\", "");

reference.Path =

 

"~/MyScriptHandler.ashx?Assembly=" + DLLName +

 

"&VersionNumber=" + VersionNumber +

 

"&Culture=" + Culture +

 

"&PublicKeyToken=" + PublicKeyToken +

 

"&ResourceName=" + reference.Name;

 

return new ScriptReference[] { reference };

}




My ashx code to load the resource file dynamically,

 

public void ProcessRequest(HttpContext context)

{

 

string DLLName = context.Request["Assembly"];

 

string VersionNumber = context.Request["VersionNumber"];

 

string Culture = context.Request["Culture"];

 

string PublicKeyToken = context.Request["PublicKeyToken"];

 

string ResourceName = context.Request["Resourcename"];

 

 

string TypeFQN = DLLName + ", Version=" + VersionNumber + ", Culture=" + Culture + ", PublicKeyToken=" + PublicKeyToken;

 

Assembly ResourcesAssembly = Assembly.Load(TypeFQN);

 

 

 

Stream IOFile = ResourcesAssembly.GetManifestResourceStream(ResourceName);

 

byte[] bytes = new byte[IOFile.Length];

IOFile.Read(bytes, 0, bytes.Length);

 

string contentType = getContentType(ResourceName);

 

if (contentType == "text/plain")

{

 

string outputfile = string.Empty;

 

if (HasUtf8ByteOrderMark(bytes))

{

outputfile =

 

Encoding.Default.GetString(bytes).Substring(3);

}

 

else

{

outputfile =

 

Encoding.Default.GetString(bytes);

}

context.Response.Write(outputfile);

}

 

else

{

context.Response.BinaryWrite(bytes);

}

}


Iana Tsolova
Telerik team
 answered on 08 Feb 2012
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?