Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
106 views
Hi,

i want to rename my file. But i got a IOException. It says "The Process Cannot Access the File Because It Is Being Used by Another Process".

This is my Code:

<telerik:RadAsyncUpload ID="rauKachelUpload" runat="server" ChunkSize="0" Localization-Cancel="Löschen" Localization-Remove="Entfernen" Localization-Select="Auswählen"
  Culture="de-DE" Skin="MetroTouch" MaxFileInputsCount="1" OnFileUploaded="rauKachelUpload_FileUploaded">
</telerik:RadAsyncUpload>

Protected Sub rauKachelUpload_FileUploaded(sender As Object, e As FileUploadedEventArgs)
 
    Try
        Using fileStream As Stream = e.File.InputStream
            Using img As System.Drawing.Image = System.Drawing.Image.FromStream(fileStream)
                Dim h As Integer = img.Height
                Dim w As Integer = img.Width
                img.Dispose()
                Dim fileName As String = e.File.GetName()
                If w = MaxWidth And h = MaxHeight Then
                    rauKachelUpload.TargetFolder = "img/kachel_grafik"
 
                    Dim TimeStamp As String = DateDiff("s", "01/1/1970 12:00:00 AM", DateTime.Now)
                    fileName = "KI_" & TimeStamp & WelcheSparteUndGröße
 
                    KachelPfad = "~/img/kachel_grafik/" & fileName
                Else
                    KachelFalsch = True
                End If
                If KachelFalsch = False Then
 
                    e.File.SaveAs(fileName)
 
                    Page.ClientScript.RegisterClientScriptBlock([GetType](), "CloseScript", "redirectParentPage('VermittlerBearbeiten.aspx?ID=" & VermittlerID & "&KBFN=" & KachelPfad & "&NA=true" & "&fwg=" & WelcheSparteUndGröße & "&Ang1=" & hfAng1CHK.Value & "&Ang2=" & hfAng2CHK.Value & "&Ang3=" & hfAng3CHK.Value & "&Ang4=" & hfAng4CHK.Value & "&AngSrc1=" & hfKachelIMGSrcBaufi.Value & "&AngSrc2=" & hfKachelIMGSrcImmo.Value & "&AngSrc3=" & hfKachelIMGSrcPhoto.Value & "&AngSrc4=" & hfKachelIMGSrcAsse.Value & "');", True)
                Else
                    rnfIconNichtErzeugt.Visible = True
                End If
            End Using
        End Using
    Catch ex As Exception
        rnfIconNichtErzeugt.Visible = True
    End Try
 
End Sub

Without trying to rename my file, it works fine.

Thanks for reading.
Daniel
Nencho
Telerik team
 answered on 16 Dec 2013
3 answers
139 views
Hi,

I need to make this control to be accessibility compliant. I have already patched it for aria-markup, but when I turn on high contrast mode, the images for collapsing/expanding the control and the nodes, just disappear.

I have placed a span with "+" and "-" symbols just before the "rtSp" span. But now the problem is that I need to keep them synchronized with the status of the node (expanded or collapsed).

I am trying to avoid to manually place events in all of the objects that can originate an expand/collapse operation.

Do you have a client event for expand or collapse that I can use to update the status of the node?

Thanks


Princy
Top achievements
Rank 2
 answered on 16 Dec 2013
1 answer
109 views
Hi,
I have a TreeList control, with an insert template as below:

            <EditFormSettings EditFormType="Template">
                <FormTemplate>
                    <table>
                        <tr>
                            <td>Is this a header:
                            </td>
                            <td>
                                <asp:checkbox ID="cbIsHeader" runat="server" />
                            </td>
                        </tr>                       
                        <tr>
                            <td>Header Text:
                            </td>
                            <td>
                                <asp:TextBox ID="txtNewHeader" Text='<%# Bind("DepartmentList_Header")%>' runat="server">
                                </asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>Department</td>
                            <td><asp:DropDownList runat="server" ID="ddlDepartments"/></td>
                        </tr>
                    </table>
                    <asp:Button ID="btnUpdate" Text="Insert"
                        runat="server" CommandName="PerformInsert"></asp:Button>
                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                        CommandName="Cancel"></asp:Button>
                    <asp:HiddenField ID="hfParent" runat="server" Value='<%# Bind("DepartmentList_Parent")%>' />
                </FormTemplate>
            </EditFormSettings>

I am trying to pre-populate the drop down menu from a stored procedure, but not certain how this could be accomplished. Can anyone help?

Cheers,
Mark
Konstantin Dikov
Telerik team
 answered on 16 Dec 2013
1 answer
111 views
In my application, I save the user preferences/settings for all docking when the user closes the application.  If they accidentally click on the "X" to close a dock, when they load the application again, it does not load that dock panel.  I have to delete their preferences.xml file so that it erases all preferences.

Does anyone know how to disable the close button on a radDock or radPanel control?

Thanks!
Shinu
Top achievements
Rank 2
 answered on 16 Dec 2013
1 answer
163 views
Maybe it's impossible to do, probably is.

If I do have 300,000 rows of data,  I'm guessing grouping in 1 large grid with no paging wouldn't work so well.
Princy
Top achievements
Rank 2
 answered on 16 Dec 2013
1 answer
439 views

I'm working on a small project for work and I'm using Telerik:RadGrid controls. I'm trying to pass a query string with the DO name in the GridHyperLinkColumn. When the page renders and I hover over the link the query string is null (ie: GMRanking.aspx?DO=). It seems like a binding issue but I'm at a loss. Thanks in advance for your help.

I'm populating the grid like so:

    var contestResults = ContestBiz.GetGMData();

    GMGrid.DataSource = contestResults.Select(x => x.DoName).Distinct();

    GMGrid.DataBind();

Here's what I've got in the aspx

            <Columns>               
                <telerik:GridHyperLinkColumn 
                    Text="Select"
                    HeaderStyle-Width="50px" 
                    UniqueName="Link" 
                    DataNavigateUrlFields="DO"
                    DataNavigateUrlFormatString="~/GMRanking.aspx?DO={0}">
                </telerik:GridHyperLinkColumn>

                <telerik:GridBoundColumn DataField="DO" 
                    HeaderText="DO" UniqueName="DO" >
                    <HeaderStyle HorizontalAlign="Left" Font-Bold="true" />
                    <ItemStyle HorizontalAlign="Left" />
                </telerik:GridBoundColumn>                
            </Columns>
Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Dec 2013
1 answer
176 views
Hi ,
      I use the following code to export the Radgrid to Excel.It works well before.. but When I used the Try Catch block , the grid is not exporting..  In the Open,Save Cancel whatever I press it didnt respond.If I remove the Try catch it works fine.I used Need datasource too..Please help me. Thanks in Advance.

try

{

RadGrid grdexp = new RadGrid();

RadGridExp.Visible =

true;

           

 

DataSet ds = Search();

RadGridExp.DataSource = ds;

RadGridExp.DataBind();

DateTime date = DateTime.Now;

RadGridExp.MasterTableView.Controls.Add(

new LiteralControl("This report was generated on " + date));

           

RadGridExp.ExportSettings.FileName =

 

"Test";

RadGridExp.ExportSettings.OpenInNewWindow =

true;

RadGridExp.MasterTableView.ExportToExcel();

}

catch (Exception ex)

{

string rtnstr;

rtnstr =

ExceptionObject.Builderrormsg(this.Page.ToString(), "btnExport_Click", ex.Message);

Exceptionlog.Error(rtnstr);

Session[

"Errmsg"] = ex.Message;

Response.Redirect(

"NoAccess.aspx?Type=2");

}

 
Princy
Top achievements
Rank 2
 answered on 16 Dec 2013
5 answers
107 views
Hello,


How i got the data from database and now how do i show the data in the html chart 
http://demos.telerik.com/aspnet-ajax/htmlchart/examples/databinding/loadingdata/defaultcs.aspx ), not by using xml data source.. 
i am actually showing the rank of the person  <%= Locality %> now i need to embed all the data in the chart..
How do i do that?

attachment is my previous code.. 

Thanks.

Mani
Top achievements
Rank 1
 answered on 16 Dec 2013
2 answers
229 views
Hello,

I have an RadComboBox with autopostback set to "true". I've also a requiredvalidator on the RadComboBox. The Combo containes a "Select" element with a value "-1". When I switch from one item to the "Select" item, the validator fires and displays but the combo still makes a postback.

Sample:

<telerik:RadComboBox runat="server" ID="uxDepartment" Width="325px" AutoPostBack="true"
        CausesValidation="false" OnSelectedIndexChanged="uxDepartment_SelectedIndexChanged" />
<asp:RequiredFieldValidator runat="server" InitialValue="-1"
          ControlToValidate="uxDepartment" ErrorMessage="<%$ Resources:UI,inputRequired %>" />

Telerik version is 2010.2.826.35

Any idea?

Best regards
Silvio Silva Junior
Top achievements
Rank 2
 answered on 14 Dec 2013
6 answers
161 views
I have implemented the custom upload handler and per the demo and it all works fine except, for uploading any images larger than 2 mb.

The file gets uploaded but,the images are corrupted.
Also, I tried creating a thumbprint of the file as it is being uploaded but I get and error when trying to creating and image from the stream.
Image.FromStream(stream);
throws error "invalid parameter".

I would guess there is some settings in web.config which have missed but I can't work it out.

Thanks
Karl


Asp.Net 4.0
Windows 7
Telerik 2010.3.1109.40
Language c#
Hristo Valyavicharski
Telerik team
 answered on 14 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?