Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
202 views
I would like to restrict the number of a files that can be uploaded at a time to 5.

I reviewed this posting and applied this code:
http://www.telerik.com/forums/limit-number-of-files-to-be-uploaded

rfeExplorer.Upload.MaxFileInputsCount = 5

But the upload modal allows an unlimited number of files to be selected.

Peter
Vessy
Telerik team
 answered on 03 Apr 2014
1 answer
122 views
Currently we would like to use the RadTileList in a Master/Detail situation. This means that dependent upon the selected tile in the master-tilelist, the detail-tilelist is rendered.

This application scenario works rather well, but fails in the following situation:
1. Open page
-- Ensure nothing is selected and only master items are visible.

2. Click/select a master item, e..g A
-- Ensure that after postback "A" is selected and no detail item is selected.

3. Click/select a detail item, e.g. 2
-- Ensure that after postback "2" is selected

4. Click/select another master item, e.g. B
-- Ensure that after postback "B" is selected and no detail item is selected.

5. Click/select a detail item, e.g. "4"
-- Ensure that after postback "4" is selected <-- BUG, event of TileClick/Selectionchange is not firing and thus is the selection not persisted.

To reproduce this, I've created a new Telerik Web Application (which I cannot currently attach?).

This new web application contains the following implementation of Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</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>
    <div>
        <telerik:RadTileList runat="server" ID="tlMaster" AutoPostBack="true" DataSourceID="ldsMaster" SelectionMode="Single" OnTileClick="tlMaster_TileClick" OnSelectionChanged="tlMaster_SelectionChanged">
            <DataBindings>
                <CommonTileBinding TileType="RadContentTemplateTile" Shape="Square" DataNameField="Name" />
                <ContentTemplateTileBinding>
                    <ContentTemplate>
                        <%#DataBinder.Eval(Container.DataItem, "Description")%>
                    </ContentTemplate>
                </ContentTemplateTileBinding>
            </DataBindings>
        </telerik:RadTileList>
        <asp:LinqDataSource runat="server" ID="ldsMaster" OnSelecting="ldsMaster_Selecting"></asp:LinqDataSource>
    </div>
    <div>
        <telerik:RadTileList runat="server" ID="tlDetail" AutoPostBack="true" DataSourceID="ldsDetail" SelectionMode="Single" OnTileClick="tlDetail_TileClick">
            <DataBindings>
                <CommonTileBinding TileType="RadContentTemplateTile" Shape="Square" DataNameField="Name" />
                <ContentTemplateTileBinding>
                    <ContentTemplate>
                        <%#DataBinder.Eval(Container.DataItem, "Description")%>
                    </ContentTemplate>
                </ContentTemplateTileBinding>
            </DataBindings>
        </telerik:RadTileList>
        <asp:LinqDataSource runat="server" ID="ldsDetail" OnSelecting="ldsDetail_Selecting"></asp:LinqDataSource>
    </div>
    </form>
</body>
</html>

And the following implementation of Default.aspx.cs:
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
using System.Collections.Generic;
using System.Linq;
 
public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        /* Test case to reproduce issue:
         * 1. Open default.aspx
         * 2. Click/select a master item, e.g. "A"
         * 3. Click/select a detail item, e.g. "2"
         * 4. Click/select another master item, e.g. "B"
         * -- Currently no detail item is selected. That's good.
         * 5. Click/select a detail item, e.g. "4"
         * BUG: Click/Select event is not fired and thus is the selection not persisted.
         */
 
        if (!Page.IsPostBack)
        {
            this.tlMaster.DataBind();
        }
    }
 
    protected void tlMaster_TileClick(object sender, TileListEventArgs e)
    {
        foreach (var tile in this.tlMaster.GetSelectedTiles())
        {
            tile.Selected = false;
        }
 
        e.Tile.Selected = true;
        this.tlDetail.DataBind();
    }
 
    protected void tlMaster_SelectionChanged(object sender, TileListDataEventArgs e)
    {
        this.tlDetail.DataBind();
    }
 
    protected void ldsMaster_Selecting(object sender, LinqDataSourceSelectEventArgs e)
    {
        e.Result = new List<MasterData>
        {
            new MasterData("A", "A"),
            new MasterData("B", "B"),
            new MasterData("C", "C")
        };
    }
 
    protected void tlDetail_TileClick(object sender, TileListEventArgs e)
    {
        foreach (var tile in this.tlDetail.GetSelectedTiles())
        {
            tile.Selected = false;
        }
 
        e.Tile.Selected = true;
    }
 
    protected void ldsDetail_Selecting(object sender, LinqDataSourceSelectEventArgs e)
    {
        var selectedTiles = this.tlMaster.GetSelectedTiles();
        if (selectedTiles.Any())
        {
            var data = new List<DetailData>
            {
                new DetailData("A", "1", "1"),
                new DetailData("A", "2", "2"),
                new DetailData("A", "3", "3"),
                new DetailData("A", "4", "4"),
                new DetailData("A", "5", "5"),
                new DetailData("B", "1", "1"),
                new DetailData("B", "2", "2"),
                new DetailData("B", "3", "3"),
                new DetailData("B", "4", "4"),
                new DetailData("B", "5", "5"),
                new DetailData("C", "1", "1"),
                new DetailData("C", "2", "2"),
                new DetailData("C", "3", "3"),
                new DetailData("C", "4", "4"),
                new DetailData("C", "5", "5")
            };
 
            var selectedTile = selectedTiles.Single();
 
            e.Result = data
                .Where(dd => dd.Master == selectedTile.Name);
        }
        else
        {
            e.Result = Enumerable.Empty<DetailData>();
        }
    }
 
    private class MasterData
    {
        public string Name { get; private set; }
        public string Description { get; private set; }
 
        private MasterData() { }
        public MasterData(string name, string description)
        {
            this.Name = name;
            this.Description = description;
        }
    }
 
    private class DetailData
    {
        public string Master { get; private set; }
        public string Name { get; private set; }
        public string Description { get; private set; }
 
        private DetailData() { }
        public DetailData(string masterName, string name, string description)
        {
            this.Master = masterName;
            this.Name = name;
            this.Description = description;
        }
    }
}

I hope you are able to identify why the event is not triggered. One thing that I already noted is that the control id differs before and after the postback (view attached files ctrl_id_before_postback and ctrl_id_after_postback): This might have to do something with the issue.

Stanimir
Telerik team
 answered on 03 Apr 2014
3 answers
174 views
Hi,

I have a RadGrid with two bound columns and a RadComboBox in EditItemTemplate of the Template Column.The Grid is in batch edit mode. When i press Add New Record and select an item in RadComboBox , the bound column(textboxes) should get populated with the selected value in RadComboBox.

Thanks.
Kostadin
Telerik team
 answered on 03 Apr 2014
1 answer
112 views
Hi,

I'm trying to implement grid filtering where my Data Sources is webapi.

I tried to follow the following: Take a Walk on the Client Side with WebAPI and WebForms – Part 2

The grid is working fine but I'm I having an issue when I'm trying to implement filtering, there is no GetNextPage() in the request in my ApiController

My project is an ASP.NET web forms project, .net 4.5

Here is my ApiController code:

[HttpGet]
public PageResult<SecuHostUser> Load_Users(ODataQueryOptions<SecuHostUser> options)
{
     
    var context = new ApplicationDbContext();
    var users= context.Users.AsQueryable();
    var results = options.ApplyTo(users);
    return new PageResult<SecuHostUser>(results as IEnumerable<SecuHostUser>, Request.GetNextPageLink(), users.ToList().Count);
 
 
}


Vasil
Telerik team
 answered on 03 Apr 2014
4 answers
248 views
Hi,

I was trying to use the client side script for image gallery set to work as light, I have couple of queries.

1. I have added a client script for OnImageLoaded, the script is not getting executed when the light box load the image on user click on the thumbnail. 

<telerik:RadImageGallery ID="RadImageGallery1" runat="server" AllowPaging="true"
DisplayAreaMode="LightBox" ImagesFolderPath="~\Images"
Skin="Glow" >
<ClientSettings>
<ClientEvents
OnImageLoaded="imageLoaded"  />
</ClientSettings>
</telerik:RadImageGallery>

function imageLoaded(sender, args) {
alert("ImageLoaded");
// var imageItem = args.get_item(); }

2. Can we add controls to the light box inside the image gallery similar to the AsyncUpload and get the value in the back end using GetFieldValue.

Thank you.

Regards,
Majid
Radoslav
Telerik team
 answered on 03 Apr 2014
1 answer
61 views
I am new in telerik world.
I have used client script to open rad window on clientclicked of radbutton inside grid.
The grid comes under one panel.
I have also use RadAjaxManager to refresh panel.
So when it get refresh Rad Window closes autometically which opend by clientclick of button.
Shinu
Top achievements
Rank 2
 answered on 03 Apr 2014
1 answer
252 views
Hi

I am using IE 11 and the controls' version is 2013.2.717.35. My project is on C# and I use Visual Studio 2010.

I have a Pivot Grid control with PivotGridReportFilterField fields. How do I access on the server code, for example on the item command event, the filter values the user might have selected for each PivotGridReportFilterField fields? I need this information for a particular case on my application to filter another query.

Please provide me a sample code.

Note: I found this link - http://www.telerik.com/help/aspnet-ajax/grid-gridtableview-get-filterexpressions.html

It seems to be what I need for the case of a grid but I could not apply the suggestions to my pivot grid.

Thanks in advance,

Jose
Vasil
Telerik team
 answered on 03 Apr 2014
1 answer
77 views
Hi,
I am populating 1st Level of Data Successfully. 
But How can i Child Nodes when user Clicks on Expand(+) node?
Shinu
Top achievements
Rank 2
 answered on 03 Apr 2014
23 answers
929 views
Hi All ,

     i am using the RadEditor on a web page & i wan insert the text in rad editor at cursor position through the code behind file.
plz give me solution for this.

Regards,
Satish

Ianko
Telerik team
 answered on 03 Apr 2014
4 answers
482 views
I have a radgrid that displays some (normal) tooltips for headers and cell content.Take for example the header tooltip for this column:
<telerik:GridBoundColumn  HeaderText="<%$ Resources:IFW_Global, FamilyName  %>" HeaderTooltip="<%$ Resources:IFW_Global, FamilyNameTtip  %>" UniqueName="column"  AllowFiltering="False" DataField="LastName"
</telerik:GridBoundColumn>

And a data cell tooltip, set in code behind:
Dim item As GridDataItem = CType(e.Item, GridDataItem)
item(
"DocumentTypeCode").ToolTip = "customdoctooltip"

The tooltips stays visible for only about 5 seconds on mouseover and then it dissapears. I want all the tooltips to remain visible onmouseover without dissapearing. How would I do this? I'm looking for a simple solution.
Bob
Top achievements
Rank 1
 answered on 03 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
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?