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

protected

 

Telerik.Web.UI.RadTreeView TopicsTree;

 


I need to store checked nodes for a RadTreeView into an arraylist. But when I do that like below:

ArrayList

 

checkedTopics = TopicsTree.CheckedNodes;

 

I get the error  'Cannot implicitly convert type 'System.Collections.Generic.IList<Telerik.Web.UI.RadTreeNode>' to 'System.Collections.ArrayList'. An explicit conversion exists (are you missing a cast?)'.

Please help
Nikolay Tsenkov
Telerik team
 answered on 07 May 2010
1 answer
104 views
.mainmenu 
    width:100%; 
    padding:0; 
    margin:0; 


<div class="mainmenu"
             <telerik:RadMenu ID="rmMain" style="z-index:2500" runat="server" EnableRoundedCorners="true" EnableShadows="true" Width="100%" Skin="Web20"
                <Items> 
                    <telerik:RadMenuItem Text="Quote" AccessKey="Q" > 
                        <Items> 
                            <telerik:RadMenuItem Text="View Quotes" AccessKey="v" />  
                            <telerik:RadMenuItem Text="Create a Quote" AccessKey="c" /> 
                        </Items> 
                    </telerik:RadMenuItem> 
                    <telerik:RadMenuItem Text="Administration" AccessKey="a"
                        <Items> 
                            <telerik:RadMenuItem Text="Maintenance" AccessKey="m" />  
                        </Items> 
                    </telerik:RadMenuItem> 
                    <telerik:RadMenuItem Text="PLCM" AccessKey="p"
                        <Items> 
                            <telerik:RadMenuItem Text="Maintenance" AccessKey="i" />  
                        </Items> 
                    </telerik:RadMenuItem> 
                </Items> 
             </telerik:RadMenu> 
        </div> 




I tried placing the css atrribute dir/direction to rtl for both the div container and the radmenu itself but still does not work.


Yana
Telerik team
 answered on 07 May 2010
1 answer
92 views
Hi
I'm Trying to use cookieless="UseUri" to store the user Session ID but the problem is that all my Telerik tools are no worked it's appear but with no any behavior.
so I used the Cooke to store the Session ID
Lini
Telerik team
 answered on 07 May 2010
0 answers
97 views
Hi there,

I don't know whether this is the right forum to address my issue:
I want to produce reports/admission letters for students who have been admitted.
I thought of using MS Word to design a template, then use it into my project asp.net C# to insert into the template.
NOTE: That the format for the letters is the same, except NAMES, COURSE ADMITTED, GENDER, which i want to pick from my db.
I googled out and found this piece of code. when i tried to modify it, it does produce me what i want, but trying to open the outputted file, i get error of 'not enough memory...' of sort.
Can someone help me with a code that can do this: PLEASE CHECK THE CODE BELOW, and let me know
----------------------------------Code-------------------------------------
public void GetOutput()
{

string strFilePath = null;

try
{
string strvalue = null;

// Declare a file system object say td.
var td = Server.CreateObject("Scripting.FileSystemObject");

// Copy the template file temp2.rtf into file2.rtf.
File.Copy(Server.MapPath("Templates/Template.rtf"), Server.MapPath("file2.rtf"));

// Set file path to file2.rtf. 
strFilePath = Server.MapPath(".") + "/file2.rtf";

//Open file2.rtf in read mode. 
FileStream fs2 = new FileStream(strFilePath, FileMode.Open, FileAccess.Read);

//Declare d as a stream Reader 
StreamReader d = new StreamReader(fs2);

//Initialise the stream reader d to the begining of the file. 
d.BaseStream.Seek(0, SeekOrigin.Begin);

//A string variable used to store all the values received from the file file2.rtf. 
string swrtarget = null;

//Read the file from Start to End in one go.
swrtarget = d.ReadToEnd();

// Close the Stream Reader
d.Close();


//grab the portion of the template that needs to be repeated
//look at the rtf file and determine which section will repeat the data you want repeated
//using page breaks in the template, I was able to key off of "page" to find my indexes
int beginInsert = swrtarget.IndexOf("page }") + 7;
int endInsert = swrtarget.Length - 7;
int insertLength = endInsert - beginInsert;
string insert = swrtarget.Substring(beginInsert, insertLength);

//Response.Write(insert);

//I used a dataset and SQLClient instead of OleDb and ExecuteReader
DataSet ds = new DataSet();
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
SqlCommand sqlComm = new SqlCommand();
sqlComm.Connection = conn;
sqlComm.CommandType = CommandType.StoredProcedure;
sqlComm.CommandText = "Stored Proc Here";

try
{
sqlComm.Connection.Open();
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(sqlComm);
mySqlDataAdapter.Fill(ds, "Table"); 
}
catch (Exception ex)
{
Response.Write(" SQL error = " + ex.Message);
}
finally
{
sqlComm.Connection.Close();
}

//Set the path to open file2.rtf 
strFilePath = Server.MapPath(".") + "/file2.rtf";

//Open file file2.rtf in Read Write Mode
FileStream fs1 = new FileStream(strFilePath, FileMode.Open, FileAccess.ReadWrite);

//Declare a Stream Writer.
StreamWriter s = new StreamWriter(fs1);

//This variable str will store all the values from the 2nm till final. 
string str = null;

//Replace the values with the values in the string read from file2.rtf
int i = 0;

foreach (DataRow row in ds.Tables[0].Rows)
{
//make str equal to the template file
if (i == 0)
{
str = str + swrtarget;
i++;
}
else
{
//inserts the repeatable portion of the TemplateBuilder that was caluclated above
str = str.Insert(str.Length - 7, insert);
}

strvalue = row["dateline"].ToString();
str = str.Replace("##Address##", strvalue);

strvalue = row["lastname"].ToString();
str = str.Replace("##Name##", strvalue);

strvalue = row["occupation"].ToString();
str = str.Replace("##desig##", strvalue);

}

// After replacing all the values write these values in the file2.rtf via the file write (s).
s.WriteLine(str);

//After writing the data in the stream writer the values must be flushed.
s.Flush();

//Close the stream writer.
s.Close();
fs1.Close();
fs2.Close();

// Response.Write("OFFER LETTER GENERATED SUCCESSFULLY.")
}

catch (Exception ex)
{
Response.Write("" + ex.Message);
}

finally
{
//Response.Redirect() 
}

}

------------------------------END OF CODE-------------------------------------------------
Robert Jakech
Top achievements
Rank 1
 asked on 07 May 2010
2 answers
157 views
Hi! I've implemented one of the examples for using the RadMenu as a context menu and it works for Insert and Edit but not for Delete. I think the command is not right, at least for my project.

            case "Delete":
                rgUsers.MasterTableView.PerformDelete(rgUsers.Items[radGridClickedRowIndex]);
                break;

This fires but nothing happens. Every other Delete link works. Both the CommandItem bar and the link on the row itself. Any help?
Lighthouse Developer
Top achievements
Rank 1
 answered on 07 May 2010
5 answers
171 views
Dear Telerik,
            I have performance issue in my NestedGrid, loading very slowly . We followed some of the performance tips given by Telerik Forum but still the problem exists.

I am having the parent grid and it has four nested grids. Each nested grid placed in each tab section with the help of multipage.
 
As per the Telerik direction I used to bind each child grid through its own NeedDataSource event. So that it may not disturb with other grids event. SInce i set the AutoPostBack=true in RadTabStrip tag and RenderSelectedPageOnly="true" in RadMultiPage tag section, i am not bother bother about invoking each child grids NeedDataSource event. It will handle automatically as i expected. I followed following ASPX code to achieve this scenario:
  <NestedViewTemplate> 
                        <asp:Panel runat="server" ID="InnerContainer" Visible="false"
                            <telerik:RadTabStrip runat="server" AutoPostBack="true" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0"
                                <Tabs> 
                                    <telerik:RadTab runat="server" Text="Users" PageViewID="UserPage"
                                    </telerik:RadTab> 
                                     <telerik:RadTab runat="server" Text="Prefills" PageViewID="PrefillPage"
                                    </telerik:RadTab> 
                                </Tabs> 
                            </telerik:RadTabStrip> 
                            <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="true"
                                <telerik:RadPageView runat="server" ID="UserPage">   

But we are not able to improve the loading speed of grid for the operations like grid expanding,grouping,EditPop Window closing etc..
So guide us to what are the steps still we have to be taken to control the speed of application.

-Thanks




Pavlina
Telerik team
 answered on 07 May 2010
3 answers
202 views
I've got a real need to be able to, from a client page, call a .ashx handler in my site, and have it return a bunch of html, including some telerik controls like textboxes, drop down boxes, masked edit type things, etc.

However, I've tried faking a page and adding rad controls to it and then getting the resulting html, but that tells me I need a script manager.  I've tried adding one in, but that tells me the helpful message of Object isn't instantiated...

Is there any good way that I can create controls without having a full .aspx page?
Dimitar Milushev
Telerik team
 answered on 07 May 2010
5 answers
204 views
We are currently using the WebBlue skin, which overall, looks great. But, we don't like some of the icons associated with this skin. The edit pencil is blue, as are the select and cancel icons. Is it possible to just change the icon set to that of another skin?
I want the cancel to be red, and the edit pencil to look like an edit pencil, not an all blue pencil.
Daniel
Telerik team
 answered on 07 May 2010
7 answers
265 views
Hi,

I bumped into a rather obscure problem when using RadWindow.
The problematic situation rises under the following circumstances:
An input field with selected content has style.display="none" on the same page as the RadWindow is shown. Then try to move or resize the window. An Unknown Runtime Error occurs in the Telerik script at the point where document.selection.empty() is called.
From DOM perspective I can imagine that emptying the selection on a non-visible element is problematic, but I think the Telerik script should anticipate such a situation and act accordingly instead of letting an error occur.

I can imagine it might come across as a weird situation having a hidden input field with selected content (on the same page as a RadWindow) so let me explain the situation I encountered the problem:
I have a edit form with a tab strip combined with a multi page. On the first tab the first input is selected and given focus so that the user can start altering the data easily. On the second tab there is a button which causes a RadWindow to appear as a modal dialogue where the edited user can be linked to user groups. When I let the selected content on the first tab to remain selected when I switch to the second tab, click the button which causes the RadWindow to appear and then try to move or resize the RadWindow I get the Unknow Runtime Error on the line where document.selection.empty() is called.

While searching for the one exact cause of my problem I have created a situation as simple as possible which demonstrates the problem. For your convenience I will place it here:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MoveRadWindowTest.aspx.cs" Inherits="CMS.Views.Tests.MoveRadWindowTest" %> 
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
</head> 
 
<body> 
<form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
     
    <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="OpenRadWindow();return false;" /> 
     
    <div id="HideMe"
        <asp:TextBox ID="TextBox1" runat="server" /> 
    </div> 
     
    <telerik:RadWindow ID="RadWindow1" runat="server" Modal="true" NavigateUrl="http://www.telerik.com" /> 
</form> 
     
    <script type="text/javascript"
        function OpenRadWindow() { 
            $get('HideMe').style.display = "none"
             
            $find("<%=RadWindow1.ClientID%>").show(); 
        } 
    </script> 
</body> 
</html> 
 

There is nothing custom in the code behind file.

I hope this problem can be fixed. (I expect a check whether the selected content is visible should be the way to go.)

Regards,

Mink
James
Top achievements
Rank 1
 answered on 07 May 2010
12 answers
271 views

When tabstrip is used along with radajax manager error (a is undefined) is raised in "Sys.UI.Control.initializeBase(this);this._element=a;a.control=this" 

Yana
Telerik team
 answered on 07 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?