Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
55 views
 when i change the server date to 2007 and press F5 the total page all rad controls  collapsed (alignment issue ) but it's working fine for current date
GaneshBabu
Top achievements
Rank 1
 asked on 05 Dec 2011
3 answers
132 views
I have created a custom ascx control that has a multiple column combo box in it. I have noticed that when the list of items is longer than the max dropdown length the vertical scroll bar will shift to the right when the cursor is placed in the list. This is my code:

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="radCBOLookup.ascx.vb"
    Inherits="HEW.radCBOLookup" %>
<telerik:RadComboBox ID="radCBOLookup" runat="server" MarkFirstMatch="true" AllowCustomText="false"
    Width="50px" DropDownWidth="350px" MaxHeight="300px" NoWrap="true" HighlightTemplatedItems="true"
    ExpandDirection="Down">
    <HeaderTemplate>
        <table style="width: 100%; text-align: left; font-size: 8pt">
            <tr>
                <td style="width: 20%;">
                    Code
                </td>
                <td style="width: 80%;">
                    Description
                </td>
            </tr>
        </table>
    </HeaderTemplate>
    <ItemTemplate>
        <table style="width: 100%; text-align: left; font-size: 8pt">
            <tr>
                <td style="width: 20%;">
                    <%#DataBinder.Eval(Container.DataItem, "Master_Type_Code")%>
                </td>
                <td style="width: 80%;">
                    <%#DataBinder.Eval(Container.DataItem, "Master_Desc")%>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</telerik:RadComboBox>

The attached jpg shows the scroll bar position before and after the cursor is placed in the combo box. The first row contains a blank record, which also shows up as a partial height to the actual items with data. Any explanation for the shifting scroll bar?
Ivana
Telerik team
 answered on 05 Dec 2011
6 answers
138 views
I have placed a Radgrid on my page which is a 2 level grid. One masterView and a detail view. I have and edit function on the detail view, which of cause then switches an Item to be on edit mode. This works perfectly and I can catch the update event a update stuff in my database.

But when ever i go to edit mode, black lines appears in my two tables I have in my edititemtemplate
. You can see the images i have attached to this topic what i mean.

Here is the edititemtemplate
so you can see that I haven't set the lines to appear.

<EditItemTemplate>
    <table style="width: 740; border: 0px solid White;">
        <tr>
            <td style="font-weight: bold;">
                Hostname:
            </td>
            <td style="width: 300px">
                <asp:TextBox runat="server" ID="hostname" />
            </td>
            <td style="font-weight: bold;">
                Alias:
            </td>
            <td>
                <asp:TextBox runat="server" ID="alias" />
            </td>
        </tr>
        <tr>
            <td style="font-weight: bold;">
                IP adress:
            </td>
            <td>
                <asp:TextBox runat="server" ID="ip" />
            </td>
            <td>
            </td>
            <td>
            </td>
        </tr>
    </table>
    <table style="width: 740; border: 0px solid White;">
        <tr>
            <td style="font-weight: bold;">
                Description:
            </td>
        </tr>
        <tr>
            <td>
                <telerik:RadEditor runat="server" ID="telerikDesription" ToolsFile="/telerikEditorToolsTiny.xml"
                    Height="250">
                    <Modules>
                    </Modules>
                </telerik:RadEditor>
            </td>
        </tr>
        <tr>
            <td style="font-weight: bold;">
                Comments (Private field for FC):
            </td>
        </tr>
        <tr>
            <td>
                <asp:TextBox runat="server" ID="comments" />
            </td>
        </tr>
    </table>
</EditItemTemplate>

It's not browser related, cause I tested on 4 different kinds, same result.
So why does the lines appear? Anyone have an idea? 

- Rune
Rune
Top achievements
Rank 1
 answered on 05 Dec 2011
8 answers
93 views
Please see the following link to reproduce the issue:

http://test.courseacademy.com/itil-training.aspx

if you select either 'download voucher' or 'make an enquiry' a panel is opened with a form on it.

There are some required fields shown which are validated via a radinputmanager, but if you click into the fields the empty message text does not disappear. If you trace it through using firebug, you see this error when it try's to do an ajax post back when first opening the panel.

An invalid or illegal string was specified
[Break On This Error] }l.insertRule(d[b]+"}",b+1); 


Here is the mark up of the page

    <div id="frm-voucher">
        <asp:HiddenField ID="OfferCourseName" runat="server" Value="ITIL Training Voucher" />
        <asp:RadioButton ID="optVoucher" class="optVoucher" OnCheckedChanged="EnquiryTypeChanged" AutoPostBack="True" GroupName="EnquiryType" Text="Download voucher" runat="server" />
        <asp:Panel ID="pnlVoucher" runat="server" Visible="false" CssClass="frm-voucher">
            <p>To download your voucher, please fill in your details below:</p>
            <div class="line">
                <label>Name <span class="req">*</span></label>
                <asp:TextBox ID="vchName" Width="400" ValidationGroup="vchFrm" runat="server"></asp:TextBox>
            </div>
            <div class="line">
                <label>Company  </label>
                <asp:TextBox ID="vchCompany" Width="400" ValidationGroup="vchFrm" runat="server"></asp:TextBox>
            </div>
            <div class="line">
                <label>Email <span class="req">*</span></label>
                <asp:TextBox ID="vchEmail" Width="400" ValidationGroup="vchFrm" runat="server"></asp:TextBox>
            </div>
            <div class="line">
                <label>Telephone <span class="req">*</span></label>
                <asp:TextBox ID="vchTelephone" Width="400" ValidationGroup="vchFrm" runat="server"></asp:TextBox>
            </div>
            <div class="line">
                <label>Enquiry details  </label>
                <asp:TextBox ID="vchEnquiry" Width="400" Height="70" TextMode="MultiLine" ValidationGroup="vchFrm" runat="server" ></asp:TextBox>
            </div>
            <div class="linebtn">
                <asp:ImageButton ID="vchBtnSubmit" ImageUrl="/images/btn-submit-yellow.gif" ValidationGroup="vchFrm" runat="server" />
                <p>Fields marked with <span class="req">*</span> are mandatory.</p>
            </div>
        </asp:Panel>
        <asp:Panel ID="pnlVoucherThanks" runat="server" Visible="false" CssClass="frm-voucher">
            <p>Thank you for downloading your voucher. It will be sent to you by email shortly.</p>
        </asp:Panel>
        <asp:RadioButton ID="optGeneral" class="optGeneral" OnCheckedChanged="EnquiryTypeChanged" AutoPostBack="True" GroupName="EnquiryType" Text="Make a general enquiry" runat="server" />
        <asp:Panel ID="pnlGeneral" runat="server" Visible="false" CssClass="frm-general">
            <p>To download your voucher, please fill in your details below:</p>
            <div class="line">
                <label>Name <span class="req">*</span></label>
                <asp:TextBox ID="genName" Width="400" ValidationGroup="genFrm" runat="server"></asp:TextBox>
            </div>
            <div class="line">
                <label>Company  </label>
                <asp:TextBox ID="genCompany" Width="400" ValidationGroup="genFrm" runat="server"></asp:TextBox>
            </div>
            <div class="line">
                <label>Email <span class="req">*</span></label>
                <asp:TextBox ID="genEmail" Width="400" ValidationGroup="genFrm" runat="server"></asp:TextBox>
            </div>
            <div class="line">
                <label>Telephone <span class="req">*</span></label>
                <asp:TextBox ID="genTelephone" Width="400" ValidationGroup="genFrm" runat="server"></asp:TextBox>
            </div>
            <div class="line">
                <label>Enquiry details  </label>
                <asp:TextBox ID="genEnquiry" Width="400" Height="70" TextMode="MultiLine" ValidationGroup="genFrm" runat="server" ></asp:TextBox>
            </div>
            <div class="linebtn">
                <asp:ImageButton ID="genBtnSubmit" ImageUrl="/images/btn-submit-yellow.gif" ValidationGroup="genFrm" runat="server" />
                <p>Fields marked with <span class="req">*</span> are mandatory.</p>
            </div>
        </asp:Panel>
        <asp:Panel ID="pnlGeneralThanks" runat="server" Visible="false" CssClass="frm-general">
            <p>Thank you for making your enquiry. We will reply to you shortly.</p>
        </asp:Panel>
    </div>
    <p>This rate applies to 5 day scheduled courses only and cannot be used in conjunction with other offers. All courses subject to availability.</p>
</div>


Heres the Radinput manager mark up

<telerik:RadInputManager ID="RadInputManager1" runat="server">
    <telerik:TextBoxSetting Validation-ValidationGroup="genFrm" BehaviorID="genTxtBxBhv" EmptyMessage="Required Field" Validation-IsRequired="true">
        <TargetControls>
            <telerik:TargetInput ControlID="genName" />
            <telerik:TargetInput ControlID="genEmail" />
            <telerik:TargetInput ControlID="genTelephone" />
        </TargetControls>
    </telerik:TextBoxSetting>
    <telerik:TextBoxSetting Validation-ValidationGroup="genFrm" BehaviorID="genTxtBxBhv2" Validation-IsRequired="false">
        <TargetControls>
            <telerik:TargetInput ControlID="genCompany" />
            <telerik:TargetInput ControlID="genEnquiry" />
        </TargetControls>
    </telerik:TextBoxSetting>
 
    <telerik:TextBoxSetting Validation-ValidationGroup="vchFrm" BehaviorID="vchTxtBxBhv" EmptyMessage="Required Field" Validation-IsRequired="true">
        <TargetControls>
            <telerik:TargetInput ControlID="vchName" />
            <telerik:TargetInput ControlID="vchEmail" />
            <telerik:TargetInput ControlID="vchTelephone" />
        </TargetControls>
    </telerik:TextBoxSetting>
    <telerik:TextBoxSetting Validation-ValidationGroup="vchFrm" BehaviorID="vchTxtBxBhv2" Validation-IsRequired="false">
        <TargetControls>
            <telerik:TargetInput ControlID="vchCompany" />
            <telerik:TargetInput ControlID="vchEnquiry" />
        </TargetControls>
    </telerik:TextBoxSetting>
</telerik:RadInputManager>


Heres the page load event as the script manager and ajax manager are all used on the master page above

Dim AjaxManager As RadAjaxManager = CType(Me.Master.FindControl("RadAjaxManager1"), RadAjaxManager)
        Dim RadAjaxLoadingPanel1 As RadAjaxLoadingPanel = CType(Me.Master.FindControl("RadAjaxLoadingPanel1"), RadAjaxLoadingPanel)
 
        AjaxManager.AjaxSettings.AddAjaxSetting(optVoucher, optGeneral)
        AjaxManager.AjaxSettings.AddAjaxSetting(optVoucher, pnlVoucher, RadAjaxLoadingPanel1)
        AjaxManager.AjaxSettings.AddAjaxSetting(optVoucher, pnlVoucherThanks)
        AjaxManager.AjaxSettings.AddAjaxSetting(optVoucher, pnlGeneral)
        AjaxManager.AjaxSettings.AddAjaxSetting(optVoucher, pnlGeneralThanks)
 
        AjaxManager.AjaxSettings.AddAjaxSetting(optGeneral, optVoucher)
        AjaxManager.AjaxSettings.AddAjaxSetting(optGeneral, pnlVoucher)
        AjaxManager.AjaxSettings.AddAjaxSetting(optGeneral, pnlVoucherThanks)
        AjaxManager.AjaxSettings.AddAjaxSetting(optGeneral, pnlGeneral, RadAjaxLoadingPanel1)
        AjaxManager.AjaxSettings.AddAjaxSetting(optGeneral, pnlGeneralThanks)
 
        AjaxManager.AjaxSettings.AddAjaxSetting(vchBtnSubmit, pnlVoucher)
        AjaxManager.AjaxSettings.AddAjaxSetting(vchBtnSubmit, pnlVoucherThanks, RadAjaxLoadingPanel1)
 
        AjaxManager.AjaxSettings.AddAjaxSetting(genBtnSubmit, pnlGeneral)
        AjaxManager.AjaxSettings.AddAjaxSetting(genBtnSubmit, pnlGeneralThanks, RadAjaxLoadingPanel1)


Any ideas or fixes please?
Jon
Top achievements
Rank 2
Veteran
 answered on 05 Dec 2011
1 answer
130 views
Hi Team ,

I have a dropdown list in the Item Teplate of a RadList box . It is enabled and works fine in IE but it is  not working in Google Chrome .
I am not even able to select an item from the dropdownlist.

Please reply me as soon as possible .

Thanks
Radhika
Princy
Top achievements
Rank 2
 answered on 05 Dec 2011
1 answer
85 views
I have a grid which I tooltipify using tooltipmanager. These controls reside in a UserControl, which is in turn placed in a panel on my page. I ajaxify the panel using RadajaxManager. I am running into the problem of the ToolTipManager's OnAjax Update getting screwed up because I assume this scenario causes nested update panels to be rendered. The reason I ajaxify the panel is because it contains other controls which I would like to update through ajax when a certain button is clicked on the page, and primarily, because I would like a loading image to display over the whole panel and its controls, not just the grid. Now, I have managed to get this to work by exposing the grid and tootipmanager as properties of the usercontrol, and ajaxifying these directly. In this way, I am able to avoide the nested update panels and the tooltipmanager works fine. However, its not exactly the interface I'm looking for. In this case, the loading panel only appears over the grid. I have read some forum posts regarding conditional updating and I'm not sure if that would help in my scenario, or if its possible with RadAjaxManager. Can anyone make any suggestions about how to get tooltipmanager in an ajaxified panel to work properly?
Marin Bratanov
Telerik team
 answered on 05 Dec 2011
1 answer
78 views
Hello,

We have a optimization problem regarding rad dock controls. The requirement of project is such that we are creating dynamic raddocks on the fly and adding it to a raddockzone, then we are saving the raddock "type" etc in a mssql db. We also have a collector window/raddockzone in which we have build a functionality where we can drag a dock and save it in collector. As with the first raddockzone we are adding the dock in collector on the fly. Now while adding a dock or moving it to another raddockzones it takes sometime. Our client is comparing it with the example of the demo link : http://demos.telerik.com/aspnet-ajax/dock/examples/content/defaultcs.aspx 

Following is our code snippet to add dock on the fly:

    private RadDockNew CreateRadDock()
    {


        //string[] allowedZones = { "RDZCollector", "RadDockZone2" };
        int width = Convert.ToInt32((hdnWidth.Value == "") ? "520" : hdnWidth.Value);
        RadDockNew dock = new RadDockNew();
        dock.DockMode = DockMode.Docked;
        dock.UniqueName = Guid.NewGuid().ToString().Replace("-", "a");
        dock.ID = string.Format("RadDock{0}", dock.UniqueName);
        //dock.Title = dock.UniqueName.Substring(dock.UniqueName.Length - 3);
        dock.Width = Unit.Pixel(width);
        dock.CssClass = "RadDockZoneMain";
        //dock.AllowedZones = allowedZones;
        dock.Style.Add("min-height", "290px");
        dock.OnClientDockPositionChanged = "DropInCollector";
        //dock.EnableViewState = false;
        DockCommand cmd = new DockCommand();
        cmd.Name = "Setting";
        cmd.Text = "Setting";
        cmd.OnClientCommand = "showSettings";
        dock.Commands.Add(cmd);
        DockCommand dc = new DockCommand();
        dc.Text = "Trash";
        dc.Name = "Trash";
        dc.OnClientCommand = "CloseDock";
        dc.CssClass = "rdClose";
        dc.AutoPostBack = true;
        dock.Commands.Add(dc);
        DockToggleCommand cmd2 = new DockToggleCommand();
        cmd2.CssClass = "rdCollapse";
        cmd2.AlternateCssClass = "rdexpand";
        cmd2.OnClientCommand = "ChangeImage";


        //DockCommand collapse = new DockCommand();
        //collapse.Text = "Collapse/Expand";
        //collapse.Name = "Collapse/Expand";
        //collapse.OnClientCommand = "CollapseDock";
        //collapse.CssClass = "rdCollapse";
        dock.Commands.Add(cmd2);
        return dock;
    }

Please tell if there is any way to optimize / make it faster.

Thanks.
  
Slav
Telerik team
 answered on 05 Dec 2011
2 answers
122 views
Hi,

I've a radtabstrip with three radtab and three radmultipage. The problem is on the event textchanged for a radtextbox located on the first radmultipage. On textchanged of this radtextbox, I fill another radtextboxes of the same radmultipage. Once the radtextboxes are filled with the values, if I put the mouse over the radtextboxes these radtextboxes increase. I've also a radskinmanager and if I change the skin, all the radtextboxes become ok and the mouse over has no effect. I attach a picture with the three situations: the initial form, the form with the radtextboxes bigger and the form with a new skin applied. If I remove the radmultipage from the ajaxupdatedcontrol of the radajaxmanager, the radtextboxes don't change on mouse over. I put the code with only one radtab and only one radmultipage because the problem is the same. How can I solve this?

Thanks in advance.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default_test.aspx.vb" Inherits="_Default_test" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title>Ofertas Rittal</title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</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>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    </telerik:RadCodeBlock>
    <label style="font-family: Calibri; font-size: small; font-weight: 700; height: 32px;">Skin:</label>
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" ShowChooser="True"
        Skin="Windows7">
    </telerik:RadSkinManager>
           
    <telerik:RadButton ID="RadButton1" runat="server" Text="Guardar preferencias">
    </telerik:RadButton>
    <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all"></telerik:RadFormDecorator>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
    <div>
        <br />
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server"
            MultiPageID="RadMultiPage1" Height="26px" Width="500px" SelectedIndex="1">
            <Tabs>
                <telerik:RadTab runat="server" PageViewID="RadPageView1"
                    Text="Cabecera">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPage1" Runat="server"
            Height="64px" Width="500px" SelectedIndex="0" Font-Names="Calibri"
            Font-Size="Small">
            <telerik:RadPageView ID="RadPageView1" runat="server" BorderStyle="Outset">
                <div class="inputs">
                    <br />
                    <telerik:RadTextBox ID="RadTextBox5" Runat="server" ReadOnly="True"
                        Text="Cliente:"
                        Width="75px" Font-Bold="True" Font-Names="Calibri" Font-Size="Small"
                        BorderWidth="0px" BackColor="Transparent" BorderColor="Transparent"
                        TabIndex="-1">
                    </telerik:RadTextBox>
                    <telerik:RadMaskedTextBox ID="TB_Cod_cliente" Runat="server" Mask="########"
                        Width="60px" AutoPostBack="True">
                    </telerik:RadMaskedTextBox>
                    <telerik:RadTextBox ID="TB_Company" Runat="server"
                        Width="300px">
                    </telerik:RadTextBox>
 
                    <br />
                    <br />
                    <telerik:RadTextBox ID="RadTextBox6" Runat="server" ReadOnly="True"
                        style="font-family: Calibri; font-weight: 700" Text="Dirección:"
                        Width="75px" Font-Bold="True" Font-Names="Calibri" Font-Size="Small"
                        BorderWidth="0px" BackColor="Transparent" TabIndex="-1">
                    </telerik:RadTextBox>
                    <telerik:RadTextBox ID="TB_Address1" Runat="server"
                        Width="365px">
                    </telerik:RadTextBox>
 
                    <br />
                    <telerik:RadTextBox ID="RadTextBox7" Runat="server" ReadOnly="True"
                        style="font-family: Calibri; font-weight: 700" Text=""
                        Width="75px" Font-Bold="True" Font-Names="Calibri" Font-Size="Small"
                        BorderWidth="0px" BackColor="Transparent" TabIndex="-1">
                    </telerik:RadTextBox>
 
                    <telerik:RadTextBox ID="TB_Address2" Runat="server"
                        Width="365px">
                    </telerik:RadTextBox>
 
                    <br />
                    <br />
                    <telerik:RadTextBox ID="RadTextBox8" Runat="server" ReadOnly="True"
                        style="font-family: Calibri; font-weight: 700" Text="Cód. postal:"
                        Width="75px" Font-Bold="True" Font-Names="Calibri" Font-Size="Small"
                        BorderWidth="0px" BackColor="Transparent" TabIndex="-1">
                    </telerik:RadTextBox>
                    <telerik:RadMaskedTextBox ID="TB_Zip" Runat="server" Mask="#####"
                        Width="35px">
                    </telerik:RadMaskedTextBox>
                         
                    <telerik:RadTextBox ID="RadTextBox4" Runat="server" ReadOnly="True"
                        style="font-family: Calibri; font-weight: 700" Text="Población:"
                        Width="65px" Font-Bold="True" Font-Names="Calibri" Font-Size="Small"
                        BorderWidth="0px" BackColor="Transparent" TabIndex="-1">
                    </telerik:RadTextBox>
 
                    <telerik:RadTextBox ID="TB_City" Runat="server"
                        Width="240px">
                    </telerik:RadTextBox>
 
                    <br />
                    <br />
                    <telerik:RadTextBox ID="RadTextBox10" Runat="server" ReadOnly="True"
                        style="font-family: Calibri; font-weight: 700" Text="Provincia:"
                        Width="75px" Font-Bold="True" Font-Names="Calibri" Font-Size="Small"
                        BorderWidth="0px" BackColor="Transparent" TabIndex="-1">
                    </telerik:RadTextBox>
                    <telerik:RadComboBox ID="DD_State" runat="server" DataSourceID="Provincias"
                        DataTextField="descripcion" DataValueField="descripcion">
                    </telerik:RadComboBox>
                       
                    <telerik:RadTextBox ID="RadTextBox17" Runat="server" ReadOnly="True"
                        style="font-family: Calibri; font-weight: 700" Text="Contacto:"
                        Width="70px" Font-Bold="True" Font-Names="Calibri" Font-Size="Small"
                        BorderWidth="0px" BackColor="Transparent" TabIndex="-1">
                    </telerik:RadTextBox>
                    <telerik:RadComboBox ID="DD_Contacto" runat="server" AutoPostBack="True">
                    </telerik:RadComboBox>
                    <br />
                    <br />
                    <hr width="490px" />
                    <br />
                </div>
            </telerik:RadPageView>
 
        </telerik:RadMultiPage>
        <asp:SqlDataSource ID="Provincias" runat="server"
            ConnectionString="<%$ ConnectionStrings:OfflineEDConnectionString %>"
            SelectCommand="SELECT UPPER([descripcion]) AS descripcion FROM [Provincias_Lov_Informes] ORDER BY [descripcion]">
        </asp:SqlDataSource>
 
    </div>
    </form>
</body>
</html>

Imports Telerik.Web.UI
Imports System.Data.SqlClient
Imports System.Data
 
Partial Class _Default_test
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            retreive_preferences()
        End If
    End Sub
    Protected Sub TB_Cod_cliente_TextChanged(sender As Object, e As System.EventArgs) Handles TB_Cod_cliente.TextChanged
        load_company_data(TB_Cod_cliente.Text)
    End Sub
    Protected Sub load_company_data(ByVal cod_cli As String)
        If cod_cli.Length > 0 Then
            RadTabStrip1.SelectedIndex = 0
            RadMultiPage1.SelectedIndex = 0
 
            Dim conn As New SqlConnection()
            conn.ConnectionString = ConfigurationManager.ConnectionStrings("OfflineEDConnectionString").ConnectionString
 
            Dim cmd As New SqlCommand
            cmd.CommandType = CommandType.Text
            cmd.CommandText = "SELECT company_name,address_1,address_2,zip,city,State_ from company where cod_cliente=@cod_cliente"
            cmd.Connection = conn
            ' Create a SqlParameter for each parameter in the stored procedure.
            Dim codclienteParam As New SqlParameter("@cod_cliente", cod_cli)
            cmd.Parameters.Add(codclienteParam)
 
            Dim found As Boolean = False
            Dim reader As SqlDataReader
            Dim previousConnectionState As ConnectionState = conn.State
            Try
                If conn.State = ConnectionState.Closed Then
                    conn.Open()
                End If
                reader = cmd.ExecuteReader()
                Using reader
                    While reader.Read
                        ' Process SprocResults datareader here.
                        TB_Company.Text = reader.GetValue(0).ToString
                        TB_Address1.Text = reader.GetValue(1).ToString
                        TB_Address2.Text = reader.GetValue(2).ToString
                        TB_Zip.Text = reader.GetValue(3).ToString
                        TB_City.Text = reader.GetValue(4).ToString
                        DD_State.SelectedValue = reader.GetValue(5).ToString
                        found = True
                    End While
                End Using
            Finally
                If previousConnectionState = ConnectionState.Closed Then
                    conn.Close()
                End If
            End Try
 
            If found = False Then
                DD_Contacto.DataSource = CreateDataSource(cod_cli)
                DD_Contacto.DataTextField = "nombre_completo"
                DD_Contacto.DataValueField = "contact_id_text"
                DD_Contacto.DataBind()
            End If
        End If
    End Sub
    Function CreateDataSource(ByVal cod_cliente As String) As ICollection
        Dim dt As New DataTable
        Dim dr As DataRow
 
        dt.Columns.Add(New DataColumn("contact_id_text", GetType(String)))
        dt.Columns.Add(New DataColumn("nombre_completo", GetType(String)))
 
        dr = dt.NewRow()
        dr(0) = "-1"
        dr(1) = ""
        dt.Rows.Add(dr)
 
        dr = dt.NewRow()
        dr(0) = "0"
        dr(1) = "_Nuevo registro_"
        dt.Rows.Add(dr)
 
        Dim conn As New SqlConnection()
        conn.ConnectionString = ConfigurationManager.ConnectionStrings("OfflineEDConnectionString").ConnectionString
 
        Dim cmd As New SqlCommand
        cmd.CommandType = CommandType.Text
        cmd.CommandText = "SELECT contact_id_text,full_name from contact where cod_cliente=@cod_cliente"
        cmd.Connection = conn
        ' Create a SqlParameter for each parameter in the stored procedure.
        Dim codclienteParam As New SqlParameter("@cod_cliente", cod_cliente)
        cmd.Parameters.Add(codclienteParam)
 
        Dim found As Boolean = False
        Dim reader As SqlDataReader
        Dim previousConnectionState As ConnectionState = conn.State
        Try
            If conn.State = ConnectionState.Closed Then
                conn.Open()
            End If
            reader = cmd.ExecuteReader()
            Using reader
                While reader.Read
                    ' Process SprocResults datareader here.
                    dr = dt.NewRow()
                    dr(0) = reader.GetValue(0).ToString
                    dr(1) = reader.GetValue(1).ToString
                    Try
                        dt.Rows.Add(dr)
                    Catch ex As Exception
                    End Try
                End While
            End Using
        Finally
            If previousConnectionState = ConnectionState.Closed Then
                conn.Close()
            End If
        End Try
 
        Dim dv As New DataView(dt)
        dv.Sort = "nombre_completo"
        Return dv
    End Function
 
 
    Protected Sub RadButton1_Click(sender As Object, e As System.EventArgs) Handles RadButton1.Click
        Dim usuario As String = Context.Request.ServerVariables("AUTH_USER")
        If usuario.Split("\").Count > 1 Then
            usuario = usuario.Split("\")(1)
        End If
 
        If usuario.Length > 0 Then
            Dim conn As New SqlConnection()
            conn.ConnectionString = ConfigurationManager.ConnectionStrings("OfertasConnectionString").ConnectionString
 
            Dim cmd As New SqlCommand
            cmd.CommandType = CommandType.Text
            cmd.CommandText = "SELECT count(*) from Preferencias where usuario=@usuario"
            cmd.Connection = conn
            ' Create a SqlParameter for each parameter in the stored procedure.
            Dim userParam As New SqlParameter("@usuario", usuario)
            cmd.Parameters.Add(userParam)
 
            Dim found As Integer = 0
            Dim reader As SqlDataReader
            Dim previousConnectionState As ConnectionState = conn.State
            Try
                If conn.State = ConnectionState.Closed Then
                    conn.Open()
                End If
                reader = cmd.ExecuteReader()
                Using reader
                    While reader.Read
                        ' Process SprocResults datareader here.
                        found = reader.GetValue(0).ToString
                    End While
                End Using
            Finally
                If previousConnectionState = ConnectionState.Closed Then
                    conn.Close()
                End If
            End Try
 
            If found = 0 Then
                insert_preferences(usuario, "skin", RadSkinManager1.Skin)
            Else
                update_preferences(usuario, "skin", RadSkinManager1.Skin)
            End If
        End If
    End Sub
 
    Protected Sub update_preferences(ByVal username As String, ByVal field As String, ByVal value As String)
        Dim conn As New SqlConnection()
        conn.ConnectionString = ConfigurationManager.ConnectionStrings("OfertasConnectionString").ConnectionString
 
        Dim cmd As New SqlCommand
        cmd.CommandType = CommandType.Text
        cmd.CommandText = "update preferencias set " + field + "=@value where usuario=@usuario"
        cmd.Connection = conn
        ' Create a SqlParameter for each parameter in the stored procedure.
        Dim valueParam As New SqlParameter("@value", value)
        cmd.Parameters.Add(valueParam)
 
        Dim userParam As New SqlParameter("@usuario", username)
        cmd.Parameters.Add(userParam)
 
        Dim rowCount As Integer
        Dim previousConnectionState As ConnectionState
        previousConnectionState = conn.State
        Try
            If conn.State = ConnectionState.Closed Then
                conn.Open()
            End If
            rowCount = cmd.ExecuteNonQuery()
        Finally
            If previousConnectionState = ConnectionState.Closed Then
                conn.Close()
            End If
        End Try
 
        If rowCount = 0 Then
            RadWindowManager1.RadAlert("Error al guardar las preferencias", 330, 100, "Error!", "alertCallBackFn")
        Else
            RadWindowManager1.RadAlert("Preferencias guardadas correctamente", 330, 100, "Ok", "alertCallBackFn")
        End If
    End Sub
    Protected Sub insert_preferences(ByVal username As String, ByVal field As String, ByVal value As String)
        Dim conn As New SqlConnection()
        conn.ConnectionString = ConfigurationManager.ConnectionStrings("OfertasConnectionString").ConnectionString
 
        Dim cmd As New SqlCommand
        cmd.CommandType = CommandType.Text
        cmd.CommandText = "insert into preferencias (usuario," + field + ") values (@usuario,@value)"
        cmd.Connection = conn
        ' Create a SqlParameter for each parameter in the stored procedure.
        Dim valueParam As New SqlParameter("@value", value)
        cmd.Parameters.Add(valueParam)
 
        Dim userParam As New SqlParameter("@usuario", username)
        cmd.Parameters.Add(userParam)
 
        Dim rowCount As Integer
        Dim previousConnectionState As ConnectionState
        previousConnectionState = conn.State
        Try
            If conn.State = ConnectionState.Closed Then
                conn.Open()
            End If
            rowCount = cmd.ExecuteNonQuery()
        Finally
            If previousConnectionState = ConnectionState.Closed Then
                conn.Close()
            End If
        End Try
 
        If rowCount = 0 Then
            RadWindowManager1.RadAlert("Error al guardar las preferencias", 330, 100, "Error!", "alertCallBackFn")
        Else
            RadWindowManager1.RadAlert("Preferencias guardadas correctamente", 330, 100, "Ok", "alertCallBackFn")
        End If
    End Sub
 
    Protected Sub retreive_preferences()
        Dim usuario As String = Context.Request.ServerVariables("AUTH_USER")
        If usuario.Split("\").Count > 1 Then
            usuario = usuario.Split("\")(1)
        End If
 
        If usuario.Length > 0 Then
            Dim conn As New SqlConnection()
            conn.ConnectionString = ConfigurationManager.ConnectionStrings("OfertasConnectionString").ConnectionString
 
            Dim cmd As New SqlCommand
            cmd.CommandType = CommandType.Text
            cmd.CommandText = "SELECT skin from Preferencias where usuario=@usuario"
            cmd.Connection = conn
            ' Create a SqlParameter for each parameter in the stored procedure.
            Dim userParam As New SqlParameter("@usuario", usuario)
            cmd.Parameters.Add(userParam)
 
            Dim skin As String = ""
            Dim reader As SqlDataReader
            Dim previousConnectionState As ConnectionState = conn.State
            Try
                If conn.State = ConnectionState.Closed Then
                    conn.Open()
                End If
                reader = cmd.ExecuteReader()
                Using reader
                    While reader.Read
                        ' Process SprocResults datareader here.
                        skin = reader.GetValue(0).ToString
                    End While
                End Using
            Finally
                If previousConnectionState = ConnectionState.Closed Then
                    conn.Close()
                End If
            End Try
 
            If skin.Length > 0 Then
                RadSkinManager1.Skin = skin
            End If
        End If
    End Sub
End Class
David
Top achievements
Rank 1
 answered on 05 Dec 2011
1 answer
27 views

Hello Telerik Team,

I want to use the schedulder in a such that all the days of the month comes column wise and rooms in the row wise

I have attached an excel file which shows my requirement.

Is there any way to achive this?

Thanks in advance.

Ivana
Telerik team
 answered on 05 Dec 2011
1 answer
69 views
I created a RadControlsWebSite from Visual Studio. 
<%@ 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">
 
 
<head runat="server">
    <title></title>
    <link href="Styles/StyleSheet1.css" type="text/css" rel="Stylesheet"  />
            
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
    <script type="text/javascript">
        function ensureSomethingSelected(source, eventargs) {
            var dropDown = $find("<%=rcb1.ClientID %>");
 
            if (dropDown.get_text() != null && dropDown.get_text() != dropDown.get_emptyMessage()) {
                args.IsValid = true;
            }
        }
     
    </script>
</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>
     
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
     
    </telerik:RadAjaxManager>
 
 
 
<div id="cont1">
 
    <h1>SouthWinds Mfg.</h1>
    <div style="overflow:auto;">
        <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
    </div>
    <hr />
    <div id="navButtons">
 
        <div style="float:left; width:100px;">
            <asp:Button ID="btnBack" runat="server" Text="Back" CausesValidation="false"  OnClick="btnBack_Click"/>
        </div>
 
        <div style="float:right;width:100px;">
            <asp:Button ID="btnForward" runat="server" Text="Forward" CausesValidation="false" OnClick="btnForward_Click" />
        </div>
 
    </div>
    <hr />
    <div class="class1">
        <asp:Label ID="Label1" runat="server" Text="ID" CssClass="formLabels"></asp:Label>
        <asp:Label ID="lblID" runat="server"></asp:Label>
    </div>
    <div class="class1">
    <asp:Label ID="Label2" runat="server" AssociatedControlID="txt2" Text="MFG NO" CssClass="formLabels"></asp:Label>
        <asp:TextBox ID="txt2" runat="server"></asp:TextBox>
    </div>
    <div class="class1">
    <asp:Label ID="Label3" runat="server" AssociatedControlID="txt3" Text="PART NO" CssClass="formLabels"></asp:Label>        <asp:TextBox ID="txt3" runat="server"></asp:TextBox>
    </div>
    <div class="class1">
        <asp:Label ID="Label4" runat="server" AssociatedControlID="txt4" Text="DESCR" CssClass="formLabels"></asp:Label>
     <asp:TextBox ID="txt4" runat="server"></asp:TextBox>
    </div>
    <div class="class1">If you do not see your parent, please type it in:</div>
 
    <div id="cont0">
    <telerik:RadAjaxPanel ID="rap1" runat="server">
        <telerik:RadComboBox ID="rcb1" runat="server"                
                ClientIDMode="Static"
                EnableLoadOnDemand="true"
                EnableVirtualScrolling="true"               
                ShowMoreResultsBox="true"
                OnItemsRequested="rcb1_ItemsRequested"
                Width="200" >                   
        </telerik:RadComboBox>
    </telerik:RadAjaxPanel>
    </div>
    <div style="float:none;">
        <asp:CustomValidator ID="cv1" runat="server"
            ValidateEmptyText="true"           
            ControlToValidate="rcb1"     
            EnableClientScript="true"     
            ClientValidationFunction="ensureSomethingSelected"
            ErrorMessage="You must select an item!"
            OnServerValidate="rcb1_ServerValidate">           
    </asp:CustomValidator>   
    </div>       
     <div class="buttonBar">
        <asp:Button ID="btn1" runat="server" Text="Save" OnClick="btn1_Click" />
    </form>
</body>
</html>

Here is my code-behind
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
 
public partial class Default : System.Web.UI.Page
{
 
    private const int ItemsPerRequest = 10;
 
    protected void Page_Init(object sender, EventArgs e)
    {
        
    }
     
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadPart();
        }
 
        //***RESET INFORMATION MESSAGES
        lblMessage.Text = "";
 
    }
 
    protected void btn1_Click(object sender, EventArgs e)
    {
        if (IsValid)
        {
             
        }
 
    }
 
    protected void  LoadPart()
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["widConn"].ToString());
        SqlCommand cmd = new SqlCommand("SELECT * FROM PARTS", con);
 
        DataSet ds = new DataSet("dsParts");
 
        DataTable dt = new DataTable("dtParts");
 
        SqlDataAdapter da = new SqlDataAdapter(cmd);
 
        int currIndex = 0;
        ViewState["currIndex"] = currIndex;
 
        using (con)
        {
            con.Open();
 
            da.Fill(ds);
            dt = ds.Tables[0];
 
            ViewState["dtParts"] = dt;
            ViewState["rowCount"] = dt.Rows.Count;
 
            lblID.Text = Convert.ToString(dt.Rows[currIndex][0]);
            txt2.Text = (string)dt.Rows[currIndex][1];
            txt3.Text = (string)dt.Rows[currIndex][2];
            txt4.Text = Convert.ToString(dt.Rows[currIndex][3]);
        }
         
    }
 
    protected void rcb1_ServerValidate(object source, ServerValidateEventArgs args)
    {
        
    }
 
    protected void rcb1_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
    {
        DataTable data = GetData(e.Text);
 
        int itemOffset = e.NumberOfItems;
        int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count);
        e.EndOfItems = endOffset == data.Rows.Count;
 
        for (int i = itemOffset; i < endOffset; i++)
        {
            rcb1.Items.Add(new RadComboBoxItem(data.Rows[i]["FULLY_QUALIFIED_PART_NO"].ToString(), data.Rows[i]["ID"].ToString()));
        }
 
        e.Message = GetStatusMessage(endOffset, data.Rows.Count);
    }
 
 
    private static DataTable GetData(string text)
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["widConn"].ConnectionString);
 
        SqlDataAdapter adapter = new SqlDataAdapter("usp_GetMfgPartsScrolling", con);
        adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
 
        adapter.SelectCommand.Parameters.AddWithValue("@text", text);
 
        DataTable data = new DataTable();
 
        using (con)
        {
            con.Open();
            adapter.Fill(data);
        }
         
 
        return data;
    }
 
    private static string GetStatusMessage(int offset, int total)
    {
        if (total <= 0)
            return "No matches";
 
        return String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", offset, total);
    }
 
 
    protected void btnForward_Click(object sender, EventArgs e)
    {
        DataTable dt = (DataTable)ViewState["dtParts"];
 
        int currIndex = (Int32)ViewState["currIndex"];
        int rowCount = (Int32)ViewState["rowCount"];
 
        if ((currIndex  + 1) < rowCount)
        {
            lblID.Text = Convert.ToString(dt.Rows[currIndex + 1][0]);
            txt2.Text = (string)dt.Rows[currIndex + 1][1];
            txt3.Text = (string)dt.Rows[currIndex + 1][2];
 
            ViewState["currIndex"] = currIndex + 1;
        }
        else
        {
            lblMessage.Text = "You are at the end of the recordset";
        }
    }
 
    protected void btnBack_Click(object sender, EventArgs e)
    {
        DataTable dt = (DataTable)ViewState["dtParts"];
 
        int currIndex = (Int32)ViewState["currIndex"];       
 
        if (currIndex - 1 >=  0)
        {
            lblID.Text = Convert.ToString(dt.Rows[currIndex - 1][0]);
            txt2.Text = (string)dt.Rows[currIndex - 1][1];
            txt3.Text = (string)dt.Rows[currIndex - 1][2];
 
            ViewState["currIndex"] = currIndex - 1;
        }
        else
        {
            lblMessage.Text = "You are at the beginning of the recordset";
        }
    }
 
 
 
   
 
 
 
 
 
}
I get the following error message
Server Error in '/RadControlsWebSite1' Application.
--------------------------------------------------------------------------------


The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). 
Ivana
Telerik team
 answered on 05 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?