Telerik Forums
UI for ASP.NET AJAX Forum
12 answers
172 views
hi,

I have a radUpload control named "radUp".

When I click on the submit button I call "uploadFile" :
"renameFile" is the new name written by the user on a textbox.
I want to save the file with this name, but I have 2 files on my Directory "Documents" after click: the renamed file and the other .... I want only the renamed file ... what's wrong?

protected void uploadFile()
        {
            if (radUp.UploadedFiles.Count > 0)
            {
                foreach (UploadedFile file in radUp.UploadedFiles)
                {
                    String targetFolder = Server.MapPath("~/Documents");
                    file.SaveAs(Path.Combine(targetFolder, renameFile.Text));
                }
            }
        }

Thanks
Waseem
Top achievements
Rank 1
 answered on 24 Nov 2012
0 answers
57 views
hey guys,

   I want to apply filtering inside radgrid using combobox but i always find only demo with sqldatasource
which i don't want I want filtering without using sqldatasource


any one can have solution?
Coolbudy
Top achievements
Rank 1
 asked on 24 Nov 2012
2 answers
201 views

Hi,
   I have used TextBox in my project.
This is my coding
 <asp:TextBox Width="95%" ID="Email" AutoCompleteType="Disabled" runat="server" CssClass="Lowercase1" Text='<%# Bind("emailid") %>'  MaxLength="50" onkeydown = "return (event.keyCode!=13);"></asp:TextBox>

Text box validate in Email

<telerik:RadInputManager ID="RadInputManager1" runat="server" EnableEmbeddedSkins="false">
 <telerik:RegExpTextBoxSetting ValidationExpression="^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$"
   ErrorMessage="Invalid Email" EnabledCssClass="Lowercase1" DisabledCssClass="Lowercase1">
    <TargetControls>
      <telerik:TargetInput ControlID="Email" />
    </TargetControls>
  </telerik:RegExpTextBoxSetting>
</telerik:RadInputManager>

this coding is working perfectly but AutoCompleteType="Disabled" is not working

same as Web address validation

<telerik:RegExpTextBoxSetting ValidationExpression="www.([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"
  ErrorMessage="Invalid Web Address" EnabledCssClass="Lowercase1" DisabledCssClass="Lowercase1">
   <TargetControls>
      <telerik:TargetInput ControlID="WebAddress" />
    </TargetControls>
 </telerik:RegExpTextBoxSetting>

Plz reply soon

Thanks,
Ansari


Tamim
Top achievements
Rank 1
 answered on 24 Nov 2012
1 answer
153 views
I have a formview inside my radwindow.  If close button is clicked inside a formview I want the window to close.
I tried to call javascript to close window, event is fired, but it does not close the window.
**********  Javascript ************

 function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow)
                    oWindow = window.radWindow;
                else if (window.frameElement.radWindow)
                    oWindow = window.frameElement.radWindow;
                return oWindow;
            }

            function Close() {
                var arg = new Object();
                var oWnd = GetRadWindow();
                oWnd.close(arg);  
            }

********** Button to close the radwindow inside formview **************
      <asp:LinkButton ID="lnkBtnClose" runat="server" CausesValidation="False" CommandName="Close"                                    Text="Close" ToolTip="Close"  OnClientClick="Close(); return false;" />
Kevin
Top achievements
Rank 2
 answered on 23 Nov 2012
2 answers
250 views
Hello,

When I try to use raddatepicker.selecteddate  for a datetime var I get this error:

Cannot implicitly convert type 'object' to 'System.DateTime'. An explicit conversion exists (are you missing a cast?)
 
Here is my code:

    public partial class RegistroFalla
    {
        public int ID_Falla { get; set; }
        public Nullable<int> Duracion_Falla { get; set; }
        public System.DateTime Fecha { get; set; }
        public System.DateTime Hora_Deteccion { get; set; }
        public System.DateTime Hora_Diagnostico { get; set; }
        public System.DateTime Hora_Ocurrencia { get; set; }
        public System.DateTime Hora_Recuperacion { get; set; }
        public System.DateTime Hora_Solucion { get; set; }
        public string Descripcion { get; set; }
        public System.DateTime Tiempo_Deteccion { get; set; }
        public System.DateTime Tiempo_Recuperacion { get; set; }
        public System.DateTime Tiempo_Reparacion { get; set; }
        public System.DateTime Tiempo_Respuesta { get; set; }
        public string Division { get; set; }
    }

   var Fallo = new RegistroFallas.Model.RegistroFalla
                {
                    Hora_Ocurrencia = dpOcurrencia.SelectedDate,
                    Fecha = rdpFecha.SelectedDate,
                    Descripcion = txtDescripcion.Text,
                    Hora_Deteccion = rdpDeteccion.SelectedDate,
                    Hora_Diagnostico = rdpDiagnostico.SelectedDate,
                    Hora_Solucion = rdpSolucion.SelectedDate,
                    Hora_Recuperacion = rdpRecuperacion.SelectedDate
                };


Thanks,

Jorge
Jorge
Top achievements
Rank 1
 answered on 23 Nov 2012
2 answers
99 views
The code that I'm managing used an older version of the Telerik assemblies. We recently upgraded the assemblies to the most recent version. Upon upgrading said files, I received complaints that the paging was no longer showing on a grid. This is weird, since "Allow Paging" is set to True in the markup. I did some playing around and noticed if I removed the GroupByExpressions from the grid, the paging works fine. The GroupByExpressions seems to work fine either way, but is preventing the paging from working. Could someone possibly shine some light on the situation? I've included the grid's code below. Note: Ignore the empty strings; I removed some of the values for security reasons.

<telerik:RadGrid ID="RgStatusGrid" runat="server" AllowPaging="True" GridLines="None"
    AllowSorting="true" PageSize="50" OnNeedDataSource="RgStatusGrid_NeedDataSource"
    OnItemDataBound="OnItemDataBound" OnSortCommand="RgStatusGrid_SortCommand">
    <MasterTableView AutoGenerateColumns="false">
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <SelectRegions>
                    <telerik:GridGroupByRegion RegionName="StateName" HeaderText="State" SortOrder="Ascending" />
                    <telerik:GridGroupByRegion RegionName="CityName" HeaderText="City" SortOrder="Ascending" />
                </SelectRegions>
                <GroupByRegions>
                    <telerik:GridGroupByRegion RegionName="StateName" HeaderText="State" SortOrder="Ascending" />
                    <telerik:GridGroupByRegion RegionName="CityName" HeaderText="City" SortOrder="Ascending" />
                </GroupByRegions>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
        <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridBoundColumn UniqueName="StateName" DataRegion="StateName" HeaderText="State" Visible="false" />
            <telerik:GridBoundColumn UniqueName="CityName" DataRegion="CityName" HeaderText="City" Visible="false" />
            <telerik:GridBoundColumn DataRegion="RegionName" HeaderText="Region" />
            <telerik:GridBoundColumn DataRegion="Area" HeaderText="Area (acres)" DataFormatString="{0:F2}" />
            <telerik:GridBoundColumn DataRegion="" HeaderText=""
                DataFormatString="{0:MM/dd/yyyy}" />
            <telerik:GridBoundColumn DataRegion="" HeaderText=""
                DataFormatString="{0:MM/dd/yyyy}" />
            <telerik:GridBoundColumn DataRegion="" HeaderText=""
                DataFormatString="{0:MM/dd/yyyy}" />
            <telerik:GridBoundColumn DataRegion="" HeaderText=""
                DataFormatString="{0:MM/dd/yyyy}" />
            <telerik:GridBoundColumn DataRegion="" HeaderText="" DataFormatString="{0:MM/dd/yyyy}" />
            <telerik:GridBoundColumn DataRegion="" HeaderText="" />
            <telerik:GridBoundColumn DataRegion="" HeaderText="" DataFormatString="{0:MM/dd/yyyy}" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
Brandon
Top achievements
Rank 1
 answered on 23 Nov 2012
3 answers
329 views
I was able to accomplish session expiration using the notification control set up for my web application thanks to this demo:

http://demos.telerik.com/aspnet-ajax/notification/examples/sessiontimeout/sessionexpired.aspx

However, this approach is based on a set timeout value and the notification just pops up every timed interval, regardless if the user is active or not. Can the session timeout be set/reset dynamically based on user inactivity? Possibly every time there is an Ajax request call? Some sample codes would be much appreciated. Thanks.
SDI
Top achievements
Rank 1
 answered on 23 Nov 2012
6 answers
98 views

Greetings,

I am new to Telerik (pretty new to asp.net) and cannot figure out why my AXAX CascadingDropDown events do not fire when I wire them up to control my RadAjaxLoadingPanel. The LoadingPanel updates but no SelectedIndexChanged event is call.

My code works when I disable/remove theRadAjaxLoadingPanel
 
I looked all over for the CascadingDropDown example but no success. I saw that I might need to rebind, but I'm not sure what I'm looking for to do this? Thanks

ASPX Page

<form id="frm1" runat="server" class="" enableviewstate="true">
 
<telerik:RadScriptManager runat="server" ID="RadScriptManager1">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
        EnablePageHeadUpdate="False" ViewStateMode="Enabled">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="auto_ddlMake">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="auto_ddlModel">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="lnkReset" EventName="Click">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
<asp:DropDownList ID="auto_ddlMake" runat="server" AutoPostBack="True" class="itext"
                        OnSelectedIndexChanged="auto_ddlMake_SelectedIndexChanged" Width="125px" />
                    <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" Category="Make"
                        ParentControlID="auto_ddlYear" PromptText="-- Pick --" ServiceMethod="GetMakes"
                        ServicePath="CascadingDropDown.asmx" TargetControlID="auto_ddlMake" />
 
<asp:DropDownList ID="auto_ddlModel" runat="server" AutoPostBack="True" class="itext"
                        OnSelectedIndexChanged="auto_ddlModel_SelectedIndexChanged" Width="125px" />
                    <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" Category="Model"
                        ParentControlID="auto_ddlMake" PromptText="-- Pick --" ServiceMethod="GetModels"
                        ServicePath="CascadingDropDown.asmx" TargetControlID="auto_ddlModel" />
<asp:LinkButton ID="lnkReset" runat="server" CausesValidation="False" OnClick="btnReset_Click"
                        Text="Reset" ToolTip="Clear all fields"></asp:LinkButton>
 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" ViewStateMode="Enabled">
        <div class="loading">
            Loading<br />
            <asp:Image ID="Image1" runat="server" ImageUrl="~/images/loading1.gif" AlternateText="loading">
            </asp:Image>
        </div>
    </telerik:RadAjaxLoadingPanel>
</form>

Codebehind

protected void auto_ddlModel_SelectedIndexChanged(object sender, System.EventArgs e)
    {
        Response.Write("ddlmodel Called!");
        Response.End();
    }

 

Pavlina
Telerik team
 answered on 23 Nov 2012
3 answers
63 views
We've encountered an unusual problem where sometimes if multiple tabs have been opened and closed (with pageviews being destroyed etc) that some tabs seem to "swap" their text.

All tabs definitely have a unique ID (based on record type, record id etc).

Also, possibly related, sometimes a tab will display the pageview from another tab at the bottom.
This is not a problem we can reproduce via set steps, it just seems to randomly happen.

Has anyone else encountered this? Any ideas on a possible solution?

Cheers
Rich
Nencho
Telerik team
 answered on 23 Nov 2012
9 answers
119 views
I try to combine the example "TreeView in ComboBox" and "TreeView / Programmatic Data Binding"
I use "BindToDataSet(ByVal treeView As RadTreeView)", but i only get  System.NullReferenceException.
Tips on what the problem might be, or is there any example (vb) available?
Boyan Dimitrov
Telerik team
 answered on 23 Nov 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?