Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
114 views

Description: RadEditor's TemplateManager adds a non-existing template into RadEditor.

Problem: The application has a save function that captures RadEditor1's content into an HTML file, "test.html", on the local disk. This file is saved into "~/Templates/test.html". The problem occurs when test.html is edited and reloaded; TemplateManager somehow stores the first copy of test.html and keeps loading it whenever a file named test.html is opened by TemplateManager. test.html can be edited through RadEditor, or Notepad, or even deleted and re-created, but TemplateManager still opens the original copy(which has been deleted and re-created and formatted differently than before).

Code: 
[ASPX]

 

<

 

TemplateManager ViewPaths="~/Templates" />

 

 

[C#]
if

 

 

(e.Argument == "Save")

 

{

 

 

using (StreamWriter saveFile = new StreamWriter(this.MapPath(path), false))

 

{

saveFile.Write(RadEditor1.Content);

}

}


Any help will be greatly appreciated.
Thank you

 

Rumen
Telerik team
 answered on 12 Mar 2009
3 answers
265 views
Is it possible to allow the user to clear the selected date in the calendar?  If the user selects a date, there appears to be no way to clear it.

Thanks
Pavlina
Telerik team
 answered on 12 Mar 2009
7 answers
425 views
Hi all,

I have designed a rad grid and enable in-place editing mode using this example but when I want to fire server side update command to delete in DB no action fires, and below my code:

 

protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

 

{

 

//Get the GridEditableItem of the RadGrid

 

 

GridEditableItem editedItem = e.Item as GridEditableItem;

 

 

//Get the primary key value using the DataKeyValue.

 

 

string ID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["id"].ToString();

 

 

//Access the textbox from the edit form template and store the values in string variables.

 

 

string name = (editedItem["name"].Controls[0] as CheckBox).Text;

 

 

string insertflag = (editedItem["insertflag"].Controls[0] as CheckBox).Text;

 

 

string updateflag = (editedItem["updateflag"].Controls[0] as CheckBox).Text;

 

 

try

 

{

 

//Open the SqlConnection

 

SqlConnection.Open();

 

//Update Query to update the Datatable

 

 

string updateQuery = "UPDATE Employees set name='" + name + "',insertflag='" + insertflag + "',updateflag='" + updateflag + "' where id='" + ID + "'";

 

SqlCommand.CommandText = updateQuery;

SqlCommand.Connection = SqlConnection;

SqlCommand.ExecuteNonQuery();

 

//Close the SqlConnection

 

SqlConnection.Close();

 

}

 

catch (Exception ex)

 

{

RadGrid1.Controls.Add(

new LiteralControl("Unable to update Employee. Reason: " + ex.Message));

 

e.Canceled =

true;

 

}

Label1.Text =

"Updated";

 

}

I have used label to change text to know whether it get into updatecommand or not, but no changes happens.

Are there any c# additional code to add???
Please advise

Regards

ravi
Top achievements
Rank 1
 answered on 12 Mar 2009
1 answer
187 views
Hi everybody!

I have a menu and this call a radwindow inside a container called "contenido_ventana" this is the restriction zone, this works perfect but the problem is when
1. I put litle the iexplorer window
2. call the radwindow
3. click the radwindow
 and sometime depends the size of the page the radwindow jump outside the container now only to left, but before its jump to the top of the page.

my scenario its like this:
1. master page.aspx
menu
   container
    radwindow
    radwindowmanager

2.Default.aspx
container
    radwindow
    radwindowmanager

Its posible resize a radwindow  and make small according the iexplorer

Thank in advice for yours answers.

pd: sorry for my english, its too bad.





Georgi Tunev
Telerik team
 answered on 12 Mar 2009
1 answer
117 views
hi,
We are using Q2 2008 (and don't want to upgrade to Q3 just yet) RAD Menu. The menu gets built dynamically and so we don't know the width of the menu. In Q1 and firefox/ie8 setting no width has been fine - but in ie7 it won't set the width until the event OnMouseOver/Hover has been fired.

Another developer here had the same problem but managed to find the lenght of the longest menu item and times it by 8.5625 and set the width but I can't seem to work that dodgey hack in my code.

Any ideas?

 

Yana
Telerik team
 answered on 12 Mar 2009
4 answers
249 views
Hi friends,

i am developing a web user control. In that i was using RadGrid latest version,
 
i am strugling with few problems like

1. I am unable to write proper java script.
2. Export to Word / Pdf not working.

when write the code like this it raise an error when the page is loading

My Code:

function

GotoNewRequestPage()

 

{

 

var obj = document.getElementById('<%= RadGridRequestLists.ClientID %>');

 

}






Error like this:
 

Server Error in '/' Application.

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
   System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) +2108046
   Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +186

[HttpException (0x80004005): Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.]
   Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +244
   Telerik.Web.UI.RadAjaxControl.PerformRender() +373
   Telerik.Web.UI.RadAjaxControl.OnPageRender(HtmlTextWriter writer, Control page) +1309
   Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +157
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +98
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
   System.Web.UI.Page.Render(HtmlTextWriter writer) +26
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

Santhosh
Top achievements
Rank 1
 answered on 12 Mar 2009
1 answer
65 views
Hi,

When Im using node expand mode of serversidecallback for an ajax'ed node expand, Im finding that a lot of data is posted to the server. The amount of data seems to be additive as well. For example, if I expand one node and it posts back 14k, when I expand the next one which does not return any more data than the first one, it posts back 22k.

I understand that this is due to the viewstate being updated but is there any way to reduce the amount of data being posted.

The viewstate seems to contain each node's imageurl and openimageurl. Is there anyway to set them so that they use one common variable?

our image url's are quite big:
http://localhost/rvservices/WebResource.axd?d=9sITAdMvGK1Qm1ik7fcTRAuCttzSiFEdU7ak4wHdOcaPWw7k0RVlXsufQ613GzmI5kzI5-YeggENTdPMR3JBqxP2md__DsQqWwb_Zectys-6gsnlGHo0FBoxXbLVnO480&t=633722770144766645


Thanks
Atanas Korchev
Telerik team
 answered on 12 Mar 2009
1 answer
112 views
I have got 3 colums (colums: FirstName, LastName, Tel )
For the FirstName and LastName I use GridBoundColumn this ist fine. But for the last one I dont know what to use (I could have several numbers and there for I need several Rows in a Row). How can I solve this problem my DataSource ist a List (string FirtsName, string Lastname, List Tel)


Sebastian
Telerik team
 answered on 12 Mar 2009
2 answers
169 views
Is there a possibility to get the datatable that is set in the radgrid, when i set the datasource..

my problem is that i have a generic list, but i can't save the list in viewstate(no serialization) so i that i can hold my temp data..

okay i can manually fill a datatable with the list-values at first load and save the table in viewstate, but it is so ugly :D and this scenario looks so daily...

thx 4 help
basti
Farouk
Top achievements
Rank 1
 answered on 12 Mar 2009
2 answers
152 views

I have two treeviews on a page within RadAjaxPanels (tried this with basic divs to the same result) and have found something a little odd that I could do with a fix for. If I drag an object from the right tree as soon as I enter the left panel I get an error on line 1911, char 1, Error '_145' is null or not an object. After doing some more research I discovered that this only happens when I drag something out of the left edge of RadAjaxPanel2 and into the right edge of RadAjaxPanel1.

e.g. if I drag out of the bottom of RadAjaxPanel2 and onto RadAjaxPanel1 from the right it's fine, if I drag out of the left of RadAjaxPanel2 and into the top edge of RadAjaxPanel1 again it's fine, but if I drag from the left edge of RadAjaxPanel2 onto the right edge of RadAjaxPanel1 I get the error (needs IE to be setup to show all Javascript errors for the error to be obvious).

As a temporary fix I can swap the trees round so that I am dragging from the left tree to the right tree, but this isn't an idea solution, has anyone encountered this before or got any ideas how I can solve this?

Cheers 

Jon 

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">  
        <contentTemplate> 
 
//CODE REMOVED TO KEEP SIZE DOWN  
 
    
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" BackColor="Aqua" CssClass="floatLeft">  
                <telerik:RadTreeView ID="RadTreeGroups"  AllowNodeEditing="true" EnableDragAndDrop="true" EnableDragAndDropBetweenNodes="true" OnNodeDrop="RadTreeGroups_NodeDrop" OnNodeEdit="RadTreeGroups_NodeEdit" OnClientContextMenuItemClicked="onClientContextMenuItemClicked" OnContextMenuItemClick="RadTreeGroups_ContextMenuItemClick" runat="server">  
                </telerik:RadTreeView> 
            </telerik:RadAjaxPanel> 
            <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" BackColor="Gray" CssClass="floatRight">  
                <telerik:RadTreeView ID="RadTreeResources"  runat="server" EnableDragAndDrop="true" OnNodeDrop="RadTreeLessons_NodeDrop">  
                </telerik:RadTreeView> 
            </telerik:RadAjaxPanel> 
        </contentTemplate> 
    </asp:UpdatePanel>

.floatRight  
{  
    float:right;  
    width:48%;  
}  
.floatLeft  
{  
    float:left;  
    width:48%;  
Yana
Telerik team
 answered on 12 Mar 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?