Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
186 views
Hi,
I have a radtreeview control on my aspx page. The treeview control is populated from a dataset on selectedindex_change event of a combobox control through asynchrounous postback.

I have a text box in which the user enters a string, based on the string entered the nodes which contain the string in their text must only be displayed. eg:- if(treeview.node[i].text.contains(textbox.text))
                            {
                                display node........
                            }
                            else
                            {
                                node.visible=false;
                            }
To achieve this I have a textbox onkeypress event. But whenever i try "treeview.AllNodes.length" in my javascript it gives me null.
Kindly guide me through.

Thanks.
Kate
Telerik team
 answered on 12 May 2011
1 answer
29 views
Can we apply Styles from TelerikStyleBuilder to a ASP.NET gridview?
Princy
Top achievements
Rank 2
 answered on 12 May 2011
2 answers
106 views
Hello,
When I open a Radwindow with "radopen" function and "autoSize",
The first time the window is opened, It's Ok. but when I use the "Ok" button, there is some scroll which appears.

Here is an example.

Perhaps you can help me ?
Manys thanks.
Bernard

Telerik.js
<!--
// Pop up
var XPupVal_Ok = "XPup1";
var XPupVal_Annuler = "XPup0";
function XPupAdjust() 
    setTimeout(function(){XPupGetWin().autoSize(true)}, 500);
}
function XPupGetWin()
{
    var oWindow = null;
    if (window.radWindow) oWindow = window.radWindow;
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
    return oWindow;
}
  
function XPupOk()
{
    XPupGetWin().close(XPupVal_Ok);
}
function XPupAnnuler()
{
    XPupGetWin().close(XPupVal_Annuler);
}
function XPupClose(sender, args)
{
    if (args.get_argument() == XPupVal_Ok)
    {
        //some code
    };
}
-->

Telerik_Main.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Telerik_Main.aspx.cs" Inherits="Xarc.Telerik_Main" %>
  
<%@ Register Assembly="Telerik.Web.UI, Version=2010.3.1317.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
      
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>Page sans titre</title>
  
    <script type="text/javascript" src="Telerik.js"></script>
  
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  
        <script type="text/javascript">
        function pageLoad() 
        {
  
        
        function ShowTelerik_Window()  
        {    
                                                                       
            function f()
            {
                Sys.Application.remove_load(f);
                window.radopen("Telerik_Window.aspx", "Telerik_Window");  
            }
            Sys.Application.add_load(f);
        }
        </script>
  
    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div>
        <telerik:RadToolBar ID="toolBar" runat="server" BackColor="White" Width="100%" AutoPostBack="True"
            OnButtonClick="toolBar_ButtonClick">
            <Items>
                <telerik:RadToolBarButton runat="server" ToolTip="Window Open" Value="LOC" Text="OpenRadW">
                </telerik:RadToolBarButton>
            </Items>
        </telerik:RadToolBar>
    </div>
    <telerik:RadWindowManager runat="server" RestrictionZoneID="offsetElement" ID="XPupWindowManager"
        EnableShadow="true" ShowOnTopWhenMaximized="False" Behavior="Default" InitialBehavior="None"
        OnClientClose="XPupClose" Behaviors="None" Modal="true">
    </telerik:RadWindowManager>
    </form>
</body>
</html>

Telerik_Window.ASPX

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Telerik_Window.aspx.cs"
    Inherits="Xarc.Telerik_Window" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>Page sans titre</title>
    <script type="text/javascript" src="Telerik.js"></script>
    <script type="text/javascript">
        function pageLoad() 
        {
            XPupAdjust(); 
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
    <div style="height: 142px; width: 496px">
        <table style="width: 100%;">
            <tr>
                <td>
                    <asp:Label ID="LibLabel" runat="server"></asp:Label>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RFV" runat="server" Display="Dynamic" ErrorMessage="Libellé obligatoire"
                        ControlToValidate="Lib" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                </td>
                <td>
                    <asp:TextBox ID="Lib" runat="server" Width="336px"></asp:TextBox>
                </td>
            </tr>
        </table>
        <br />
        <asp:Button ID="MnuOk" runat="server" ToolTip="Validez" Text="Ok" OnClick="MnuOk_Click">
        </asp:Button>
        <asp:CustomValidator ID="CustomValidatorGeneral" runat="server" ErrorMessage="*"
            Display="Dynamic" ForeColor="White"></asp:CustomValidator>
        <input id="AnnBt" type="button" value="Annuler" onclick="XPupAnnuler();" />
        <div>
            <asp:ValidationSummary ID="ValidationSummary" runat="server" Width="100%"></asp:ValidationSummary>
        </div>
    </div>
    </form>
</body>
</html>

Telerik_Main.cs

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.Web.UI;
  
namespace Xarc
{
    public partial class Telerik_Main : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //RadAjaxManager1.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(manager_AjaxRequest);
        }
        protected void toolBar_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            switch (e.Item.Value)
            {
                case @"LOC":
                    ScriptManager.RegisterStartupScript(this, GetType(), @"ShowTelerik_Window", @"ShowTelerik_Window();", true);
                    break;
            };
        }
        protected void manager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
        {
            try
            {
                  
            }
            catch (Exception err)
            {
                 
            }
        }
    }
}

Telerik_Window.cs

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.Web.UI;
  
namespace Xarc
{
    public partial class Telerik_Window : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
  
        }
  
        protected void MnuOk_Click(object sender, EventArgs e)
        {
  
        }
    }
}
Stéphane
Top achievements
Rank 1
 answered on 12 May 2011
2 answers
49 views
When a multi-day appointment fires the AppointmentCreated event of the Scheduler, how can I tell what date the event has been fired for?

In other words, if I have an appointment scheduled for 5 days, it seems to fire the AppointmentCreated event 5 times.  The start/end dates are naturally the same, and I don't see a way to tell which date the event is being fired for.
Adrian Barnes
Top achievements
Rank 1
 answered on 12 May 2011
1 answer
209 views
Hi, i looked into the samples in doing this but here are some issues,

A) my custom controls have dropdownboxes that populated on the page load of the control. However this method causes the  Invalid attempt to call FieldCount when reader is closed error, when adding a new record.  How do i correct this that i dont get that error and i get the control loaded with data as i invoke it

B) i noticed that when using the custom control way, the control would cover the grid even with the Edit Mode set to EditForms, is there a way it can behave like the autogenerated editforms?

Thanks!




Elliott
Top achievements
Rank 2
 answered on 12 May 2011
1 answer
55 views
Hi , i'm student , i have some problem with ajax manager,when i click to btnclick button ,the code will run until RadGrid2.DataSource = qt.DanhSachDoiQua(makh); , but i must reload my site then
it updated into RadGrid2
 

 this's my code
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"
                   Skin="Default" >
               </telerik:RadAjaxLoadingPanel>
               <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
                   DefaultLoadingPanelID="RadAjaxLoadingPanel1" EnableAJAX="true" >
                   <AjaxSettings >
                         <telerik:AjaxSetting  AjaxControlID="btnclick"  >
                           <UpdatedControls>                                  
                               <telerik:AjaxUpdatedControl ControlID="RadGrid2"   />                            
                           </UpdatedControls>
                       </telerik:AjaxSetting>                      
                   </AjaxSettings>
               </telerik:RadAjaxManager>
protected void btnclick_Click(object sender, EventArgs e)
{
    qt = new global::sieuthi.BUSINESS.B_quatang();
    foreach (GridDataItem item in RadGrid1.SelectedItems)
    {
        string strKey = "";
        string sl = "";
        //  TextBox tb = (TextBox)item.TemplateControl.FindControl("txtsl");//.GetDataKeyValue("txtsl").ToString();
        try
        {
            strKey = item.GetDataKeyValue("ID").ToString();
            sl = txtsoluong.Text.Trim();
            qt.addQuatang(makh, strKey, int.Parse(sl));
        }
        catch (Exception ex)
        {
            lbloi.Text = ex.Message;
            //khach2 hàng @KH đã có trong DS tặng quà cá»§a sá»± kiện @sukien Nam @nam ==>bo sung gap
        }
    }          
    RadGrid2.DataSource = qt.DanhSachDoiQua(makh);
}
Cori
Top achievements
Rank 2
 answered on 12 May 2011
4 answers
374 views

Hi team,

I have a doubt in radgrid, Is there any chance to hide header and paging row in detail table of hierarchical
grid.

For quick idea please view the below url, which i am expecting
http://picasaweb.google.com/lh/photo/ef77PtMyZe6xC35UHUHAFg?feat=directlink

But Currently using telerik i m able to get like below image(Url)
http://picasaweb.google.com/lh/photo/-qzk-asxoAWVlajOY0f8wg?feat=directlink

If, please send an example it's very urgent!!!!!!!!!!

Thanks for any advance help.....

Princy
Top achievements
Rank 2
 answered on 12 May 2011
1 answer
89 views
Hi,
I needs to save radgrid criteria. While searching i got the link
 "http://demos.telerik.com/aspnet-ajax/grid/examples/programming/savinggridsettingsonperuserbasis/defaultcs.aspx"


but "GridSettingsPersister " is not seems to be working on my app. Any idea on this

Thanks
Jobin
Shinu
Top achievements
Rank 2
 answered on 12 May 2011
2 answers
67 views
Hi,

May I know why some funny stuffs appeared at the title of the Telerik Windows? Please view the attachment as your reference.

Thanks
Jacob
Top achievements
Rank 1
 answered on 12 May 2011
3 answers
337 views
Hi every one,

I want the grid bound column value when it is in edit mode
Here is my code.....In the following code the SERVICETYPE Grid boun colim is editable text box.When the user enters  some value to update it I need to get the text the user entered and validate it


<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ServiceType.ascx.cs" Inherits="Desktop_Modules_Service_Type_ServiceType" %>
<asp:Panel ID="pnlCompanyType" runat="server">
    
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

            <script type="text/javascript">
                function RowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
            </script>

        </telerik:RadCodeBlock>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rgServiceType">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgServiceType" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />     
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"></telerik:RadWindowManager>
        <br />       
        <telerik:RadGrid ID="rgServiceType" runat="server" DataSourceID="sdsServiceType"  Skin="Outlook" Width="97%"
            ShowStatusBar="True" AllowSorting="True" PageSize="10" GridLines="None" AllowPaging="True"
            AllowAutomaticUpdates="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
            OnItemUpdated="rgCompanyType_ItemUpdated" OnItemDeleted="rgCompanyType_ItemDeleted"
            OnItemInserted="rgCompanyType_ItemInserted" OnDataBound="rgCompanyType_DataBound" AutoGenerateColumns="False">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="nSERVICEID,nSERVICETYPE"
                DataSourceID="sdsServiceType" HorizontalAlign="NotSet" EditMode="InPlace">
              <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                        <ItemStyle/>
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn UniqueName="SERVICEID" DataField="nSERVICEID" HeaderText="SERVICEID" ReadOnly="True" HeaderStyle-Width="10%" />
                    <telerik:GridBoundColumn DataField="nSERVICETYPE" HeaderText="SERVICETYPE" SortExpression="nSERVICETYPE"
                        UniqueName="SERVICETYPE" ColumnEditorID="GridTextBoxColumnEditor1">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                        UniqueName="DeleteColumn">
                        <ItemStyle HorizontalAlign="Center"/>
                    </telerik:GridButtonColumn>
              </Columns>
              <EditFormSettings ColumnNumber="2" CaptionDataField="SEVICETYPE" CaptionFormatString="Edit Company {0}" InsertCaption="New SERVICETYPE">
                   <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                    <FormCaptionStyle></FormCaptionStyle>
                    <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                        Width="100%" />
                    <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                    <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                    <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record"
                        UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                    </EditColumn>
                    <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <ClientEvents  OnRowDblClick="RowDblClick" />
            </ClientSettings>
        </telerik:RadGrid>
        <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="180px" />
        <br />
        <asp:Label ID="lblMessage" runat="server" EnableViewState="false" />
        <br />
        <asp:SqlDataSource ID="sdsServiceType" runat="server"
            ConnectionString="<%$ ConnectionStrings:DotNetNukeConnectionString2 %>"
            SelectCommand="sp_ServiceTypeSelect" SelectCommandType="StoredProcedure"
            DeleteCommand="sp_ServiceTypeDelete" DeleteCommandType="StoredProcedure"
            InsertCommand="sp_ServiceTypeInsert" InsertCommandType="StoredProcedure"  
            UpdateCommand="sp_ServiceTypeUpdate" UpdateCommandType="StoredProcedure">
            <DeleteParameters>
                <asp:Parameter Name="nSERVICEID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="nSERVICEID" Type="Int32" />
                <asp:Parameter Name="nSERVICETYPE" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="nSERVICETYPE" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>

        
        <!-- content end -->

</asp:Panel>


Please help me thanks
Mira
Telerik team
 answered on 12 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?