Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
173 views
Instead of renaming the file, this code create a new file with the new name (resultat.aspx), but leaving the old file.
How rename the uploaded file, not create a new one?
I only uploaded a singel file
Public Sub uploadFile(ByVal sender As Object, ByVal e As System.EventArgs)
 
    If RadUpload1.UploadedFiles.Count > 0 Then
 
        Dim file As UploadedFile = UploadedFile.FromHttpPostedFile(Request.Files(0))
        Dim targetFolder As String = Server.MapPath(RadUpload1.TargetFolder)
        Dim targetFileName As String = System.IO.Path.Combine(targetFolder, "resultat.xlsx")
 
        file.SaveAs(targetFileName)
 
    End If
 
End Sub
Princy
Top achievements
Rank 2
 answered on 17 May 2012
3 answers
234 views
Hi,

I'm using a RadTreeView.DataNavigateUrlField to fetch not a full url from a database but a querystring value. Is it possible to set a 'base-url' instead of the RadTreeView automatically using the current location ?

For Example:
In the database the field 'CategoryId' has the value's 1,2,4,5 and 7.
In the code I'm using  
treeView.DataNavigateUrlField = "CategoryId" 

to bind the database column. Now when I click a node, it shouldn't go to 'http://www.currentlocation.currentdoc.aspx/1' but 'http://www.differentlocation/differentdoc.aspx?CId=1'

Thanks,
Jochem.
Sandeep Gupta
Top achievements
Rank 2
 answered on 17 May 2012
1 answer
89 views
In scheduler header, I want to write code for datechanged event. How can i access its events?
Ivana
Telerik team
 answered on 17 May 2012
1 answer
112 views
Hi Guys,

I seem to have come across an issue where I'm not displayed any of the paging information when setting the explorermode of a fileexplorer.

If I remove ExplorerMode then I can see the page numbers and number of items. If I add ExplorerMode then this information disappears.

Is this something you are aware of or is there something else I can do to display this information?


Thanks.
Dobromir
Telerik team
 answered on 17 May 2012
1 answer
192 views
Hi,

I have the below show MasterViewtable and NestedViewtable in my radgrid...



 STEP 1 -   I have attached textchanged event for all nestedview textboxes in OnItemCreated

 protected void rdgEmployee_OnItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {
                GridNestedViewItem item = (GridNestedViewItem)e.Item;

                //MeritPerc
                RadNumericTextBox txtPropIncrease = (RadNumericTextBox)item.FindControl("txtPropIncrease");
                txtPropIncrease.TextChanged += new EventHandler(txtPropIncrease_TextChanged);
            }
        }

 STEP 2 - On the nesteview textbox textchanged event, i am getting griddataitem and manipulating my data based on that item.

protected void txtPropIncrease_TextChanged(object sender, EventArgs e)
        {
            RadNumericTextBox txtPropIncrease = sender as RadNumericTextBox;
            GridNestedViewItem Childitem = (GridNestedViewItem)txtPropIncrease.NamingContainer;
            GridDataItem parentItem = Childitem.ParentItem;

            CalculateCompensationByComponent(parentItem, GridOperationType.MeritPercent, txtPropIncrease);
        }


 PROBLEM :   When i change the first textbox value, the respected textbox extchanged event calling,  but after changing first textbox value, i am trying to change the second textbox value, its suppose to call the second textbox textchanged event, its doing as expected, but it calling first textbox textchanged event before calling the its respected ( second textbox ) textchanged event.

Could you please help on this ?  Why its calling the first textbox change event, even though i didn't change the value of it. ?
Vasil
Telerik team
 answered on 17 May 2012
1 answer
92 views
Is it possible to get a div inside the treeview control such that i get the entire tree and below that i get a link. I want it in the same control so that if there are scrollbars for the treeview the link should scroll along with the treeview, like a custom temlated control. so its structure should be something like : 
<div id="myRadTree">
<ul class="rtUL">
        <li class="rtLI rtFirst">
            <div class="rtTop">
                <span class="rtSp"></span>
                <img class="rtImg" alt="" src="Images/Add2Favs_16.png"><span class="rtIn" title="mev3\10000 Folders">10000
                    Folders (mev3)</span></div>
        </li>
        <li class="rtLI rtLast">
            <div class="rtBot">
                <span class="rtSp"></span>
                <img class="rtImg" alt="" src="Images/Add2Favs_16.png"><span class="rtIn" title="mev3\Deleted Items">Deleted
                    Items (mev3)</span></div>
        </li>
</ul>
<div>
<a href="">Link here</a>
</div>
</div>
Plamen
Telerik team
 answered on 17 May 2012
4 answers
180 views
I have a page which has radscriptmanager and radajaxmanager onto it. On the same page i have put the code to handle window.resize. The handler works for all the browser, but when i am zooming in IE8 this event is not called. This behavior is observed when i keep radajaxmanager on the page, when i remove this, even in IE8 it works properly. Please find the code below : 

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>


<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <script language="javascript" type="text/javascript">
        window.onresize = showresize;
        function showresize() {
            alert('Window Resized');
        };
    </script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    
    <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI" 
            Name="Telerik.Web.UI.Common.Core.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI" 
            Name="Telerik.Web.UI.Common.jQuery.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI" 
            Name="Telerik.Web.UI.Common.jQueryInclude.js">
        </asp:ScriptReference>
    </Scripts>
</telerik:RadScriptManager>
<telerik:RadAjaxManager runat="server" ID="ShellAjaxManager" RequestQueueSize="3"  />
    <h2>
        Welcome to ASP.NET!
    </h2>
</asp:Content>

Can you please let me know what i am missing, because this is really strange.
Maria Ilieva
Telerik team
 answered on 17 May 2012
2 answers
112 views
Hi,
Is it possible to transfer items from one radlistbox to another by using OnTransferring server event of Radlistbox with its inbuilt transfer buttons?
Can you provide me some samples about this scenario?

Thanks and Regards,
Santhosh Naik




Santhosh
Top achievements
Rank 1
 answered on 17 May 2012
1 answer
113 views
I use this code to display html text from sql database in rad editor now i want to paste the text with the color , bold to word document.
The words paste normal as text not with any colors or bold text just plain texted

This is the code what i use.
Paragraph heading3 = new Paragraph();
                                    Run heading_run3 = new Run();
                                    Text heading_text3 = new Text(name);
                                    ParagraphProperties heading_pPr3 = new ParagraphProperties();
                                    // we set the style
                                    heading_pPr3.ParagraphStyleId = new ParagraphStyleId() { Val = "Heading" + num.ToString() };
                                    heading3.Append(heading_pPr3);
                                    heading_run3.Append(heading_text3);
                                    heading3.Append(heading_run3);

                                    
                                    wordDoc.MainDocumentPart.Document.Body.Append(heading3);
                                    if (CheckBox1.Checked == true)
                                    {
                                            ///Add Proposal Description to Document
                                            string html2 = drvSql["Sales_Description"].ToString();
                                            //string id = drvSql["Treeselectedid"].ToString();
                                            RadEditor2.Content = html2;
                                            string t;

                                            StringWriter sw = new System.IO.StringWriter();

                                            
                                            t = RadEditor2.Text;
                                           
                                            Paragraph heading2 = new Paragraph();
                                            Run heading_run2 = new Run();
                                            Text heading_text2 = new Text(t);
                                            ParagraphProperties heading_pPr2 = new ParagraphProperties();
                                            //// we set the style
                                            heading_pPr2.ParagraphStyleId = new ParagraphStyleId() { Val = "Indent" + num.ToString() };
                                            heading2.Append(heading_pPr2);
                                            heading_run2.Append(heading_text2);
                                            heading2.Append(heading_run2);
                                            wordDoc.MainDocumentPart.Document.Body.Append(heading2);
                       
                                    }

Rumen
Telerik team
 answered on 17 May 2012
1 answer
151 views
I am getting a NullReferenceException when exporting my grid to Excel.  It happens when I am referencing a button that exists in a GridTemplateColumn.  I am setting the BackColor of the GridTableCell the button exists in and the CommandArgument of the button in the ItemDataBound event of the grid.

These are the lines I get the exception on.
((GridTableCell)btn.Parent).BackColor = System.Drawing.Color.Red;
btn.CommandArgument = "etid=" + drv["JOC_Event_Ticket_ID"] + "&ttype=" + drv["Ticket_Type_ID"];

Is there a way to get around this when exporting to Excel?
int ticket_number = int.Parse(DataBinder.Eval(e.Item.DataItem, "Ticket").ToString());
                if (Ticket_number > 0)
                {
                    if (ticket_number > 0)
                    {
                        e.Item.Cells[13].BackColor = System.Drawing.Color.Red;
                        ((GridTableCell)btn.Parent).BackColor = System.Drawing.Color.Red;
                    }
                    if (drv["JOC_Event_Ticket_ID"].ToString().Length > 0)
                    {
                        btn.CommandArgument = "etid=" + drv["JOC_Event_Ticket_ID"] + "&ttype=" + drv["Ticket_Type_ID"];
                    }
                    else
                    {
                        btn.CommandArgument = "problem_no=" + drv["Ticket"] + "&ttype=1"; // +drv["Ticket_Type_ID"];
                    }
                }


Thanks,
Steven
Daniel
Telerik team
 answered on 17 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?