Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
69 views
I have a RadImageGallery in Lightbox mode within a RadAjaxPanel. When I click on the thumbnail, the image area pops up properly but if I click the next arrow, the next image is briefly shown and then the image area disappears. I would prefer to keep the RadAjaxPanel as it is more reliable (in my opinion) than the RadAjaxManagerProxy and there aren't a lot of controls on the page.

Any help would be appreciated.
Maria Ilieva
Telerik team
 answered on 21 Apr 2014
3 answers
330 views
I've set the singleclick property of a RadButton as follows:

<telerik:RadButton runat="server" ID="btnSubmitRequest" Text="Submit" SingleClick="true"  SingleClickText="Submitting..." OnClick="btnSubmitRequest_Click" ValidationGroup="required" />

However, the button isn't getting disabled, and, upon viewing the page source, I noticed that the "onclick=disableButton" function isn't there at all. I've used SingleClick buttons in my code before in this exact same manner, and never had a problem before.
Chase
Top achievements
Rank 1
 answered on 21 Apr 2014
5 answers
910 views
Hi

I have a javascript function on a page which uses Google Geocoder to get lat/lng for a a given address(postcode)

After the lat/lng succeeds I want to call a Radjaxmanager request to do processing on server side.

ie. RadAjaxManager.ajaxRequest("DO SOMETHING!");

Calling the above code produces the following error
TypeError: access to strict mode caller function is censored
( IN Telerik.Web.UI.WebResource.axd )

Any help really appreciated :}

Full code below...

Regards

Martin

================================================================
function GetLatLng(address) {

    var geocoder = new google.maps.Geocoder();
    geocoder.geocode({ 'address': address + ", UK", region: "UK" }, function (results, status) {

        var latitude = 0;
        var longitude = 0;
        if (status == google.maps.GeocoderStatus.OK) {
            latitude = results[0].geometry.location.lat();
            longitude = results[0].geometry.location.lng();
        } else {
            // Postcode/Address NOT found!
        }

        alert("START REQUEST");

        RadAjaxManager.ajaxRequest("DO SOMETHING!");

        alert("END REQUEST");

    });

}
Martin
Top achievements
Rank 1
 answered on 21 Apr 2014
3 answers
122 views
Hello,

I'm trying to use the Editor in a DNN (DotNetNuke) module I am developing.

It displays ok, but I get an error message "web.config registration is missing" on clicking many of the toolbar options.

The editor control works with the standard HTML module that ships with DNN and uses the DNN web.config file.

Can someone please tell me how can I associate the DNN web.config file with the editor control in my module?

I'm using DNN version 7.* by the way.

Best Regards,

Steve

Misho
Telerik team
 answered on 21 Apr 2014
2 answers
146 views
Hi, I'm using my asp.net site with the radgrid with my android phone. The zoom is not working if i press the fingers into the ASPxGridView, but outside this control it's works. There is something to do for have this function works? I have to set some css properties? I also tried this: from my phone i go in your demo pages and i can zoom inside the ASPxGridView, so this is possible.

Thanks
Dobromir
Telerik team
 answered on 21 Apr 2014
5 answers
234 views
I have been doing some work with RadComboBoxes. I have two combo boxes that load up data. They are both identical except for in ID.
one being ddlCampaign and the other ddlCompany.

ddlCampaign has a line break before and after it. I don't want this behaviour
ddlCompany is inline with its title and a hyperlink that is after it. I want both boxes to exhibit this behaviour

The data loaded into these is what I believe is causing the problem, as one has longer items than the others. Both boxes have a width of 160px.
If I switch the ddlCampaign for ddlCompany, than the behaviour of the two ddls switches.

I don't really know why its doing this and I don't want to use a table layout to force a solution

Please help

Aaron
Hristo Valyavicharski
Telerik team
 answered on 21 Apr 2014
1 answer
178 views

The problem is that, we cannot use Find and Replace command in HTML mode of the Telerik ASP.NET AJAX editor.
Tested via IE11, Mozilla 31, FireFox 28, Chrome 34 at:
http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx

Results:

In Chrome the button is active, but it's not working.
http://screencast.com/t/wvU58rQg1y

In the Internet Explorer 10 the functionallity worked, but in the IE 11 it becomes not enabled:
http://screencast.com/t/Ut9BdJdPMAFg

The FireFox browser of 28 or 31 version shows the same results:
http://screencast.com/t/kkPFsppeW

* Is this a bug?
* Is there are a way to make it working in all of browsers?
* Is there are a way to make it working in some of browsers?

--- 
Thanks

Misho
Telerik team
 answered on 21 Apr 2014
2 answers
208 views
Hi everyone!

I have created a sharepoint webpart containing a radgrid with a little customized filterchecklist; here's my code.

.aspx page:

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Assembly Name="Telerik.Web.UI, Version=2014.1.403.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2014.1.403.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RadGridWebPartUserControl.ascx.cs" Inherits="CheckListFiltering.RadGridWebPart.RadGridWebPartUserControl" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
  <style type="text/css">
  .HoverClass
  
      background-color: aqua;
  }
  .ClickClass
  {
      background-color: yellow;
  }
  .RadFilterMenu_CheckList
  {
      height: 300px;
      width: 200px;
  }
  </style>
  <script type="text/javascript">
      Telerik.Web.UI.RadGrid.prototype._checkListItemsRequestedHandler = function () {
          var items = $find(this._filterCheckListClientID).get_items();
          var count = items.get_count();
          for (var i = 0; i < count; i++) {
              var value = items.getItem(i).get_value().toString();
              if (value != "0")
                  items.getItem(i).check();
              else
                  items.getItem(i).uncheck();
              items.getItem(i).set_value(items.getItem(i).get_text());
          }
      }
      function RowCreated(sender, eventArgs) {
          var dataItem = eventArgs.get_gridDataItem();
          for (var i = 0; i < dataItem.get_element().cells.length; i++) {
              dataItem._element.cells[i].onmouseover = function () {
                  this.className = "HoverClass";
              }
              dataItem.get_element().cells[i].onmouseout = function () {
                  var cssName = this.selected ? "ClickClass" : this.defaultStatus;
                  this.className = cssName;
                  return;
              }
              dataItem.get_element().cells[i].onclick = function (event) {
                  this.selected = this.selected == true ? false : true;
                  var cssName = this.selected ? "ClickClass" : this.defaultStatus;
                  this.className = cssName;
                  return;
              }
          }
      }
  </script>
  <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
  <telerik:RadGrid runat="server" ID="RadGrid1" AllowFilteringByColumn="true" FilterType="CheckList" EnableLinqExpressions="false"
                   OnNeedDataSource="RadGrid1_NeedDataSource" OnFilterCheckListItemsRequested="RadGrid1_NeedCheckListItems">
    <MasterTableView AutoGenerateColumns="false">
      <Columns />
    </MasterTableView>
    <ClientSettings>
      <ClientEvents OnRowCreated="RowCreated" />
    </ClientSettings>
  </telerik:RadGrid>

.aspx.cs:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Telerik.Web.UI;
 
namespace CheckListFiltering.RadGridWebPart
{
    public partial class RadGridWebPartUserControl : UserControl
    {
        private const int VISIBLE = 1;
        private const int FILTER = 0;
        private const int INVISIBLE = -1;
        private const int UNKNOWN = 99;
        
        private static bool Paging;                          // Paging(true) - Scrolling(false)
        private static DataTable Data = new DataTable();     // Contenuto della griglia
        private static DataTable DataFiltered;               // Contenuto della griglia filtrata
        private static int[,] Status;                        // Struttura ausiliaria utile al riempimento delle "FilterCheckList"
 
         
        // Inizializzazione dello "ScriptManager" (ad ogni caricamento della pagina), dei dati membro e della griglia (solo al caricamento iniziale)
 
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
            if (scriptManager == null)
            {
                scriptManager = new RadScriptManager();
                this.Page.Form.Controls.AddAt(0, scriptManager);
            }           
            if (Data.Rows.Count == 0)
            {
                DataSet Ds = new DataSet();
                Ds.ReadXml("C:\\Temp\\App_Data\\data.xml");  // TODO: Read parameter
                Paging = true;                               // TODO: Read parameter
                Data = Ds.Tables[0];
                DataFiltered = Data.Select("").Length != 0 ? Data.Select("", Data.Columns[0].ColumnName + " ASC").CopyToDataTable() : new DataTable();
                Status = new int[Data.Rows.Count, Data.Columns.Count];
                for (int i = 0; i < Data.Rows.Count; i++)
                    for (int j = 0; j < Data.Columns.Count; j++)
                        Status[i, j] = VISIBLE;               
                RadGrid1.Width = 220 * Data.Columns.Count;
                if (Paging)
                {
                    RadGrid1.AllowPaging = true;
                    RadGrid1.PagerStyle.AlwaysVisible = true;
                }
                else
                {
                    RadGrid1.ClientSettings.Scrolling.AllowScroll = true;
                    RadGrid1.ClientSettings.Scrolling.ScrollHeight = 300;
                }
                for (int i = 0; i < Data.Columns.Count; i++)
                {
                    GridBoundColumn Column = new GridBoundColumn();
                    RadGrid1.MasterTableView.Columns.Add(Column);
                    Column.DataField = Data.Columns[i].ColumnName;
                    Column.UniqueName = Data.Columns[i].ColumnName;
                    Column.HeaderText = Data.Columns[i].ColumnName;
                    Column.FilterDelay = 200;
                    Column.FilterCheckListEnableLoadOnDemand = true;
                }
            }
        }
 
 
        // Filtraggio e databinding della griglia
         
        protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            String filterExpression = Fix_Expression(RadGrid1.MasterTableView.FilterExpression);
            DataFiltered = Data.Select(filterExpression).Length != 0 ? Data.Select(filterExpression, Data.Columns[0].ColumnName + " ASC").CopyToDataTable() : new DataTable();
            Set_Status(filterExpression);
            RadGrid1.DataSource = DataFiltered;
        }
 
 
        // Creazione delle "FilterCheckList"
         
        public void RadGrid1_NeedCheckListItems(object sender, GridFilterCheckListItemsRequestedEventArgs e)
        {
            int col_index = Get_Index(e.Column.UniqueName);
            DataRow[] dr = Data.Select("", Data.Columns[0].ColumnName + " ASC");
            for (int i = 0; i < dr.Length; i++)
            {
                if (!Status[i, col_index].Equals(INVISIBLE))
                {
                    RadListBoxItem Item = new RadListBoxItem();
                    Item.Text = Convert.ToString(dr[i][col_index]);
                    Item.Value = Convert.ToString(Status[i, col_index]);
                    bool Found = false;
                    for (int k = 0; k < e.ListBox.Items.Count; k++)
                    {
                        if (e.ListBox.Items[k].Text.Equals(Item.Text))
                        {
                            Found = true;
                            break;
                        }
                    }
                    if (!Found)
                        e.ListBox.Items.Add(Item);
                }
            }
        }
 
 
        // Utility per la manipolazione della "FilterExpression"
         
        public String Fix_Expression(String filterExpression)
        {
            String newExpression = "";
            for (int i = 0; i < Data.Columns.Count; i++)
            {
                if ( RadGrid1.MasterTableView.Columns[i].EvaluateFilterExpression().Contains("=") )
                {
                    String expression = RadGrid1.MasterTableView.Columns[i].EvaluateFilterExpression();
                    String col_name = expression.Substring(expression.IndexOf("[") + 1, expression.IndexOf("]") - expression.IndexOf("[") - 1);
                    String value = expression.Substring(expression.IndexOf("'") + 1, expression.LastIndexOf("'") - expression.IndexOf("'") - 1);
                    filterExpression = filterExpression + " AND ([" + col_name + "] LIKE '" + value + "%')";
                }
            }
            String[] Expression = filterExpression.Split(new String[] { " AND " }, StringSplitOptions.RemoveEmptyEntries);
            for (int k = 0; k < Expression.Length; k++)
            {
                if (Expression[k].Contains("LIKE"))
                    Expression[k] = Expression[k].Replace("'%", "'");
                else
                {
                    DataRow[] dr = Data.Select("", Data.Columns[0].ColumnName + " ASC");
                    String col_name = Expression[k].Substring(Expression[k].IndexOf("[") + 1, Expression[k].IndexOf("]") - Expression[k].IndexOf("[") - 1);
                    int col_index = Get_Index(col_name);
                    for (int i = 0; i < Data.Rows.Count; i++)
                    {
                        if (Status[i, col_index].Equals(INVISIBLE))
                            Expression[k] = Expression[k].Remove(Expression[k].LastIndexOf(")")) + " OR ([" + col_name + "] = '" + Convert.ToString(dr[i][col_index]) + "'))";
                    }
                }
                newExpression = (k != (Expression.Length - 1)) ? newExpression + Expression[k] + " AND " : newExpression + Expression[k];
            }
            return newExpression.Replace("||"," OR ");
        }
 
 
        // Utility per la modifica di "Status" sulla base del valore della "FilterExpression"
 
        public void Set_Status(string filterExpression)
        {
            for (int j = 0; j < Data.Columns.Count; j++)
            {
                if (!filterExpression.Contains(Data.Columns[j].ColumnName))
                {
                    for (int i = 0; i < Data.Rows.Count; i++)
                        Status[i, j] = Status[i, j].Equals(FILTER) ? UNKNOWN : Status[i, j];
                }
            }
            String[] Expression = filterExpression.Split(new String[] { " AND " }, StringSplitOptions.RemoveEmptyEntries);
            for (int k = 0; k < Expression.Length; k++)
            {
                DataRow[] dr = Data.Select("", Data.Columns[0].ColumnName + " ASC");
                String col_name = Expression[k].Substring(Expression[k].IndexOf("[") + 1, Expression[k].IndexOf("]") - Expression[k].IndexOf("[") - 1);
                int col_index = Get_Index(col_name);
                if ( !Expression[k].Contains("LIKE") )
                {
                    for (int i = 0; i < Data.Rows.Count; i++)
                    {
                        if ( Expression[k].Contains(Convert.ToString("'" + dr[i][col_index] + "'")) )
                            Status[i, col_index] = Status[i, col_index].Equals(FILTER) ? UNKNOWN : Status[i, col_index];
                        else
                            Status[i, col_index] = FILTER;
                    }
                }
            }
            for (int i = 0; i < Data.Rows.Count; i++)
                for (int j = 0; j < Data.Columns.Count; j++)
                {
                    if (!Is_Filtered(i))
                        Status[i, j] = VISIBLE;
                    if (Is_Filtered(i) && !Status[i, j].Equals(FILTER))
                        Fix_Element(i, j);
                }
        }
 
 
        // Utility di supporto alla modifica di "Status"
 
        public void Fix_Element(int row_index, int col_index)
        {
            bool Invisible = true;
            DataRow[] dr = Data.Select("", Data.Columns[0].ColumnName + " ASC");
            for (int i = 0; i < dr.Length; i++)
            {
                if (i != row_index && Convert.ToString(dr[i][col_index]).Equals(Convert.ToString(dr[row_index][col_index])) && !Is_Filtered(i))
                {
                    Invisible = false;
                    break;
                }
            }
            Status[row_index, col_index] = Invisible ? INVISIBLE : VISIBLE;
        }
 
 
        // Utility che verifica se una specifica riga della griglia è filtrata o meno
 
        public bool Is_Filtered(int index)
        {
            for (int j = 0; j < Data.Columns.Count; j++)
            {
                if (Status[index, j].Equals(FILTER))
                    return true;
            }
            return false;
        }
 
 
        // Utility che restituisce l'indice di una colonna della tabella a partire dal suo nome
 
        public int Get_Index(String name)
        {
            for (int j = 0; j < Data.Columns.Count; j++)
            {
                if (Data.Columns[j].ColumnName.Equals(name))
                    return j;
            }
            return -1;
        }
 
    }
}

as you can see in the attached file there's a little graphical problem (double scroll bar and disallignment of button Apply and button Cancel); how can i solve it using css class ".RadFilterMenu_CheckList" or other way?

Thanks in advance.
Regards Giulio.
Maria Ilieva
Telerik team
 answered on 21 Apr 2014
2 answers
257 views
I have a radGrid using ​

FooterStyle-CssClass="preOwnedTierColumn" HeaderStyle-CssClass="preOwnedTierColumn" ItemStyle-CssClass="preOwnedTierColumn"

I am build a responsive design web site. With media queries to hide columns for a certain screen width. In this case I have a css class called 'preOwnedTierColumn' in which I set to display:none when the screen is less than x px.

This all works fine for the header, item and footer, but there is no FilterStyle-CssClass available. I cannot seem to be able to assign the filter template a class or and ID to apply the css rules.

I tried wrapping the content of the filter template in a div with the class of 'preOwnedTierColumn', but this only resulted in the contents not being visible, there is still a TD that is generated and takes on the width of the column in the item, I need the whole TD to be invisible.
<FilterTemplate>
   <div class="preOwnedTierColumn">
      <telerik:RadComboBox ID="RadComboBoxPreOwnedTier" CssClass="preOwnedTierColumn" runat="server" EnableScreenBoundaryDetection="false" ExpandDirection="Down" AppendDataBoundItems="true" DataSourceID="PreOwnedTierDataSource" DataTextField="Pre-Owned Tier" DataValueField="Pre-Owned Tier" DropDownAutoWidth="Enabled" MarkFirstMatch="true" AutoPostBack="true" OnSelectedIndexChanged="RadComboBoxPreOwnedTier_SelectedIndexChanged" SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("PreOwnedTier").CurrentFilterValue%>' Sort="Ascending" SortCaseSensitive="False" Width="78px">
  <Items>
    <telerik:RadComboBoxItem Text="All" />
   </Items>
</telerik:RadComboBox>
   <div style="height: 35px; margin-top: 10px;"> </div>
   </div>
</FilterTemplate>

Any thoughts on how I can apply a css style to a filterTemplate?



Lou
Top achievements
Rank 1
 answered on 21 Apr 2014
2 answers
409 views
Hi All, Just wondering on how can I change the value of my GridColumnGroup Header Text at Runtime? Reason is that the Header text needs to be changed based on variable being passed, and some header is date based.

Thanks in advance,
Rj
RJ
Top achievements
Rank 1
 answered on 21 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?