Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
1.4K+ views
Greetings,

Here is a good example of how to use an Excel spreadsheet as the data source for a RadGrid...

http://www.telerik.com/forums/rad-grid-import-from-excel

Is there a way to modify this example to use a spreadsheet data source that was uploaded with RadAsyncUpload without saving the xlsx to the server first - like a file stream or something?  Any advice or examples would be appreciated.

Thanks!

Matt
Kallie
Top achievements
Rank 1
 answered on 23 Apr 2017
2 answers
176 views
I have a pre-existing set of styles in use for an application I'm building and the RadMaskedTextbox creates a <div /> wrapper around the control, with 
RadInput RadInput_Default

in the class declaration for the div. Is it possible to remove these? They override some of my default styling, so I'd rather they just don't get attached upon render at all if possible. This is for version 2017.1.228.45.

Thanks!

Scott
Top achievements
Rank 1
 answered on 22 Apr 2017
0 answers
101 views

Hi

Is it possible to change the maxjsonlength used by the jsonserializer in radimagegallery?? 

I sometimes need to load images temporarily by passing base64 string instead of url, but I get maxjsonlength error. 

I have tried in web.config but that doesn't help. 

Thank you for your help 

Thami

Thami
Top achievements
Rank 1
 asked on 21 Apr 2017
0 answers
109 views

Hi 

How to allow user to copy and paste links into rad editor....

What's happening now

1. When a user copy and paste (Ctrl+V) a link it is displaying as rich text 

 

What needs to happen

1. Allow user to user copy and paste (Ctrl+V) a link into rad editor and keep the link active.

 

Help on how to acheive this. 

 

thanks in advance

 

 

 

diane
Top achievements
Rank 1
Veteran
 asked on 21 Apr 2017
1 answer
165 views

Grid Column value changed to 0 when exporting Grid to Excel. Please see the following demo code, the value of "Freight" column changed to 0 when clicking the Export button, but as soon as I change the DataFormatString="{0}%" to DataFormatString="{0}", everything works fine when exporting. But I do need to display the number as percentage (no decimals) in my senario. Any help would be much appreciated!

RadGridExport.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadGridExport.aspx.cs" Inherits="RadGridExport" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
 
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0" ShowFooter="True"
            GridLines="None" Width="800px" OnNeedDataSource="RadGrid1_NeedDataSource"
            OnItemCommand="RadGrid1_ItemCommand" ExportSettings-Excel-DefaultCellAlignment="Center">
            <ExportSettings ExportOnlyData="true"></ExportSettings>
            <MasterTableView AutoGenerateColumns="False" DataKeyNames="OrderID" CommandItemDisplay="Top">
                <CommandItemSettings ShowExportToExcelButton="true" />
                <Columns>
                    <telerik:GridBoundColumn DataField="OrderID" DataType="System.Int32"
                        FilterControlAltText="Filter OrderID column" HeaderText="OrderID"
                        ReadOnly="True" SortExpression="OrderID" UniqueName="OrderID">
                    </telerik:GridBoundColumn>
                    <telerik:GridDateTimeColumn DataField="OrderDate" DataType="System.DateTime"
                        FilterControlAltText="Filter OrderDate column" HeaderText="OrderDate"
                        SortExpression="OrderDate" UniqueName="OrderDate">
                    </telerik:GridDateTimeColumn>
                    <telerik:GridNumericColumn DataField="Freight" DataType="System.Int32"
                        FilterControlAltText="Filter Freight column" DataFormatString="{0}%" HeaderText="Freight" Aggregate="Avg"
                        SortExpression="Freight" UniqueName="Freight">
                    </telerik:GridNumericColumn>
                    <telerik:GridBoundColumn DataField="ShipName"
                        FilterControlAltText="Filter ShipName column" HeaderText="ShipName"
                        SortExpression="ShipName" UniqueName="ShipName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ShipCountry"
                        FilterControlAltText="Filter ShipCountry column" HeaderText="ShipCountry"
                        SortExpression="ShipCountry" UniqueName="ShipCountry">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </form>
</body>
</html>

 

RadGridExport.aspx.cs

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
public partial class RadGridExport : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = GetGridSource();
    }
    private DataTable GetGridSource()
    {
        DataTable dataTable = new DataTable();
 
        DataColumn column = new DataColumn();
        column.DataType = Type.GetType("System.Int32");
        column.ColumnName = "OrderID";
        dataTable.Columns.Add(column);
 
        column = new DataColumn();
        column.DataType = Type.GetType("System.DateTime");
        column.ColumnName = "OrderDate";
        dataTable.Columns.Add(column);
 
        column = new DataColumn();
        column.DataType = Type.GetType("System.Int32");
        column.ColumnName = "Freight";
        dataTable.Columns.Add(column);
 
        column = new DataColumn();
        column.DataType = Type.GetType("System.String");
        column.ColumnName = "ShipName";
        dataTable.Columns.Add(column);
 
        column = new DataColumn();
        column.DataType = Type.GetType("System.String");
        column.ColumnName = "ShipCountry";
        dataTable.Columns.Add(column);
 
        DataColumn[] PrimaryKeyColumns = new DataColumn[1];
        PrimaryKeyColumns[0] = dataTable.Columns["OrderID"];
        dataTable.PrimaryKey = PrimaryKeyColumns;
 
        for (int i = 0; i <= 80; i++)
        {
            DataRow row = dataTable.NewRow();
            row["OrderID"] = i + 1;
            row["OrderDate"] = DateTime.Now;
            row["Freight"] = i + 1;
            row["ShipName"] = "Name " + (i + 1);
            row["ShipCountry"] = "Country " + (i + 1);
 
            dataTable.Rows.Add(row);
        }
 
        return dataTable;
    }
    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        RadGrid1.ExportSettings.FileName = "Success - " + DateTime.Now.ToLongTimeString();
    }
}
Meng
Top achievements
Rank 1
 answered on 21 Apr 2017
0 answers
273 views

Hi, 

I have couple of textboxes being generated from a javascript function which passes the data to the kendo.template and the textboxes are generated dependng upon the data passed through the JS function. The textboxes have multiple page events such as onfiocus() and onblur(). These page events are getting fired mutiple times. I tried keeping a counter so that these executes only once, passed static data such as 0 and 1 for forcing them to execute once only and many other stuffs. None of them has worked, Is there any chance, this can be a bug in Kendo Grid or Kendo Template, because other kendo tools are not doing this. Please advise, how to proceed from here.

 

In the attached image the 7 TextBoxes has the above bug

 

 

 

Thanks in advance

Mohammed
Top achievements
Rank 1
 asked on 21 Apr 2017
0 answers
149 views

Hi,

Could someone please let me know how to implement on click functionality of hyperlink which is inside a radgrid. Radgrid has been binded with datatable dynamically. Radgrid autogeneratecolumns has been given as true.

on click of hyperlink a command prompt should open and run the command as requested.

Asp.Net:

<telerik:RadGrid ID="radgrid1" runat="server" AutoGenerateColumns="true"
                        Width="100%" GridLines="None" CellPadding="0" AllowPaging="True" AllowSorting="True" OnItemDataBound="radgrid1_ItemDataBound"                      
                        PageSize="200" >
                        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>                                                 
                    </telerik:RadGrid>

C#:

protected void radgrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            cmdArgument = item["command"].Text;
            HyperLink link = new HyperLink();
            link.Text = item["command"].Text;
            item["accurev_command"].Controls.Add(link);

}

}

Sweatha
Top achievements
Rank 1
 asked on 21 Apr 2017
0 answers
100 views

I have several comboboxes with checkboxes. I am setting their checked states from server side. The problem is I also want to append a comma at the end. How do I do that? What I've tried:

 

private void RestoreCheckboxCombobox(RadComboBox combobox, List<int> selectedIds)
{
    List<RadComboBoxItem> selectedItems = new List<RadComboBoxItem>(combobox.Items.Count);
    StringBuilder sb = new StringBuilder(100);
    foreach (RadComboBoxItem itm in combobox.Items)
    {
        if (selectedIds.Contains(int.Parse(itm.Value)))
        {
            selectedItems.Add(itm);
            itm.Checked = true;
            sb.AppendFormat("{0}, ", itm.Text.Trim());
        }
    }
    if (sb.Length > 0)
        combobox.Text = sb.ToString();
}
Csaba Gyozo
Top achievements
Rank 1
 asked on 21 Apr 2017
14 answers
340 views
Hi

I am having a master page-content page set up in my web application. One of the content page includes a RadGrid and a RadComboBox with MetroTouch skin. The RadGrid is ajaxified using the RadAjaxManagerProxy and the issue is, the RadComboBox is losing its default styling when the RadGrid initiates an Ajax Request.

This issue happens with the Metro, MetroTouch, & Silk skin and works fine with the Default, Web20 etc. Skins. You can view the unusual behavior here.

Here is the sample which illustrate the above mentioned issue.

Masterpage :
<form id="form1" runat="server">
<asp:ScriptManager ID="masterScriptManager" runat="server">
</asp:ScriptManager>
<telerik:RadAjaxManager ID="MasterAjaxManager" runat="server" DefaultLoadingPanelID="MasterLoadingPanel" />
<telerik:RadAjaxLoadingPanel ID="MasterLoadingPanel" runat="server" Skin="Web20" MinDisplayTime="1500" />
<div>
    <h1>
        Master Page Content</h1>
    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
    </asp:ContentPlaceHolder>
</div>
</form>

Content-page:
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadAjaxManagerProxy ID="ajaxManagerProxy" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <h2>
        Content Page</h2>
    <div style="padding: 5%;">
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" AllowPaging="true"
            PageSize="4" Width="100%" OnNeedDataSource="RadGrid1_NeedDataSource" AllowMultiRowSelection="true"
            Skin="Office2007">
            <MasterTableView DataKeyNames="Brand">
                <Columns>
                    <telerik:GridClientSelectColumn>
                    </telerik:GridClientSelectColumn>
                    <telerik:GridBoundColumn UniqueName="Brand" DataField="Brand" HeaderText="Brand">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="Model" DataField="Model" HeaderText="Model">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings Selecting-AllowRowSelect="true" EnableRowHoverStyle="true">
            </ClientSettings>
        </telerik:RadGrid>
        <br />
        <br />
        <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="100%" EmptyMessage="Select"
            Height="120px" Skin="MetroTouch">
            <Items>
                <telerik:RadComboBoxItem runat="server" Text="Item 1" />
                <telerik:RadComboBoxItem runat="server" Text="Item 2" />
                <telerik:RadComboBoxItem runat="server" Text="Item 3" />
            </Items>
        </telerik:RadComboBox>
    </div>
</asp:Content>

Since the RadGrid is ajaxified, how its affecting the RadComboBox? Is this a bug?

Thanks,
Vishnu.
Vessy
Telerik team
 answered on 21 Apr 2017
0 answers
102 views
As the title says, CheckedItems is empty. I have no idea what's wrong. As a workaround I am using Request.Form["<client id of the control"] (because they are there in the json). Any ideas?
Csaba Gyozo
Top achievements
Rank 1
 asked on 21 Apr 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?