Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
301 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
397 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
96 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
1 answer
106 views
Hi,

In my ASP.NET application, we have used RadEditor control.
RadEditor.Net2.dll version 6.5.0.0

Now I have to implement Spell check functionality for all inputs where RadEditor control has been used.
I think, the ideal way it seems is using RadSpell.Net2.dll.
But the issue is that, I have only source code of website, but not the installer. So I am not sure, if installer is containing RadSpell DLL. Also, the installer is at client's environment, so I think its difficult to check for us.

If you could please let me know, do we need to buy a different license for RadSpell.Net2.dll? Or it should be included in the installer that contains RadSpell.Net2.dll?

Any help on this much appreciated.

Thanks
Rumen
Telerik team
 answered on 08 Feb 2012
1 answer
87 views
Hi

i have used rad menu in my application. i have used submenu also. While i was accessing it through the android phone. submenus are not displaying.
Richard
Top achievements
Rank 1
 answered on 08 Feb 2012
3 answers
106 views
hi,
i am using the telerik grid in my project with three hierarchical level i add the 

CommandItemDisplay="Top" CommandItemSettings-AddNewRecordImageUrl="add.png" for all the three level grids but when i expand the all levels i didn't see any add new button at second level it appearing at first and last but missing at middle what can i dot to solve this problem

please see the attached image to see the bug

if you want full code please download from the following link     download the code
Antonio Stoilkov
Telerik team
 answered on 08 Feb 2012
2 answers
329 views
Hi,

I'm using a ListBox for selecting an item.
If a button of the control is clicked, I want to fetch the SelectedValue.
The SelectedItem is not null (since one item is selected) but all properties of the SelectedItem (which shoud be set, like Value, Text, ImageUrl) are empty. In fact, all Items of the ListBox don't have their information anymore.
I add the items only once (when the ListBox is initially created) - I simple create a List of RadListBoxItem and add them to the ListBox.

This is the code I use to create the ListBox:

m_listBox = new RadListBox();
 m_listBox.ID = "ListBox1";
 m_listBox.SelectionMode = ListBoxSelectionMode.Single;
 
 if (!Initialized)
 {
    List<RadListBoxItem> items = LoadItems();
    foreach (RadListBoxItem radListBoxItem in items)
    {
       m_listBox.Items.Add(radListBoxItem);
    }
    m_listBox.SelectedIndex = 0;
    Initialized = true;
 }

The Initialized property is saved in viewstate because my control isn't added when the page loads initially but later in a workflow.

This is how I create an item:
RadListBoxItem item = new RadListBoxItem(text, id.ToString(CultureInfo.InvariantCulture));
item.ImageUrl = "include/img/Objects/"" +imageUr;
items.Add(item);

All values are added correctly but in the PostBack they are empty.

What could cause this behavior?

Thanks!
JP
Top achievements
Rank 1
 answered on 08 Feb 2012
0 answers
91 views
I am using a grid with an popup ascx control for editing/inserting records. The grid displays sets of records (controled by a dropdown list)  When inserting a new record I need to be able to pass to the edit ascx control the ID from the dropdown list so it can be inserted in to the new record.
Mark
Top achievements
Rank 1
 asked on 08 Feb 2012
1 answer
97 views
Hi,

I would like to know, how we can extract the properties of a grid from the javascript radgrid object 
for example i need to know in the client side whether "selecting-allowrowselect" of the grid is being rendered as true or false,

<

clientsettings selecting-allowrowselect="true">.

 

 

//Assigns the Global Grid object on grid created

 

 

 

 

 

 

function OnGridCreated(sender, eventArgs) {

 

 

 

grid = sender;

}

 

so how to access the above property [clientsettings selecting-allowrowselect] in the "grid" object?

Regards,
CSW Support

 

Tsvetoslav
Telerik team
 answered on 08 Feb 2012
1 answer
115 views
Hi all,

I am attempting to create a Rad grid (version 2010.3.1215.40 in Visual Studio 2010 ) which returns a list of contacts. Each contact may have a number of 'profiles' representing how we know a person. For example, We may have a contact called Joe blogs, he could have two profiles, one which links him to Company A and one which links him to Company B (ie a contractor/consultant). A user needs to be able to select the profile id from the list of contacts, however we wish to only display the nested detail table if there is more then 1 profile. If there is only 1 profile then the user should just see that in the main grid.

So far I have the grid set up to display the full list of contacts and then they have the nested grid of profiles, however a user can currently expand a row even if it has 1 or 0 profiles. Any sugestions on how to not display the nested grid where the profile count is less then 2?

Many Thanks

<telerik:RadGrid ID="rgContactSearchResults" runat="server" Height="448px">
    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true" AllowKeyboardNavigation="true">
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <MasterTableView DataKeyNames="ContactID" AutoGenerateColumns="true" TableLayout="Fixed">
        <DetailTables>
            <telerik:GridTableView DataKeyNames="ContactID" AutoGenerateColumns="true" DataMember="ContactID">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="ContactID" MasterKeyField="ContactID" />
                </ParentTableRelation>
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
</telerik:RadGrid>
David
Top achievements
Rank 1
 answered on 08 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?