Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
130 views
does the RadComboBox support a view of 5 rows but have single select and option grouping?
or does any other control do that?
Veselin Tsvetanov
Telerik team
 answered on 17 Mar 2016
11 answers
453 views
Hi,

I have been working with the RAD AJAX tools for a while and I have noticed on some pages that controls change in appearance  when the page does an AJAX postback.  It is usually an unlrelated part of the page from that which is posting back.

If I had to take a stab at what is happening, I would guess that the AJAX postback was causing other Rad Controls to loose their styling.

Can anyone point me in the right direction here?
Pavlina
Telerik team
 answered on 17 Mar 2016
3 answers
119 views
Hello

I have radtabstrip that loads usercontrols in dynamic radpageviews. Each user control has different validation groups. On  validation failure i need to indicate user to go ahead and fix validation errors on other tab in wizard.
For e.g. if user goes from tab A to tab C and save it i need to display validation error on tab B. For that i need to either add Red Exclamation Mark or change the font of tab to red or tab the entire tab color to red.

Any idea how do i do that? I am using custom skins.

Regards
Mac
Veselin Tsvetanov
Telerik team
 answered on 17 Mar 2016
1 answer
257 views
1. SelectedIndex property not available in raddropdowntree
2. Can not loop on all items in raddropdowntree
3. Not able to set node as selected by selectedindex
4. Is any alternative solutions for above problems
Nencho
Telerik team
 answered on 17 Mar 2016
2 answers
225 views

Hello,

I have a RadComboBox with an associated required field validator. On Internet Explorer 11 (maybe other versions) an X appears that allows the user to clear the Combo. Please see the attached image if you don't know what I mean.

If the user clears the selection with the X and then clicks elsewhere (on another control for example) then the required field validator for the RadComboBox will activate. I only want this validator (and the other validators) to fire when the page is posted back.

There are a couple of the approaches that I have investigated but couldn't make get to work 100% correctly for various reasons are

1. Disable the validator temporarily with Javascript and re-enable later on. As per this thread Radcombobox clearSelection causes validation.
2. Use a custom validator.

The second one isn't really an option because the RadComboBox is used in an .ascx file that is re-used in a lot of places. Also, some attributes that are specific to a RequiredFieldValidator are required.

So, I am asking if there is a simple low impact way of preventing the validator from firing in this scenario?

Thanks in advance,
John.

Veselin Tsvetanov
Telerik team
 answered on 17 Mar 2016
2 answers
112 views

I'm getting some weird go-slows with the following script.

Most of the time, the filtering works in about 50ms. Other times, it takes upwards of 8000ms. When this happens firefox pops up them message that the script is taking too long to execute (continue stop etc).

I've put some timers in to try and find out where it's chugging, and it is on this line

var item = listItems.getItem(count);

as to why... well that's the million dollar question

the mark up is contained as follows

Master page > Page > RadPageView > UserControl

(all declared at design time ~ no dynamically loaded controls)

The Code

-------------

    //
    // Escapes RegEx character classes and shorthand characters
    //
    escapeRegExCharacters: function (text)
    {
        return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
    },

    //
    // filter items in a Rad List box
    //
    filterListBox: function (pSearchBoxClientID, pUsersClientID)
    {
        var textBox = $('#'+pSearchBoxClientID);
        var listBox = $find(pUsersClientID);

        if (textBox != null && listBox != null)
        {
            var filterText = Core.escapeRegExCharacters(textBox.val());
            var expression = new RegExp(filterText, "i");
            var listItems = listBox.get_items();

            for (var count = 0; count < listItems.get_count(); count++)
            {
                var item = listItems.getItem(count);              
                item.set_visible(filterText == "" || item.get_text().match(expression));
            }
        }
    }

    <asp:TextBox id="txtSearchLinked" runat="server" CssClass="TextInput" Width="100%" />

            <telerik:RadListBox
                runat="server"
                ID="lstAccessInRole"
                SelectionMode="Multiple"
                Height="450px"
                width="600px"
                AllowTransfer="true"
                TransferToID="lstAccessNotInRole"                
                AutoPostBack="false"
                AutoPostBackOnTransfer="false"
                >                
                <ButtonSettings TransferButtons="TransferFrom,TransferTo" />                
            </telerik:RadListBox>   

 

        /// <summary>
        /// Sets the JQuery event on the search text box
        /// </summary>
        private void SetupFilterEvent()
        {
            txtSearchLinked.Attributes.Add("onkeyup", "javascript:Core.filterListBox('" + txtSearchLinked.ClientID + "', '" + lstAccessInRole.ClientID + "');");
        }

 

 

 

Hristo Valyavicharski
Telerik team
 answered on 17 Mar 2016
1 answer
192 views
looking at the demos but I cannot figure out how to manually add items to RadListView and also groupings.
so I think I create a group and add a few items to it and then add to listview.
is there some same API code?
Konstantin Dikov
Telerik team
 answered on 17 Mar 2016
7 answers
783 views
Hello,
I'm trying to add a databound pie chart to a page and have a few questions/problems (please let me know if you need me to create separate threads for each question).
All questions reference code or attachment below.

1. is there a quick/easy way to set the item with the highest value to exploded? Or do I have to iterate through the datatable?
2. alternatively to (1) I tried to manually set one of the items to exploded (see code), but that's giving me "index out of range" errors. When checking the contents of the "kpi" object in VS, the pieSeriesItems collection is empty - ???
3. How can I "omit" a specific color? The tooltips for the black color are black text on black background and are unreadable.
4. The pie chart for some reason doesn't have the "3D" effect as some of the samples do. Is the effect dependent on a certain size?
5. The chart has a lot of unnecessary white space. (see attached image) I'm only setting the width of the HTMLChart - if I set the height, the chart becomes smaller (i.e. the relative white space remains the same). Is there a way around this?
6. Suggestion: the HTMLChart control doesn't honor the RadFormDecorator settings (like RoundedCorners). It would be nice if it did that. In addition, a drop-shadow functionality would be nice to have too (IIRC, the MS Ajax Chart controls had that too).

Thx in advance for help and/or pointers !
Rgds - Marcus.

01.KPIMetricsChart.DataSource = ds.Tables[7];
02.KPIMetricsChart.DataBind();
03.PieSeries kpi = new PieSeries();
04.kpi.DataFieldY = "Cnt";
05.kpi.LabelsAppearance.Visible = false;
06.kpi.SeriesItems[4].Exploded = true;   // <- DOES NOT WORK
07.kpi.TooltipsAppearance.ClientTemplate = "#=dataItem.Action#<br />#=dataItem.Cnt# Items, #= kendo.format(\\'{0:P}\\',percentage) #";
08.KPIMetricsChart.ChartTitle.Text = "Global Metrics";
09.KPIMetricsChart.PlotArea.Series.Add(kpi);


Danail Vasilev
Telerik team
 answered on 17 Mar 2016
0 answers
91 views

Hi,

I'm having issues with RadLive capturing the value returned by my web service. I believe the web service is returning an xml while RadLiveTile is expecting a jason format. Can you please help me here?

WebService business logic:

[DataContract]
   public class GarageMap
   {
       [DataMember]
       public int OccupiedSpaces{set;get;}
       public GarageMap() { }
       public GarageMap(int propertyid)
       {
           loadMap(propertyid);
       }
       private void loadMap(int property_id)
       {
           DBTransaction Transaction = new DBTransaction();
           DBTransactionParameter param = new DBTransactionParameter();
           param.Type = SqlDbType.VarChar;
           param.Name = "@PropertyID";
           param.Value = "3";
           List<DBTransactionParameter> plist = new List<DBTransactionParameter>();
           plist.Add(param);
           DataTable DT = Transaction.Select("sp_GetAllOccupiedSpacesCount", true, plist);
           DataRow dr = DT.Rows[0];
           OccupiedSpaces= Convert.ToInt32( dr["AllOccupiedSpaceCount"].ToString());      
       }
   }

WebMethod:

[WebMethod]    
       [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet=false)]
       //[ScriptMethod(UseHttpGet = true)]
       public GarageMap OccupiedSpaceCount()
       {
           //string j = "{'test': 1}";
           ////return j;
           return new GarageMap(3);  
 
       }

ASPX Page:

<div class="tilesWrapper">
            <telerik:RadLiveTile ID="DellTile" NavigateUrl="http://finance.yahoo.com/q?s=FB&d=t" runat="server" UpdateInterval="3000" Value="FB">
                <Title ImageUrl=""></Title>                 
            </telerik:RadLiveTile>
            <telerik:RadLiveTile ID="GoogleTile" NavigateUrl="http://finance.yahoo.com/q?s=GOOG&d=t" runat="server" UpdateInterval="4000" Value="GOOG">
                <Title ImageUrl="../../images/LiveTiles/logo_Google.png"></Title>
            </telerik:RadLiveTile>
            <telerik:RadLiveTile ID="YahooTile" NavigateUrl="http://finance.yahoo.com/q?s=YHOO&d=t" runat="server" UpdateInterval="5000" Value="YHOO">
                <Title ImageUrl="../../images/LiveTiles/logo_Yahoo.png"></Title>
            </telerik:RadLiveTile>
            <telerik:RadLiveTile ID="MicrosoftTile" NavigateUrl="http://finance.yahoo.com/q?s=MSFT&d=t" runat="server" UpdateInterval="6000" Value="MSFT">
                <Title ImageUrl="../../images/LiveTiles/logo_Microsoft.png"></Title>
            </telerik:RadLiveTile>
        </div>

 Code Behind:

protected void Page_Load(object sender, EventArgs e)
       {
           InitializeTile(DellTile);
           //InitializeTile(GoogleTile);
           //InitializeTile(YahooTile);
           //InitializeTile(MicrosoftTile);
       }
       private void InitializeTile(RadLiveTile tile)
       {
           tile.CssClass = "liveTile";
           tile.Target = "_blank";
 
           //The text between the #= # characters is replaced by the corresponding properties of the data item
           //returned on the web service response.
           tile.ClientTemplate = @"
               <div class=""tileClientTemplate"">
                   <div><strong>change:</strong> <img src=""../Assets/Icons/arrow_down.png"" alt="""" /> #= OccupiedSpaces #</div>
                   <div><strong>stock quote:</strong> #= OccupiedSpaces #</div>
                   <div><strong>updated:</strong> #=  OccupiedSpaces #</div>
               </div>
           ";
 
           //Configure the web service providing the live data.
           tile.WebServiceSettings.Path = "http://ws.smartparkllc.com/Dashboard.asmx";
           tile.WebServiceSettings.Method = "OccupiedSpaceCount";
 
           //Attach client side event handlers.
           tile.OnClientDataLoaded = "tileDataLoaded";
           tile.OnClientDataLoadingError = "tileDataLoadingError";
           tile.OnClientTemplateDataBound = "tileClientTemplateDataBound";
       }

 

Java Script File:

<script type="text/javascript">
             //alert("boom");
             function tileDataLoadingError (sender, args) {
            args.set_cancelErrorAlert(true);                                       
        }
 
        //The dataLoaded client side event occurs after the data request returns the data successfully.
             function tileDataLoaded(sender, args) {
                 //
            var data = args.get_data();
            //format the received date property
            //data.LastUpdated = data.LastUpdated.format("yyyy.MM.dd HH:mm:ss");
        }
 
        //The templateDataBound client-side event occurs after the client template is data bound.
            function tileClientTemplateDataBound(sender, args) {
                alert("boom");
                if (args.get_dataItem().Change >= 0) {
                     
                    args.set_html(args.get_html().replace("Assets/Icons/arrow_down.png", "Assets/Icons/arrow_up.png"));
                }
            }
         </script>

 

Browser Webservice call output:

<?xml version="1.0" encoding="utf-8"?>
  <OccupiedSpaces>3</OccupiedSpaces>
</GarageMap>
 
 Browser Console Error:

 

Uncaught SyntaxError: Unexpected token <

 

Yves
Top achievements
Rank 1
 asked on 17 Mar 2016
1 answer
100 views

Hello,

I'm wondering what the best way would be to push content to a dock control when the underlying information has been changed. I was considering trying to hook it up with SignalR but I'm hoping there may be a simpler solution. 

Application Senerio: 

I have several zones that can contain one or more dock controls. It is basically a scheduling system and the docks display information about an event. I want to be able to update all devices that are viewing the application if someone makes a change to an event. The zones are static but I'm dynamically creating the dock controls and adding them to the zones. 

 

Any pointers or ideas of the best way to achieve this would be much appreciated. 

 

Thanks,
Brian

Vessy
Telerik team
 answered on 16 Mar 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?