Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
1.3K+ views
Hi 

I have a requirement like I want to disable the autocomplete feature for a particular textbox. Also is it possible to restrict the cut copy and paste operation?

Thanks,
Tia.
Dhamodharan
Top achievements
Rank 1
 answered on 25 Mar 2015
1 answer
94 views
 Hello,
I want to check how we can show the custom error messages inside the grid. so in this case, if returned rows are more than 100, we need to show a message for user to narrow down the search.

I enabled EnabledNoRecordsTemplate for the grid if no records are returned but not sure how we can another message inside the grid based on some condition.

Your help will be highly appreciated.

Thanks!
Konstantin Dikov
Telerik team
 answered on 25 Mar 2015
3 answers
249 views
Sorry for the long description but it's the only way I can explain this.

I'm currently working on a RadGrid with 5 columns. On page load if there are existing rows for an invoice, they are loaded into the grid, if there are none then it creates a new one ready for batch editing. When the user fills in the Code cell and tabs to the next which is Description, I make a webmethod call to the database to get the corresponding description and want to will that into the next column. This is all working, until I add multiple rows. For some reason the indexes retrieve the rows in inverse order. For example if I create the first row, fill in Code, hit tab, Description is populated from the database. If I create another row, fill in Code, hit tab, Description in the first row updated, not two. If I change the Code in row one again, Description in row two is updated. This holds up for any number of added rows. If there are any existing rows from the database, this does not happen. I can update Code and Description is updated correctly. When I try to add new rows to a table with existing loaded from the database, the crazy index logic starts again.

Here is the javascript I am using to make the cell changes. This is called on RadGrid2_OnBatchEditCellValueChanged:
function getDescription(sender, args) {
                var grid = $find('<%= RadGrid2.ClientID %>');
                var masterTable = grid.get_masterTableView();
                var rows = masterTable.get_dataItems();
                var rowArgs = args.get_row();
                var rowIndex = rowArgs.sectionRowIndex;
                var row = rows[rowIndex];
                var newValue = args.get_editorValue();
 
                var lineDescCell = row.get_cell("Description");
                var lineDesc = sender.get_batchEditingManager().getCellValue(lineDescCell);
 
                $.ajax({
                    type: "POST",
                    url: "Invoice.aspx/LookupCode",
                    data: JSON.stringify({ code: newValue }),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (msg) {
                        lineDesc = (!msg || !msg.d) ? "Invalid Code" : msg.d;
                        grid.get_batchEditingManager().changeCellValue(lineDescCell, lineDesc);
                    },
                    error: function (response) {
                        alert('LookupCode failed: ' + response);
                    }
                });
            }

If I can provide any extra explanation or code please let me know. Any help on this issue would be much appreciated.

Nick
Nick
Top achievements
Rank 1
 answered on 25 Mar 2015
1 answer
119 views
we are using the latest version of Rad Editor.  we have some third party javascript widgets which we have installed within the html.  we have the scripts filter turned off. 

the problem we are having is that when we go to edit the html the java applets are running and displaying the appropriate data. when we go to save the form, the html changes are saved but so is the applet data instead of the java script which existed prior to page loading.

Is there a way to prevent this from occurring?  the problem is that the vendors require the javascript to be embeded within the html in the spot where the data is to be displayed..

Thanks for your help and ideas.
Ianko
Telerik team
 answered on 24 Mar 2015
5 answers
564 views
I'm not a .Net programmer by trade but, I need to make some customizations to editor. I was wondering if someone could tell me if WebResource.axd creates a local cache of the javascript files that are sent to the client when requested, and how to force the cache to be re-generated from the source copies? My changes aren't showing up on the client side even after clearing cache, disabling browser cache and trying on 3 different browsers.
Ianko
Telerik team
 answered on 24 Mar 2015
4 answers
97 views
I have an issue when attempting to print from the RadEditor in IE11.  
The print button opens the standard print dialog box - which prints the entire web page - not the contents of the radeditor in either div or iframe contentmode.
In Chrome it works fine - it opens a preview page which prints the contents as expected.
I have attempted to use togglefullscreen to send the radeditor into full screen mode - but it only expands as far as the bounds of the table cell it is contained within, in chrome in works fine and expands to full page as expected - but can't use this option it seems in IE.

is there any trick to allowing RadEditor to open the print preview dialog in ie, and to preview just the contents of the radeditor, and also ensure that the togglefullscreen mode expands to cover the entire screen??

thanks.  M.
Ianko
Telerik team
 answered on 24 Mar 2015
3 answers
127 views
Hello,

Are there any known conflicts between Telerik Ajax Controls and AjaxToolKit 15.1? 
There are many things using Telerik.  Just wanted to check before I install the update.

Thanks
JS
Pavlina
Telerik team
 answered on 24 Mar 2015
1 answer
168 views
Hi,

I have a RadGrid which is initialzed to a SqlDataSource and itz working fine. Now, I want to make one of the data field from the sql source as a HyperText.

I am doing following in Code Behind.

GridHyperLinkColumn hyperlinkcolumn = GridHyperLinkColumn();
hyperlinkcolumn.DataField = "<MyColumnName_FromSql>"
hyperlinkcolumn.DataNavigateUrlFields = "<MyColumnName_FromSql>"
hyperlinkcolumn.DataNavigateUrlFormatString = "URL String"

MyGrid.Columns.Add(hyperlinkcolumn);

Whne I do this, I am seeing two columns. One original column from the sql data source and one hyperlink column i added.

I tried additing to MasterTableView as well. But still two columns are coming.

I expect only hypertext column to present and original column to not present.

How to achieve this??

THanks
Satish

Eyup
Telerik team
 answered on 24 Mar 2015
3 answers
272 views
Folks I am using VS 2010 SP1 and RadControls for ASP.NET AJAX Q1 2012. I would like the following steps if possible in Rad Grid:

1)  After Edit, highlight the last edited row in Grid.

2)  After Insert, without any user interaction (automatically)
   
      A) Retrieve the Primary Key value of newly inserted row, 
      B) Highlight (Select) newly inserted row in Grid
      C) Open the newly inserted row in Edit Mode to enter some additional data that are not required in initial insert.
      D) Show the Primary Key Value of newly inserted row in a Label in Edit Form.

3) After user Updates or Cancel in Step 2, do Step #1 (i.e. highlight the last edited row in Grid)

Is these above possible?

I am using below link as sample (RadGrid2).  and attached is my code.

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/commanditem/defaultcs.aspx


Thanks

GC_0620
-------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Grid.Examples.Programming.CommandItem.DefaultCS" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head runat="server">
    <!-- custom head section -->
    <style type="text/css">
        .bigModuleBottom td
        {
            padding: 0;
        }
    </style>
    <!-- end of custom head section -->
</head>
<body class="BODY">
    <form runat="server" id="mainForm" method="post">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <!-- content start -->
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function RowDblClick(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
                    <telerik:AjaxUpdatedControl ControlID="Label3" />
                    <telerik:AjaxUpdatedControl ControlID="Label4" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <asp:Label ID="Label1" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#FF8080"></asp:Label>
        <asp:Label ID="Label2" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#00C000"></asp:Label>
    </div>
    <br />
    <br />
    <br />
    <br />
    <div class="bigModule">
        <div class="bigModuleBottom">
            <%--<div class="title">
                    Default command-item outlook</div>--%>
        </div>
    </div>
    <br />
    <div>
        <asp:Label ID="Label3" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#FF8080"></asp:Label>
        <asp:Label ID="Label4" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#00C000"></asp:Label>
    </div>
    <br />
    <telerik:RadGrid ID="RadGrid2" DataSourceID="SqlDataSource2" AllowSorting="True"
        AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true"
        PageSize="7" AllowPaging="True" GridLines="None" runat="server" ShowFooter="True"
        OnItemCreated="RadGrid_ItemCreated" OnItemDeleted="RadGrid_ItemDeleted" OnItemUpdated="RadGrid_ItemUpdated"
        OnItemInserted="RadGrid_ItemInserted" Skin="Vista" OnItemCommand="RadGrid2_ItemCommand">
        <PagerStyle Mode="NextPrevAndNumeric" />
        <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataSourceID="SqlDataSource2"
            InsertItemPageIndexAction="ShowItemOnCurrentPage" DataKeyNames="CustomerID" AutoGenerateColumns="false"
            InsertItemDisplay="Top">
            <Columns>
                <telerik:GridEditCommandColumn>
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn DataField="CustomerID" UniqueName="CustomerID" HeaderText="Customer ID"
                    MaxLength="5">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CompanyName" UniqueName="CompanyName" HeaderText="Company Name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ContactName" UniqueName="ContactName" HeaderText="Contact Name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ContactTitle" UniqueName="ContactTitle" HeaderText="Contact Title">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Address" UniqueName="Address" HeaderText="Address">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="City" UniqueName="City" HeaderText="City">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                </telerik:GridButtonColumn>
            </Columns>
            <CommandItemSettings AddNewRecordText="Add new record" AddNewRecordImageUrl="Images/AddRecord.gif"
                RefreshText="Refresh" RefreshImageUrl="Images/Refresh.gif" />
        </MasterTableView>
        <ClientSettings>
            <ClientEvents OnRowDblClick="RowDblClick" />
        </ClientSettings>
    </telerik:RadGrid>
    <br />
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString35 %>"
        DeleteCommand="DELETE FROM [Customers] WHERE [CustomerID] = @CustomerID" InsertCommand="INSERT INTO [Customers] ([CustomerID], [CompanyName], [ContactName], [ContactTitle], [Address], [City]) VALUES (@CustomerID, @CompanyName, @ContactName, @ContactTitle, @Address, @City)"
        SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [ContactTitle], [Address], [City] FROM [Customers]"
        UpdateCommand="UPDATE [Customers] SET [CompanyName] = @CompanyName, [ContactName] = @ContactName, [ContactTitle] = @ContactTitle, [Address] = @Address, [City] = @City WHERE [CustomerID] = @CustomerID">
        <DeleteParameters>
            <asp:Parameter Name="CustomerID" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="CustomerID" Type="String" />
            <asp:Parameter Name="CompanyName" Type="String" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="ContactTitle" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="City" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="CompanyName" Type="String" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="ContactTitle" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="CustomerID" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <!-- content end -->
    <p>
         </p>
    </form>
</body>
</html>

_____________

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
 
namespace Grid.Examples.Programming.CommandItem
{
    public partial class DefaultCS : System.Web.UI.Page
    {
        
        
        protected void RadGrid_ItemCreated(object sender, GridItemEventArgs e)
        {
           
            GridEditableItem item = e.Item as GridEditableItem;
            if (item != null && e.Item.IsInEditMode && e.Item.ItemIndex != -1)
            {
                (item.EditManager.GetColumnEditor("CustomerID").ContainerControl.Controls[0] as TextBox).Enabled = false;
            }
        }
 
        protected void RadGrid_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
        {
            if (e.Exception != null)
            {
                e.KeepInEditMode = true;
                e.ExceptionHandled = true;
                DisplayMessage(true, "Customer " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["CustomerID"] + " cannot be updated due to invalid data.");
            }
            else
            {
                DisplayMessage(false, "Customer " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["CustomerID"] + " updated");
            }
        }
 
        protected void RadGrid_ItemInserted(object source, GridInsertedEventArgs e)
        {
            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                e.KeepInInsertMode = true;
                DisplayMessage(true, "Customer cannot be inserted due to invalid data.");
            }
            else
            {
                DisplayMessage(false, "Customer inserted");
            }
            e.Item.Edit = true;
        }
 
        protected void RadGrid_ItemDeleted(object source, GridDeletedEventArgs e)
        {
            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                DisplayMessage(true, "Customer " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["CustomerID"] + " cannot be deleted");
            }
            else
            {
                DisplayMessage(false, "Customer " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["CustomerID"] + " deleted");
            }
        }
 
        private void DisplayMessage(bool isError, string text)
        {
            if (isError)
            {
                this.Label1.Text = text;
                this.Label3.Text = text;
            }
            else
            {
                this.Label2.Text = text;
                this.Label4.Text = text;
            }
        }
 
 
        protected void RadGrid2_ItemCommand(object sender, GridCommandEventArgs e)
        {
            
        }
}
}




Eyup
Telerik team
 answered on 24 Mar 2015
3 answers
56 views
RadSocialShare generates a js error on page load, in IE 11.  The Error does not occur in Chrome:
Line: 6
Error: Unable to set property 'control' of undefined or null reference

VS2013  .Net 4.5
Windows 8.1
RadControls for ASP.Net Q3 2013   version 2012.3.1308.45



<telerik:RadSocialShare runat="server" ID="RadSocialShare1" UrlToShare="http://www.telerik.com/products/aspnet-ajax.aspx"
         TitleToShare="ASP.NET AJAX Controls, .NET Web UI Components | Telerik">
         <MainButtons>
             <telerik:RadSocialButton SocialNetType="ShareOnTwitter" />
             <telerik:RadSocialButton SocialNetType="Blogger" />
             <telerik:RadSocialButton SocialNetType="ShareOnFacebook" />
             <telerik:RadCompactButton />
         </MainButtons>
     </telerik:RadSocialShare>

Danail Vasilev
Telerik team
 answered on 24 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?