Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
466 views
I have a page that runs in a RadWindow.  There is a RadButton on this page, that has both an OnClientClicking event (which sets a Tab control index) and an OnClick event which fires logic on the server through the RadAjaxManager.

In Chrome and IE, the OnClientClicking fires, then the OnClick makes the postback.

On Firefox however, the OnClientClicking is the end of the line.  OnClick does not get fired.

If I run this same page directly, instead of from the RadWindow - it works as expected in FireFox...

This is my OnClientClicking routine - pretty simple - I can't see why Firefox would stop.  I get no errors in the Console, etc...

function setResultsTab(sender, args)
{
    var tabStrip = $find('<%=tabCriteria.ClientID%>');
    var tab = tabStrip.findTabByValue('1');
    tab.select();
}
<telerik:RadButton ID="bAdvancedSearch" runat="server" Text="Search" SkinID="defaultButtonLargeSearch"
    OnClick="click_AdvancedSearch" meta:resourcekey="bAdvancedSearchResource2" OnClientClicking="setResultsTab"/>
Danail Vasilev
Telerik team
 answered on 16 Aug 2013
3 answers
123 views
Hey, I know this should have been solved already, just want some quick tips to figure out what is wrong in my settings of the telerik Radgrid control.

the page using a master page, and inside one telerik ajaxpanel. here is the aspx code. and the issue is the top on the scroll bar missing a inline style for margin-right: 17px, but without any clue why it is missing. the screenshots are attached as well.

<%@ Page Language="C#" MasterPageFile="~/MasterPages/LOLA.Master" AutoEventWireup="true" CodeBehind="ReportCellTypePropertyManagement.aspx.cs" Inherits="TSi.LOLA.ReportCellTypePropertyManagement" Culture="auto" meta:resourcekey="Page" UICulture="auto" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <%--<link href="Styles\LabelManagement.css" type="text/css" rel="stylesheet" id="CSSFileCT" />--%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div class="Wrapper" style="margin-left:10px;margin-right:10px;">
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
            <div style="float: left; width: 100%">
                <tsi:TSiDropDownList runat="server" ID="DropDown_CellTypes" Meta:resourceKey="DropDown_CellTypes" DropDown-CssClass="TSIDropDownListStyle"
                    DataTextField="Name" DataValueField="ID" AutoPostBack="false"  DropDownHeight="180" Skin="Sunset" />
                <tsi:TSiButton runat="server" ID="btnGetMapForCellType" meta:resourcekey="Button_GetMapForCellType"
                    RadButton-Width="9%" OnClick="GetMapForCellType_Click" ButtonType="SkinnedButton" Skin="Sunset" />
            </div>
            <div style="float: left; width: 100%">
                <tsi:TSiDropDownList runat="server" ID="DropDown_CellProperties" DefaultMessage="<%$ Resources:DropDown_CellProperties.DefaultMessage %>" DropDown-CssClass="TSIDropDownListStyle"
                    DataTextField="Name" DataValueField="ID" AutoPostBack="false" DropDownHeight="180" Skin="Sunset" />
                <tsi:TSiButton runat="server" ID="btnGetMapForProperty" meta:resourcekey="Button_GetMapForProperty"
                    RadButton-Width="9%" OnClick="GetMapForProperty_Click" ButtonType="SkinnedButton" Skin="Sunset" />
            </div>
            <br />
            <br />
            <br />
            <div class="SearchResults">
                <%--<tsi:TSIGrid runat="server" />--%>
                <telerik:RadGrid runat="server" ID="Grid_CellTypePropertyMap" ClientIDMode="Static"
                    AutoGenerateColumns="false" OnItemDataBound="GridCellTypePropertyMap_ItemDataBound" Skin="Sunset" >
                    <ClientSettings>
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
 
                    <MasterTableView DataKeyNames="ID" ClientDataKeyNames="ID" TableLayout="Fixed">
                        <Columns>
                            <telerik:GridTemplateColumn HeaderText="<%$ Resources:ColumnAttached.HeaderText %>" UniqueName="AttachedCol" >
                                <ItemTemplate>
                                    <asp:CheckBox ID="chbAttached" runat="server" ClientIDMode="AutoID" ></asp:CheckBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="CellTypeName" HeaderText="<%$ Resources:ColumnCellTypeName.HeaderText %>" UniqueName="CellTypeNameCol" />
                            <telerik:GridBoundColumn DataField="CellTypeID" HeaderText="<%$ Resources:ColumnCellTypeID.HeaderText %>" UniqueName="CellTypeIDCol" />
                            <telerik:GridBoundColumn DataField="PropertyName" HeaderText="<%$ Resources:ColumnCellPropertyName.HeaderText %>" UniqueName="PropertyNameCol" />
                            <telerik:GridBoundColumn DataField="PropertyID" HeaderText="<%$ Resources:ColumnCellPropertyID.HeaderText %>" UniqueName="PropertyIDCol" />
                            <telerik:GridTemplateColumn HeaderText="<%$ Resources:ColumnDisplayOrder.HeaderText %>" UniqueName="DisplayOrderCol" >
                                <ItemTemplate>
                                    <asp:TextBox ID="txtDisplayOrder" runat="server" Width="26px" ></asp:TextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
                <br />
                <br />
                <tsi:TSiButton runat="server" ID="Button_Save" Text="<%$ Resources:Button_Save.Text %>"
                    RadButton-Width="9%" OnClick="SaveCelltypePropertyMap_Click" Visible="false" />
            </div>
            <div>
                <br />
                <br />
                <asp:PlaceHolder runat="server" ID="CellTypePropertySaveDetailsTable" Visible="true">
                    <asp:Literal ID="LabelCellTypePropertyDetail" runat="server" />
                </asp:PlaceHolder>
            </div>
        </telerik:RadAjaxPanel>
        <script type="text/javascript">
        </script>
    </div>
 
</asp:Content>
Venelin
Telerik team
 answered on 16 Aug 2013
1 answer
355 views
Hi
I have an ASP.Net MasterPage, with a custom control ("uc1') that has a rad date picker in it ( "myCal')

I want to add a jquery change event on my aspx page but the below code wont work


$(document).ready(function(){

 $('#myCal').change(function(){
        alert('Found');
 });
 
});


Thanks for the help
Shinu
Top achievements
Rank 2
 answered on 16 Aug 2013
1 answer
276 views
Hi..i have a question about radmonthyearpicker control..if i set MinDate='2010-07-15' and MaxDate='2013-09-20'..it's ok..but all months are enabled always not the same than years..it's possible disable the other month by depending selected year?..for example if i click 2010 year only enabled valid months
Shinu
Top achievements
Rank 2
 answered on 16 Aug 2013
1 answer
281 views
Hi All,

I need to put a fdropdown filter in the radgrid. I tried to follow the radgrid demo. But in my case, i need to bind the filter dropdown only in codebehind.

The grid is bound in the needdatasource with an arraylist.

the aspx code is like below,

<telerik:GridTemplateColumn UniqueName="Column1" SortExpression="Column1" HeaderStyle-ForeColor="#245E9E"
HeaderText="Column 1" ItemStyle-Wrap="true" Resizable="true" AutoPostBackOnFilter="true"
CurrentFilterFunction="EqualTo" DataField="Column1">
<FilterTemplate>
<telerik:RadComboBox ID=
"RadComboBoxColumn1" DataTextField="Column1" DataValueField="Column1"
Height="200px" AppendDataBoundItems="true" 
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Column1").CurrentFilterValue %>' 
runat="server" OnClientSelectedIndexChanged="TitleIndexChanged">
<Items>
<telerik:RadComboBoxItem Text=
"All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID=
"RadScriptBlock1" runat="server">
<script type=
"text/javascript">
function TitleIndexChanged(sender, args)
{
var tableView = $find(
"<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter(
"Column1", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
<ItemTemplate>
<asp:Label ID=
"LblColumn1" Text='<%#Eval("Column1")%>' runat="server">
</asp:Label>
<asp:Label ID=
"LblDataSourceType" Text='<%#Eval("DataSourceType")%>' runat="server" Visible="false">
</asp:Label>
</ItemTemplate>
<HeaderStyle Width=
"280px" />
<ItemStyle Font-Names=
"Arial" Font-Size="11px" Wrap="true" />
</telerik:GridTemplateColumn>


Can anybody please help on this an explain me how can i bind the filter dropdown from codebehind?

Thanks in advance

Thanks,
Mahesh O A


Eyup
Telerik team
 answered on 16 Aug 2013
5 answers
216 views
     <ClientSettings AllowKeyboardNavigation="true"  EnablePostBackOnRowClick="true" >
   <ClientEvents />
   <KeyboardNavigationSettings EnableKeyboardShortcuts="true" />
   <Selecting AllowRowSelect="true"  />
</ClientSettings>
Good day  there seems to be a problem with my code, I know the keyboard navigation works(browsing through the grid list using up and down keys) but the mouseclick doesnt work(not executing the postback). I have a function that executes on postback. and also can I change the enter keys function by executing my function instead of editing the data.
Eyup
Telerik team
 answered on 16 Aug 2013
1 answer
262 views
Hi,

I have an issue related to the post back triggered by the command items of radgrid.

Scenario is I have a web page that contains two rad grids they both have their command item template inside the rad-toolbar.

both grids have Add, update, delete on their command item templates whose visibility are decided by the no of record chosen from the respective grid.


Problem - 
When I click say one command item from radgrid1 than it forces the complete page post-back and due to this the command item visibility 
on radgrid 2 gets reset .
So is there any way that both grids should not disturb the each other say command items visibility.

Please help


thanks

Eyup
Telerik team
 answered on 16 Aug 2013
1 answer
305 views
 Hi,
      Is there any possible to find the dropped event of radgrid when value dragged from another control.

Example:
Drag a selected Text  from textbox and drop on radgrid. (Find the drop and drop event 2 different controls)
Drag event from text box and Drop event of radgrid





Thanks
Konstantin Dikov
Telerik team
 answered on 16 Aug 2013
10 answers
254 views
Hello,

I have browsed the Telerik forums many times in the past, but this is my first time posting. I am trying to have all of the columns in a RadGrid resize automatically every time the page loads. Currently, I am using the client-side resizeToFit method that I found recommended in many forum threads by Telerik employees as well as documented here:http://www.telerik.com/help/aspnet-ajax/grid-gridcolumn-resizetofit.html

The code I have below works perfectly when viewing the grid and when editing an existing row on the grid (as in, each column resizes to fit the widest control contained within its cells); however, when inserting a new row using the InitInsert command, the resizeToFit method does not cause the columns to expand to fit the widest control contained in their cells. Instead, the columns stay at the same size they were before initiating the insert command, and since the editing controls are wider than the read controls, the editing controls get cut off (although the columns expand fine as long as you're editing an existing row and not inserting a new one).

I have ensured that the code is getting hit by setting breakpoints, and I have verified that my RadGrid.ClientSettings.Resizing settings are set correctly. (I have AllowResizeToFit = true; ClipCellContentOnResize = false; AllowColumnResize = true; EnableRealTimeResize = false; AllowRowResize = false; ResizeGridOnColumnResize = true--all set at runtime in the code-behind, where I verified that it is being hit by setting breakpoints.)

I have considered setting each column width manually when the MasterTableView is in insert mode, but this is not a very good solution since I am using one RadGrid to display several different datasets (where the dataset to be displayed is determined by the module selected) and each dataset has its own set of columns, each with their own column names, data types, and controls. The only other option I can think of to work around this issue is to edit an existing item using editItem (http://www.telerik.com/help/aspnet-ajax/grid-gridtableview-edititem.html) when the MasterTableView is in insert mode (http://www.telerik.com/help/aspnet-ajax/grid-gridtableview-get-isiteminserted.html), but that does not look good at all and it takes the page longer to load after initiating an insert command.

Here is the code I have right now:
function pageLoad() {
var grid = $find('<%= RadGrid1.ClientID %>');
var view= grid.get_masterTableView();
var columns = view.get_columns();
for (var i = 0; i < columns.length; i++) {

      columns[i].resizeToFit();
  }
}
Kostadin
Telerik team
 answered on 16 Aug 2013
3 answers
183 views
Hi,

I have followed the example code for filtering a RadTreeView using a RadTextBox as you type into the box, and it works a charm.  The link to that example is here: Filter Tree

I am using Telerik version: 2013.2.611.40

The issue I have is that my tree and textbox are in a user control, and on the same page I have two versions of this control.  When I type into the first textbox to filter the first tree nothing happens, but the second tree does expand.  The second tree works fine.

I know this is an issue with the valueChanged javascript function being called twice, but I cannot figure out a way around it, as this is hooked up the the keydown event on the textbox as a delegate (i think).

I have looked through plenty of articles saying to pass through the target, or to implement INamingContainer but nothing I do seems to sort this issue out.

Can anyone point me in the right direction?

Screenshots attached showing issue:

Screen 1 - page first loaded and both tree, fully collapsed.
Screen 2 - enter character into first textbox, and second tree expands.
Screen 3 - enter character into second textbox, and second tree filters as expected.

Demo project code below:

Master Page:

<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="TestTree.master.vb" Inherits="TestTreeViewFiltering.TestTree" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <div>
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
         
            </asp:ContentPlaceHolder>
        </div>
    </form>
</body>
</html>

Web Page:

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/TestTree.Master" CodeBehind="TestFilterTree.aspx.vb" Inherits="TestTreeViewFiltering.TestFilterTree" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="~/ucFilterTree.ascx" TagName="ucFilterTree" TagPrefix="uc1" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadSplitter ID="RadSplitter1" runat="server">
        <telerik:RadPane ID="rpLeft" runat="server">
            <uc1:ucFilterTree ID="ucFilterTreeLeft" runat="server" />
        </telerik:RadPane>
        <telerik:RadSplitBar ID="rsbSplit" runat="server"></telerik:RadSplitBar>
        <telerik:RadPane ID="rpRight" runat="server">
            <uc1:ucFilterTree ID="ucFilterTreeRight" runat="server" />
        </telerik:RadPane>
    </telerik:RadSplitter>
</asp:Content>

UserControl:

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ucFilterTree.ascx.vb" Inherits="TestTreeViewFiltering.ucFilterTree" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<asp:UpdatePanel ID="upFilterTree" runat="server">
    <ContentTemplate>
        <telerik:RadTextBox ID="rtbFilterText" runat="server">
            <ClientEvents OnLoad="clientLoad" />
        </telerik:RadTextBox>
 
        <telerik:RadTreeView ID="rtvFilterTree" runat="server"></telerik:RadTreeView>
    </ContentTemplate>
</asp:UpdatePanel>
 
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            String.prototype.startsWith = function (string) {
                return (this.lastIndexOf(string, 0) === 0);
            }
 
            var _timer = null;
 
            function clientLoad(sender) {
                $telerik.$(".riTextBox", sender.get_element().parentNode).bind("keydown", valueChanging);
            }
 
            function valueChanging(sender, args) {
                if (_timer) {
                    clearTimeout(_timer);
                }
 
                _timer = setTimeout(function () {
                    var _tree = $find("<%= rtvFilterTree.ClientID%>");
                    var _textBox = $find("<%= rtbFilterText.ClientID%>");
 
                    var _searchString = _textBox.get_element().value;
 
                    for (var _ii = 0; _ii < _tree.get_nodes().get_count() ; _ii++) {
                        findNodes(_tree.get_nodes().getNode(_ii), _searchString);
                    }
                }, 100);
            }
 
            function findNodes(node, searchString) {
                node.set_expanded(true);
 
                var _hasChildren = false;
 
                for (var _ii = 0; _ii < node.get_nodes().get_count() ; _ii++) {
                    _hasChildren = findNodes(node.get_nodes().getNode(_ii), searchString) || _hasChildren;
                }
 
                var _textToCheck = node.get_textElement().textContent;
                if (_hasChildren || _textToCheck.toLowerCase().startsWith(searchString.toLowerCase())) {
                    node.set_visible(true);
                    return true;
                } else {
                    node.set_visible(false);
                    return false;
                }
            }
        </script>
    </telerik:RadScriptBlock>

VB

Public Class ucFilterTree
    Inherits System.Web.UI.UserControl
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            rtvFilterTree.LoadContentFile("~/TreeData.xml")
        End If
    End Sub
 
End Class

XML Data:

<?xml version="1.0" encoding="utf-8" ?>
<Tree>
    <Node Text="Desktop" ToolTip="Desktop">
        <Node Text="Administrator">
            <Node Text="AppData" >
                <Node Text="Microsoft" />
            </Node>
            <Node Text="Contacts" />
            <Node Text="Downloads" />
            <Node Text="Documents" />
            <Node Text="Favorites" >
                <Node Text="Links" />
            </Node>
            <Node Text="Music" />
            <Node Text="Pictures" />
            <Node Text="Saved Games" />
            <Node Text="Searches" >
                <Node Text="History" />
            </Node>
            <Node Text="Videos" />
        </Node>
        <Node Text="Computer" ToolTip="My Computer">
            <Node Text="WebServer (\\10.0.0.80) (W:)" />
            <Node Text="Local Disk (C:)">
                <Node Text="inetpub">
                    <Node Text="AdminScripts"></Node>
                </Node>
            </Node>
            <Node Text="Local Disk (D:)">
                <Node Text="Movies" />
                <Node Text="Music" />
                <Node Text="Games" />
            </Node>
        </Node>
    </Node>
</Tree>

Thanks 

Dale
Boyan Dimitrov
Telerik team
 answered on 16 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?