Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
77 views
couldn't find a more appropriate forum category...

button click seems to drop out when you add a dynically create button to a dynmically created pageview.
works ok if you add a dynamic button to an existing pageview.
is this an issue or am i doing it wrong?
code snippets follow...

thanks,
paul

p.s. if i add the button dynamically to the specific pageview "PV1" then the click works



        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["counter"] != null)
            { counter = (int)Session["counter"]; }

            Telerik.Web.UI.RadPageView newPageView = new Telerik.Web.UI.RadPageView();
            newPageView.ID = "pv_" + counter.ToString();
            newPageView.Visible = true;
            MP1.PageViews.Add(newPageView);
            MP1.SelectedIndex = MP1.FindPageViewByID(newPageView.ID).Index;

            Telerik.Web.UI.RadTab newTab = new Telerik.Web.UI.RadTab();
            newTab.Text = newPageView.ID;
            newTab.Visible = true;
            TS1.Tabs.Add(newTab);
            TS1.SelectedIndex = TS1.FindTabByText(newTab.Text).Index;

            System.Web.UI.WebControls.Button newButton = new System.Web.UI.WebControls.Button();
            newButton.ID = "btn_" + counter.ToString();
            newButton.Text = "Close Image";
            newButton.Click += new EventHandler(btnRemoveFromList_Click);
            newPageView.Controls.Add(newButton);

            counter++;
            Session["counter"] = counter;
    }


<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TestCtrl.ascx.cs" Inherits="WebApplication2.TestCtrl" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<link rel="Stylesheet" type="text/css" href="~/Styles/SiteX.css" id="style" runat="server" visible="false" />
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>

<telerik:RadTabStrip ID="TS1" runat="server" SelectedIndex="0"
  MultiPageID="MP1" Skin="Simple">
    <Tabs>
            <telerik:RadTab runat="server" Text="Search">
                </telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>

<telerik:RadMultiPage ID="MP1" Runat="server" SelectedIndex="0"
            Width="100%" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px">
    <telerik:RadPageView ID="PV1" runat="server">
        </telerik:RadPageView>
</telerik:RadMultiPage>










paul
Top achievements
Rank 1
 answered on 12 Aug 2010
2 answers
109 views
Hi Friends,
                   I have a RadComboBox in which i have set the Height acording to the number of RadComboBox Items in it.
Im loading the RadComboBox Items on runtime and no of items depends ..So how to solve this..Plz help  me..

Regards Titti.S
TSM
Top achievements
Rank 1
 answered on 12 Aug 2010
4 answers
222 views
Hi guys,

Can I use radajaxmanager and loadingpanel together?
I believe, if I use those controls in aspx, then it will work fine (like the below) 

<telerik:RadAjaxManager ID="radAjaxManager" runat="server">
.... some codes
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="radAjaxLoadingPanel" runat="server" Skin="Default" />

But what about if I have radajaxmanager in master page, and loadingpanel in the content page.
And the way I use the radajaxmanager in content page is by registering my controls into the master page's radajaxmanager.

this.BaseMaster.RadAjaxManager.AjaxSettings.AddAjaxSetting(productLocation, productLocation);

Please advice

AGT
 
Andy Taslim
Top achievements
Rank 1
 answered on 12 Aug 2010
0 answers
299 views
hi
       Please check below code is correct or wrong

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    <telerik:RadCodeBlock runat="server">

        <script type="text/javascript">
            function onRowClick(object, eventArgs)
            {
                var index = eventArgs.get_itemIndexHierarchical();
                var dataItem = object.get_masterTableView().get_dataItems()[index];
                var row = dataItem.get_element();
                var ckeckBox = row.children[0].children[0];
                if (!ckeckBox.checked)
                {
                    ckeckBox.checked = true;
                    row.style.background = 'url("/Example/WebResource.axd?d=JSFPqlAaSqKUrTohMTfXqfrIw9LabHGFla0WzaxpulM-qz-1hwuBBMMilJcO_tHwtYJ1swr0Et0pNdj0ce13ug2&t=634050632760000000") repeat-x scroll 0 -3900px #97B8E8';
                }
                else
                {
                    ckeckBox.checked = false;
                    row.style.background = "";
                }

                var flag = true;
                for (var i = 0; i < object.get_masterTableView().get_dataItems().length; i++)
                {
                    var dataItem = object.get_masterTableView().get_dataItems()[i];
                    var row = dataItem.get_element();
                    var ckeckBox = row.children[0].children[0];
                    if (!ckeckBox.checked)
                    {
                        flag = false;
                    }
                }

                if (flag)
                {
                    setCheckBox(true);
                }
                else
                {
                    setCheckBox(false);
                }
            }

            function setSelectedAfterPostback(rowIDs)
            {
                var arrRowIDs = rowIDs.split(",");
                for (var i = 0; i < arrRowIDs.length - 1; i++)
                {
                    var row = document.getElementById(arrRowIDs[i]);
                    var ckeckBox = row.children[0].children[0];
                    ckeckBox.checked = true;
                    row.style.background = 'url("/Example/WebResource.axd?d=JSFPqlAaSqKUrTohMTfXqfrIw9LabHGFla0WzaxpulM-qz-1hwuBBMMilJcO_tHwtYJ1swr0Et0pNdj0ce13ug2&t=634050632760000000") repeat-x scroll 0 -3900px #97B8E8';
                }
            }

            function CheckBoxCheckedOnClient(rowID, chechBoxId)
            {
                var row = document.getElementById(rowID);
                var ckeckBox = document.getElementById(chechBoxId);
                if (ckeckBox.checked)
                {
                    row.style.background = 'url("/Example/WebResource.axd?d=JSFPqlAaSqKUrTohMTfXqfrIw9LabHGFla0WzaxpulM-qz-1hwuBBMMilJcO_tHwtYJ1swr0Et0pNdj0ce13ug2&t=634050632760000000") repeat-x scroll 0 -3900px #97B8E8';
                }
                else
                {
                    row.style.background = "";
                }
            }

            function setCheckBox(toCheck)
            {
                var checkBoxID = document.getElementById("hf1").value;
                var checkBox = document.getElementById(checkBoxID);
                checkBox.checked = toCheck;
            }

            function CheckUnCheckAll(id)
            {
                var sender = document.getElementById(id);
                var grid = $find("<%=RadGrid1.ClientID %>");

                for (var i = 0; i < grid.get_masterTableView().get_dataItems().length; i++)
                {
                    var dataItem = grid.get_masterTableView().get_dataItems()[i];
                    var row = dataItem.get_element();
                    var checkBox = row.children[0].children[0];
                    if (sender.checked)
                    {
                        checkBox.checked = true;
                        row.style.background = 'url("/Example/WebResource.axd?d=JSFPqlAaSqKUrTohMTfXqfrIw9LabHGFla0WzaxpulM-qz-1hwuBBMMilJcO_tHwtYJ1swr0Et0pNdj0ce13ug2&t=634050632760000000") repeat-x scroll 0 -3900px #97B8E8';
                    }
                    else
                    {
                        checkBox.checked = false;
                         row.style.background = "";
                    }
                }

            }
        </script>

    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <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 Java Script code here.
    </script>

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadGrid runat="server" Skin="Outlook" AutoGenerateColumns="false" ID="RadGrid1">
            <MasterTableView>
                <Columns>
                    <telerik:GridTemplateColumn UniqueName="template">
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox" runat="server" />
                        </ItemTemplate>
                        <HeaderTemplate>
                            <asp:CheckBox ID="CheckBox" runat="server" />
                        </HeaderTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="ID" UniqueName="ID" HeaderText="ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Item" UniqueName="Item" HeaderText="Item">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Date" UniqueName="Date" HeaderText="Date">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnRowClick="onRowClick" />
            </ClientSettings>
        </telerik:RadGrid>
        <asp:HiddenField ID="hf1" runat="server" />
        <asp:Button runat="server" ID="Button1" Text="Get selected rows IDs" />
    </div>
    </form>
</body>
</html>

Code behind
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;

public partial class Default : System.Web.UI.Page
{
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        RadGrid1.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
        RadGrid1.ItemDataBound += new GridItemEventHandler(RadGrid1_ItemDataBound);
        RadGrid1.PreRender += new EventHandler(RadGrid1_PreRender);
        RadGrid1.ItemCreated += new GridItemEventHandler(RadGrid1_ItemCreated);
    }

    void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Header)
        {
            GridHeaderItem headerItem = (GridHeaderItem)e.Item;
            CheckBox chkSelectAll = (CheckBox)headerItem["template"].Controls[1];
            hf1.Value = chkSelectAll.ClientID;

            string script = "CheckUnCheckAll('" + chkSelectAll.ClientID + "')";
            chkSelectAll.Attributes.Add("onclick", script);
        }
    }

    void RadGrid1_PreRender(object sender, EventArgs e)
    {
        string IDs = string.Empty;
        string rowIDs = string.Empty;
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
        {
            CheckBox checkBox = item["template"].FindControl("CheckBox") as CheckBox;
            if (checkBox.Checked)
            {
                IDs = IDs + item["ID"].Text + ",";
                rowIDs = rowIDs + item.ClientID.ToString() + ",";
            }
        }
        if (!string.IsNullOrEmpty(IDs))
        {
            IDs = IDs.Substring(0,IDs.LastIndexOf(","));
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "setSelectedAfterPostback", "setSelectedAfterPostback('" + rowIDs + "');", true);
            RadAjaxManager1.Alert(IDs);
        }
    }

    void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = e.Item as GridDataItem;
            CheckBox checkBox = item["template"].FindControl("CheckBox") as CheckBox;
            string script = "CheckBoxCheckedOnClient('" + item.ClientID + "', '" + checkBox.ClientID + "')";
            checkBox.Attributes.Add("onclick", script);
        }
    }

    void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        DataTable table = new DataTable();
        table.Columns.Add("ID");
        table.Columns.Add("Item");
        table.Columns.Add("Date", typeof(DateTime));
        for (int i = 1; i < 8; i++)
        {
            table.Rows.Add(i, "Item" + i.ToString(), DateTime.Now.AddDays(i));
        }
        RadGrid1.DataSource = table;
    }
}


Web.config
<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
    <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                </sectionGroup>
            </sectionGroup>
        </sectionGroup>
    </configSections>
    <appSettings>
        <add key="Telerik.ScriptManager.TelerikCdn" value="Disabled"/>
        <add key="Telerik.StyleSheetManager.TelerikCdn" value="Disabled"/>
    </appSettings>
    <connectionStrings/>
    <system.web>
        <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
        <compilation debug="true">
            <assemblies>
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            </assemblies>
        </compilation>
        <pages>
            <controls>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
            </controls>
        </pages>
        <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
        <authentication mode="Windows"/>
        <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
            <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/>
            <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>
            <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/>
            <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/>
            <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
        </httpHandlers>
        <httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/>
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
        </httpModules>
    </system.web>
    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler>
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="OptionInfer" value="true"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler>
        </compilers>
    </system.codedom>
    <!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
            <remove name="ScriptModule"/>
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <remove name="RadUploadModule"/>
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode,runtimeVersionv2.0"/>
            <remove name="RadCompression"/>
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode,runtimeVersionv2.0"/>
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <remove name="ScriptHandlerFactory"/>
            <remove name="ScriptHandlerFactoryAppServices"/>
            <remove name="ScriptResource"/>
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <remove name="ChartImage_axd"/>
            <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
            <remove name="Telerik_Web_UI_SpellCheckHandler_axd"/>
            <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
            <remove name="Telerik_Web_UI_DialogHandler_aspx"/>
            <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
            <remove name="Telerik_RadUploadProgressHandler_ashx"/>
            <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
            <remove name="Telerik_Web_UI_WebResource_axd"/>
            <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
        </handlers>
    </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>
mani kandan
Top achievements
Rank 1
 asked on 12 Aug 2010
4 answers
167 views
Hi All,

I am trying to open a Radwindow using Javascript. It works fine in IE and firefox but not SAFARI.

My function is :

Function ShowRadWindow()
{
        var oWin = $find('radwndHandoverNote');

}

I get the error TypeError : Result of expression '$find' [undefined] is not a function.

Regards,
Sharanya
sharanya
Top achievements
Rank 1
 answered on 12 Aug 2010
2 answers
135 views
I have a Save button on my form in the bottom center of my page. I have a treeview on the left.

When I click on my Save button, I will perform some validation with some other items on the screen. If the validation passes, I would like the treeview on the left to set the color on the present node to red and then to move down to the next node in the tree.

Question is, how do I get a reference to the treeview and those nodes from clicking my Save button in order to perform those functions?

Thanks,

Bill
Bill
Top achievements
Rank 2
 answered on 12 Aug 2010
7 answers
317 views
Hello:

I am trying to get a grid to show as a listview using your demo http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx.

The only way I can get anything to display on the screen is to comment out the lines showing in the following prerender statement.

        protected void rgdImg_PreRender(object sender, EventArgs e) 
        { 
            int itemCount = rgdImg.MasterTableView.GetItems(GridItemType.Item).Length + rgdImg.MasterTableView.GetItems(GridItemType.AlternatingItem).Length; 
            foreach (GridItem item in rgdImg.Items) 
            { 
                //if (item is GridDataItem && item.ItemIndex < itemCount) 
                //{ 
                //    ((item as GridDataItem)["ImageID"] as TableCell).Controls.Add(new LiteralControl("<table><tr><td>")); 
                //} 
            } 
        } 
 

The data that shows up is all over the place, not in a nice tabular form. Some will be in the grid, some appear to be outside etc.

If I uncomment the lines of code in the prerender I get nothing to display in the grid at all. It will iterate through the grid.items etc. as it should but nothing will display. I have verified that the data is in the datasource when bound.

My Radgrid code is below

                        <telerik:RadGrid ID="rgdImg" runat="server"  
                                         AllowPaging="true"  
                                         PageSize="4"  
                                         EnableHeaderContextMenu="false" 
                                         OnNeedDataSource="rgdImg_NeedDataSource"  
                                         ShowFooter="false"  
                                         AutoGenerateColumns="false" 
                                         OnItemCommand="rgdImg_ItemCommand"  
                                         OnItemDataBound="rgdImg_ItemDataBound" 
                                         OnPreRender="rgdImg_PreRender"> 
 
                            <MasterTableView TableLayout="Fixed"  
                                             EnableHeaderContextMenu="false"  
                                             DataMember="Image"> 
                                <Columns> 
                                    <telerik:GridBoundColumn UniqueName="ImageID" ReadOnly="true" Display="false" DataField="ImageID" /> 
                                    <telerik:GridTemplateColumn> 
                                    <ItemTemplate> 
                                            <%#  (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %> 
                                            <asp:Panel ID="pnlGrid" runat="server" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>'> 
                                                <asp:Label ID="ImageID" runat="server" Visible="false" /> 
                                                <%# DataBinder.Eval(Container.DataItem, "ImageID") %> 
                                                <asp:CheckBox ID="ckImage" runat="server" Checked="false" AutoPostBack="true" OnCheckedChanged="rgdImg_OnCheckedChanged" />&nbsp;&nbsp; 
                                                <asp:Image ID="image" runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "RelPath") %>' /> 
                                                <br /> 
                                                <asp:Label ID="lblImageName" runat="server" Text="Image Name:   "></asp:Label> 
                                                <%# DataBinder.Eval(Container.DataItem, "Name") %> 
                                                <br /> 
                                                <asp:Label ID="lblArtType" runat="server" Text="Type:   "></asp:Label> 
                                                <%# DataBinder.Eval(Container.DataItem, "Type") %> 
                                                <br /> 
                                                <asp:Label ID="lblImageTag" runat="server" Text="Tags:  "></asp:Label> 
                                                <%# DataBinder.Eval(Container.DataItem, "Tag") %> 
                                                <br /> 
                                                <asp:Label ID="lblAltName" runat="server" Text="Alt. Name:  "></asp:Label> 
                                                <%# DataBinder.Eval(Container.DataItem, "AltName") %> 
                                                <br /> 
                                                <asp:Label ID="lblImageDescription" runat="server" Text="Description:   "></asp:Label> 
                                                <%# DataBinder.Eval(Container.DataItem, "Description") %> 
                                            </asp:Panel> 
<%--                                            <%# (((GridItem)Container).ItemIndex != (((GridItem)Container).OwnerTableView.PageSize - 1))? "<table style='display:none;'><tr><td>" : "" %> 
--%>                                        </ItemTemplate> 
                                    </telerik:GridTemplateColumn> 
                                </Columns> 
                                </MasterTableView> 
                            <ClientSettings> 
                                <Selecting AllowRowSelect="true" /> 
                            </ClientSettings> 
                        </telerik:RadGrid> 
 

Thanks for your time.
Chris
Top achievements
Rank 1
 answered on 11 Aug 2010
2 answers
243 views
Good Day Telerik Support and User Community, 

I have a requirement to export a large amount of data from a table in the which the Radgrid is successfully bound.  There are about 130k rows of data in the table in which the Radgrid is successfully displaying data through the usage of a linq datasource.  This Radgrid implementation was modelled after the performance demo entitled "300000 rows with LINQ" and combined with other demos to introduce smart filtering on the desired columns.  The result is an extremely fast UI presentation. 

Although,  when the user applies the desired filter & selects the export option, the system may sometimes croak depending on the total record count in the resulting dataset.  There are a few ways around this problem & I am hoping you can direct me in the implementation with Radgrid:

Option 1 (ideal):  When the export button is pressed, capture the export event and discover the radgrid's filter selections which are then used asynchronously to generate a report.  The creation/delivery of the report can be done via Telerik reporting or SSRS or some other technology that is better built to handle large loads of data.

Option 2: simply catch the export event and instruct the user to further filter the grid if too many rows are still being shown.

In either option,  I need to figure out 
1-- how to capture the export event
2-- how to determine the filter criteria that the user specified

Please assist me in determining how to perform these two operations, as I cannot find an example or documentation in either.

Thanks in advance...  
--Joe.

Joe
Top achievements
Rank 1
 answered on 11 Aug 2010
2 answers
150 views
Trying to add a bit of visual eye candy to my RadComboBox...

I am pre-populating a RadComboBox with values from a database. While doing this, I'm adding an item at the top called "Select an Analyst" which gets used if the value is null. I'm adding this item in italics...kind of how it looks when use EmptyMessage. What I would like to do though, is if someone selects an item in the RadComboBox that is not "Select an Analyst", the font changes back to normal.

I'm assuming I would have to do this with client side javascript, but I can't seem to figure out client side how to change the font property of the RadComboBox. I'm using the OnClientSelectedIndexChanged event. Can I change the font style based on the eventArgs client side?

Thanks for the help!
Philip Senechal
Top achievements
Rank 1
 answered on 11 Aug 2010
5 answers
144 views
Mostly out of curiosity, I am wondering if anyone actually uses the Autogenerated Columns feature? There are several reasons I never use it (mainly that I want more control over how it looks) but the biggest reason of them all is that the names the columns have in the database almost never are what you want the user to see. Considering that this option is almost at the top of the Smart-tag in Visual Studio, at least Telerik must think that a lot of people use this, so I cant help wondering, "is there a smart way of using autogenerated columns that I just dont know about??"
improwise
Top achievements
Rank 1
Iron
Iron
 answered on 11 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?