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

Hi everybody,
I have issue with Enter key pressed on radnumerictextbox. This key is not handled by OnKepPress event  in clientevents with IE9 and Chrome 23 (only work fine in firefox)
Is there any workaround to have Enter key handled by RadNumericTextBox in IE and Chrome?
I use Telerik version 2012.1.411.35

--------Control-------

<telerik:RadNumericTextBox ID="zoomNumber" runat="server" Height="25" Type="Number"
                                                AutoPostBack="False" ShowSpinButtons="True" Width="55px" MaxValue="400" MinValue="25"
                                                Value="100" Enabled="True" ReadOnly="False">
                                                <NumberFormat DecimalDigits="0"></NumberFormat>
                                                <IncrementSettings Step="8" InterceptMouseWheel="False"></IncrementSettings>
                                                <EnabledStyle ForeColor="#FFFFFF" BackColor="#215C7A" BorderColor="#333333" HorizontalAlign="Right" />
                                                <ClientEvents OnValueChanged="zoomChanged" OnValueChanging="zoomChanging" OnKeyPress="onNumericKeyPress"></ClientEvents>
                                            </telerik:RadNumericTextBox>

---------Javascript-------------

  function onNumericKeyPress(sender, args) {
        if (sender != null) {
            if (args.get_keyCode() == 13) {
                sender.set_value(parseFloat(sender.get_editValue()));
            }
            var c = args.get_keyCode();
            if ((c < 48) || (c > 57))
                args.set_cancel(true);
        }
    }


Best regards,
Ba

Eyup
Telerik team
 answered on 21 Dec 2012
3 answers
258 views
Hi,
I am using Rad grid . The UI is as below:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
  <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="radgrid1">
      <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="radgrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
        <telerik:AjaxUpdatedControl ControlID="hdnRowsCount" LoadingPanelID="RadAjaxLoadingPanel1" />       
      </UpdatedControls>
    </telerik:AjaxSetting>
  </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" 
  Width="75px" Transparency="25">
  <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
    style="border: 0;" /></telerik:RadAjaxLoadingPanel>
      
    <asp:HiddenField ID="hdnRowsCount" runat="server" Value="0" />
  
    <telerik:RadGrid ID="radgrid1" runat="server" ShowStatusBar="True"
        ShowFooter="True" OnItemCommand="radgrid1_ItemCommand" OnDeleteCommand="radgrid1_DeleteCommand"
        OnInsertCommand="radgrid1_InsertCommand" OnUpdateCommand="radgrid1_UpdateCommand"
        OnNeedDataSource="radgrid1_NeedDataSource" 
        onitemdatabound="radgrid1_ItemDataBound" CellSpacing="0" 
        GridLines="None" >
        <MasterTableView DataKeyNames="ProductNumber" AutoGenerateColumns="false" EditMode="InPlace"
            CommandItemDisplay="TopAndBottom" CommandItemSettings-AddNewRecordText="Add New Purchase Order">           
            <Columns>
  
</columns>

I am getting the error  "Microsoft JScript runtime error: Sys.ArgumentNullException: Value cannot be null. Parameter name: panelsCreated[3]". The grid and the ajax is inside a panel , which is defined as below:

<asp:Panel ID="PnlRequest" runat="server">

How to fix this?
Thanks
Maria Ilieva
Telerik team
 answered on 21 Dec 2012
1 answer
150 views
I am using the RadSessionPageStatePersister approach for storing t he viewstate in session and I am getting the following error. Please help me out.

[InvalidCastException: Specified cast is not valid.]

at System.Web.UI.SessionPageStatePersister.Load()

[HttpException: The state information is invalid for this page and might be corrupted.]
at System.Web.UI.SessionPageStatePersister.Load()
at Telerik.Web.UI.RadSessionPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,\ Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,\ Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.default_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Martin
Telerik team
 answered on 21 Dec 2012
1 answer
73 views
Hi,

Sub:  RadEditor: Problem with InsertLinks 

When I  select image or Links in editor and click on Insert Links extra space is adding below the selected image/Links.

Can Anyone help?

Thanks in Advance
Marin Bratanov
Telerik team
 answered on 21 Dec 2012
7 answers
353 views
Hi,

my approach is to backup files when a user loads up a file which already exists in the filesystem.
I took a look at the online documentation as well as in the DBContentProvider - but without meaningful documentation it would really mean a lot of time to figure out what parameters to pass where.

And if I see constructors with 7 parameters like for DirectoryItem it is pretty hard to develop something without documentation.
And by the way - the example (DBContentProvider) deals with slashes - as well for url's (normal) as for filepaths (where I would use backslashes for the file system).
A lot of parameter are simply give as string.Empty...

So the idea of writing an own provider is good - and since the FileExplorer does not offer server methods like the RadUpload to handle uploading (storing) files it seems to be the only possible method.
BUT - due to the poor documentation it is impossible for me to build such a thing within a timeframe that seems to be acceptable.

Is there any sample for a filesystem provider?

The approach is nothing less or more than:
If a file gets deleted - create a backup copy.
If a file will be overwritten - create a backup copy.

In http://www.telerik.com/community/forums/aspnet-ajax/file-explorer/select-a-file-in-code.aspx#792727 someone asked a member to provide code in the Code Library - but the Library does not even have a section for FileExplorer.

Regards

Manfred
Fiko
Telerik team
 answered on 21 Dec 2012
1 answer
685 views
I am getting this error

Sum is not supported for type "System.Object"

For testing purposes i am using one table only.

The table Design is

ProductID autonumber
ID  int
ProductName Varchar(100)
Price Varchar(150)

Then i also added DataType=DataType=System.Decimal then i get an error

A value of type 'String' cannot be converted to type 'Decimal?'


This is my ASPX code
 
<asp:Content ID="Content2" ContentPlaceHolderID="contentplaceholder1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All"
        EnableRoundedCorners="false" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadGrid ID="RadGrid1"
        Width="100%" AllowSorting="True"
        ShowFooter="True" PageSize="15" AllowPaging="True" AllowMultiRowSelection="True" ShowChooser="true"
        runat="server" GridLines="None" AutoGenerateColumns="False" CellSpacing="0" DataSourceID="ObjectDataSource1">
        <MasterTableView Width="100%" Summary="RadGrid table" RetrieveAllDataFields="false"
            DataSourceID="ObjectDataSource1">
            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="Productid" HeaderText="Productid" DataType="System.Int32"
                    SortExpression="Productid">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="id" HeaderText="id" DataType="System.Int32" FilterControlAltText="Filter id column"
                    SortExpression="id" UniqueName="id">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" FilterControlAltText="Filter ProductName column"
                    SortExpression="ProductName" UniqueName="ProductName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Price" HeaderText="Price" SortExpression="Price" Aggregate="Sum" FooterText="Total price: ">
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
    </telerik:RadGrid>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetListProduct"
        TypeName="Business.ProductManager"></asp:ObjectDataSource>
</asp:Content>




 
/////////////////////////////////////////////////////////////////////////
 public static ProductList GetListProduct()
        {
            ProductList tempList = null;
 
 
            string sql = "SELECT * from Product";
            //using (SqlConnection myConnection = new SqlConnection(AppConfig.ConnectionString))
            using (SqlConnection myConnection = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["NLayer"].ConnectionString))
            {
                using (SqlCommand myCommand = new SqlCommand(sql, myConnection))
                {
                    myConnection.Open();
 
                    using (SqlDataReader myReader = myCommand.ExecuteReader())
                    {
                        if (myReader.HasRows)
                        {
                            tempList = new ProductList();
                            while (myReader.Read())
                            {
                                tempList.Add(FillDataRecordProduct(myReader));
                            }
                        }
                        myReader.Close();
                    }
                }
                return tempList;
 
            }
        }
 
 
 private static Product FillDataRecordProduct(IDataRecord myDataRecord)
        {
            Product myUserTracking = new Product();
 
            myUserTracking.Productid = myDataRecord.GetInt32(myDataRecord.GetOrdinal("Productid"));
            myUserTracking.id = myDataRecord.GetInt32(myDataRecord.GetOrdinal("id"));
            myUserTracking.ProductName = myDataRecord.GetString(myDataRecord.GetOrdinal("ProductName"));
 
            myUserTracking.Price = myDataRecord.GetString(myDataRecord.GetOrdinal("Price"));
 
 
            return myUserTracking;
        }

         



Eyup
Telerik team
 answered on 21 Dec 2012
4 answers
94 views
I am trying to save setting to SQL. It works fine until I recompile and then it falls apart.


Does anyone have an example of the GridSettingsPersister that uses the BinaryFormatter instead of the LosFormatter?

I am still unable to get the BinaryFormatter to work. Has anyone been able to get the GridSettingsPersister to work with the BinaryFormatter?

public override string ToString()
{
    //LosFormatter formatter = new LosFormatter();
    BinaryFormatter formatter = new BinaryFormatter();
 
 
    //using (StringWriter writer = new StringWriter())
    using (MemoryStream writer = new MemoryStream())
    {
        formatter.Serialize(writer, this);
        string arr = writer.ToString();
        return arr.ToString();
    }
}
 
 
 
 
/// <summary>
/// Gets the GridSettingsCollectionInstance from its serialized string data
/// </summary>
/// <param name="data">The object as serialized string data</param>
public static GridSettingsCollection LoadFromSerializedData(string data)
{
   //LosFormatter formatter = new LosFormatter();
   BinaryFormatter formatter = new BinaryFormatter();
 
    
   byte[] arr = System.Text.Encoding.ASCII.GetBytes(data);
   MemoryStream stream = new MemoryStream(arr);
 
   //return (GridSettingsCollection)formatter.Deserialize(data);
   return (GridSettingsCollection)formatter.Deserialize(stream);
 
    
}

Brad
Top achievements
Rank 2
 answered on 21 Dec 2012
14 answers
437 views
Hi all,
I have a page that has a radupload control on it. In the code behind we check to make sure the uploadedfiles collection has something in it before we attempt to process the uploaded file.

This works on every system in our dev environment except for one. We have tried copying the directory tree between systems, completely wiping the directory and starting from scratch, and checking every setting we can think of.

It does not use an AJAX post-back, the app is set to run Full Trust, and we are not changing the masterpageID in the init. 

Any ideas? banging my head against a wall on this one.

Patrick
Plamen
Telerik team
 answered on 21 Dec 2012
5 answers
252 views
Problem Firefox and google chrome. IE is working.
we are using radeditor version (2009.2.701.35) in vs.net 2008(asp.net) application.
we have scenario like to show a editor in ajax modal popup when on click button event.
modal popup shows editor with all tools defined(font dropdown,size dropdown like..)
then enter some content text into editor and try to change size or font name by selecting dropdowns nothing is open.
and when i hit save button inside modalpopup enterd content does not retained to in to the save click event.

I have also checked this with version 2010.1.519.35 latest version. but no luck.

this is very important and urgent . please provide any workaround to this.

thanks in advance.
Slav
Telerik team
 answered on 21 Dec 2012
3 answers
313 views

Hi,

I am using Sharepoint 2010. I have added the rad grid and i also added the radajax manager.

I would like to know the difference between "RadAjaxManager and RadScriptManager" and whcih should be used in sharepoint 2010?

Below is the radajax code i have used:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="radgrid1">
                        <UpdatedControls>
 <telerik:AjaxUpdatedControl ControlID="radgrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="hdnRowsCount" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
                Width="75px" Transparency="25">
                <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
                    style="border: 0;" /></telerik:RadAjaxLoadingPanel>

Also, in the cs, i have manually added the ajax as below for sharepoint 2010:
RadAjaxManager ajaxmgr;
  
        protected override void CreateChildControls()
        {
            Control control = Page.LoadControl(_ascxPath);
            Controls.Add(control);
  
            RadAjaxLoadingPanel loadingPanel = control.FindControl("RadAjaxLoadingPanel1") as RadAjaxLoadingPanel;
            RadGrid grid = control.FindControl("radgrid1") as RadGrid;
            //Find more controls to add to the ajax settings
            if (ajaxmgr != null)
            {
                ajaxmgr.AjaxSettings.AddAjaxSetting(grid, grid, loadingPanel);
            }
  
        }
  
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            ajaxmgr = RadAjaxManager.GetCurrent(Page);
            if (ajaxmgr == null)
            {
                ajaxmgr = new RadAjaxManager();
                Page.Items.Add(typeof(RadAjaxManager), ajaxmgr);
            }
  
            if (Page.Form != null)
            {
                Page.Form.Controls.AddAt(0, ajaxmgr);
            }
            EnsureChildControls();
        }

Thanks
Maria Ilieva
Telerik team
 answered on 21 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?