Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
66 views
Title says it all really. Enquiring minds need to know. -- Stuart
Richard
Top achievements
Rank 1
 answered on 19 Jan 2012
1 answer
90 views
I have a radeditor,in that i have spans and a background image.I have some html input textboxes,on text changed of the textboxes,i'm binding the text to particular spans like:
<script>
 function txtTitlechanged(x) {
            var y = document.getElementById(x).value
            var editor = $find("<%=RadEditor1.ClientID %>");
            var oDocument = editor.get_document()
            var img = oDocument.getElementById('span1');


            if (y == '') {
                img.innerHTML = 'UserName';
            }
            else {
                img.innerHTML = y;
            }
        }
</script>

<input type='text' onchage="txtTitlechanged" />


Here i want that radeditor content as an image,i'm getting the radeditor content as html,but i want as it as an image.
Rumen
Telerik team
 answered on 19 Jan 2012
7 answers
211 views
I have a thierarchical grid needs to export.

I need to use  grid.ExportSettings.ExportOnlyData = false; becaues I need to keep the dropdown list template for my grid export.

But when export to excel I can see the expand image listed as a grey area in my excel export sheet. If it is a column, I know how to hide, but this doesn't seem to be a column on the grid. How can  I remove the grey expand area?

Thanks

 

Pavlina
Telerik team
 answered on 19 Jan 2012
4 answers
219 views
Hi,

Can you show me how to use RadProgressArea while loading data from a sql server?  Here is my scenario:

I have a RadButton.  when a user click on this button, I have a function call RetrieveData() and this function will connect to a sql database and query about 100,000 records and performing a lot of data manipulation so it will take awhile to produce desire data.

while processing the data, I would like to display like a progress bar so user can see what's going on and wait.  I found the demo here:
http://demos.telerik.com/aspnet-ajax/upload/examples/customprogress/defaultcs.aspx and really like it, but I don't know how to apply it to my scenario.  From the example, it sets the total process = 100, but in my case, my query run can take up to 3 minutes.  Please provide code as possible.  Here is my code behind page:

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //Do not display SelectedFilesCount progress indicator.
            RadProgressArea1.ProgressIndicators &= ~ProgressIndicators.SelectedFilesCount;
        }
  
        RadProgressArea1.Localization.Uploaded = "Total Progress";
        RadProgressArea1.Localization.UploadedFiles = "Progress";
        RadProgressArea1.Localization.CurrentFileName = "Please wait while updating database... ";
    }

protected void RetrieveData()
{
        //using LINQ to SQL to select data
}

private void UpdateProgressContext()
    {
  
        RadProgressContext progress = RadProgressContext.Current;
  
        const int total = 100;
  
        progress.Speed = "N/A";
        for (int i = 0; i < total; i++)
        {
            progress.PrimaryTotal = 1;
            progress.PrimaryValue = 1;
            progress.PrimaryPercent = 100;
  
            progress.SecondaryTotal = total;
            progress.SecondaryValue = i;
            progress.SecondaryPercent = i;
  
            progress.CurrentOperationText = "Step " + i.ToString();
  
            if (!Response.IsClientConnected)
            {
                //Cancel button was clicked or the browser was closed, so stop processing
                break;
            }
  
            progress.TimeEstimated = (total - i) * 100;
             
            //Stall the current thread for 0.1 seconds
            System.Threading.Thread.Sleep(50);
        }
    }

protected void RadButton1_Click(object sender, EventArgs e)
   {
       UpdateProgressContext(); //I assume this is how it call
       RetrieveData();
   }
Please help, thanks in advance!
Han
Top achievements
Rank 1
 answered on 19 Jan 2012
0 answers
57 views
We are using the MVC grid control with Razor in VB.  When I attempt to bind to the grid, I get an exception when one of the date columns that is passed back in the model contains a null.  When it doesnt contain a null, then it works fine.  I do not want the grid to try to bind this column at all - I do not need it in this view.  Is there a way to limit the columns that the grid is trying to use? 

I found this entry which seems to address the problem, but I do not see how to apply this in a Razor view.  Can anyone help? 

Here is the code from my View:

 

 

@(Html.Telerik().
    Grid(Model).
    Name("Grid").
    Columns(Sub(columns)
                    columns.Bound(Function(o) o.DocumentId).Width(20)
                    columns.Bound(Function(o) o.StatusCode).Width(20).Title("Status")
                    columns.Bound(Function(o) o.LastName).Width(10).Title("LastName")
                    columns.Template(Function(o) Html.ActionLink("View", "View", New With {.id = o.Id}))
            End Sub).
        Pageable.
        Sortable)
    )

 

 

 

 

JT
Top achievements
Rank 1
 asked on 19 Jan 2012
1 answer
66 views
Hi,
Please see the attached image.
The left side radtreeview i have achieved. All nodes are loading dynamically.Now I want to apply template concept to load a image for each node(based on some conditions of node parameters), on the right side, as shown. All this I need to dynamically. I have seen the documentation mentioned for telerik controls, but didn't gain much idea for this specific problem.
Please throw some light, how should I proceed.
Dimitar Terziev
Telerik team
 answered on 19 Jan 2012
1 answer
131 views
Hello,

I am using a grid that is included in a User Control and dynamically loaded to a RadTabStrip.

The problem I am having is that I am not able to process the ajax postback from grid in the code behind event handler RaisePostBackEvent.

Below is the RadAjaxManager code on the page hosting the RadStrip:

            <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
                <ClientEvents />
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                            <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="RadMultiPage1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="18_userControl_RadGridDiscounts" LoadingPanelID="LoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>                
            </telerik:RadAjaxManager>

This is the call to PostBack the grid from javascript:

__doPostBack(gridid, itemIndex);

Do I need to change the setting of RadAjaxManager?
Antonio Stoilkov
Telerik team
 answered on 19 Jan 2012
4 answers
148 views
Im trying to set up a tooltip which is updated to show which fields of the form the user must complete before being allowed to continue. I have several issues about it (because I'm a newbie asp programmer), but the worst is that after showing the tooltip a few times (hovering the mouse over the hotspot), I get the following error:

Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'Telerik.Web.UI    20'.


I have tried everyting I have been able to think on to solve it, with no success. I have not a single clue about that is wrong. Could you please tell me what is wrong? This is the code (in the master page there is only static content like images):

CreateProject.aspx
<%@ Page Title="" Language="VB" MasterPageFile="~/Resources/MasterPages/Clients.master" AutoEventWireup="false" CodeFile="CreateProject.aspx.vb" Inherits="Web_Clients_CreateProject" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
 
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style3
        {
            width: 250px;
        }
 
        .style4
        {
            border: 1px solid #abc1de;
            padding: 1px 4px;
            width: 100%;
        }
         
        .style7
        {
            width: 180px;
        }
 
        .style8
        {
            width: 96px;
        }
 
        .style9
        {
            width: 195px;
        }
 
        .style10
        {
            width: 140px;
        }
        .style11
        {
            width: 127px;
        }
    </style>
 
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="cphHeaderText" Runat="Server">
    Create Project
</asp:Content>
 
<asp:Content ID="Content3" ContentPlaceHolderID="cphMain" Runat="Server">
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="chkPONA">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="txtRadPO" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="lstRadSouceLangLista">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lstRadSouceLangSelected" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="lstRadSouceLangSelected">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lstRadSouceLangLista" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmbRadTTools">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="cmbRadTTools" />
                    <telerik:AjaxUpdatedControl ControlID="div_OtherTTool" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="chkTranslateOther">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="txtRadTranslateOther" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="chkDeliveryOther">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="txtRadDeliveryOther" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
 
     
     
 
    <div id="divProjectName" class="TableTextoMedio" style="float:left ">
         
        <table class="style1">
            <tr>
                <td class="style9">
                    Project Name:<div id="prueba"></div></td>
                <td>
                    <telerik:RadTextBox ID="txtRadProjectName" Runat="server" EmptyMessage="Project Name" LabelWidth="" Width="560px">
                        <EmptyMessageStyle Font-Italic="False" />
                    </telerik:RadTextBox>
                </td>
            </tr>
            <tr>
                <td class="style9">
                        Targeted Market and Audience:</td>
                <td>
                    <telerik:RadTextBox ID="txtRadAudience" Runat="server" EmptyMessage="Targeted Audience" LabelWidth="" Width="560px">
                        <EmptyMessageStyle Font-Italic="False" />
                    </telerik:RadTextBox>
                </td>
            </tr>
            </table>
    </div>
 
    <div id="div_menu" style="float:right">
        <div >
            <telerik:RadMenu ID="RadMenu1" runat="server" EnableRoundedCorners="True" EnableShadows="True" >
                <Items>
                    <telerik:RadMenuItem runat="server" Text="Profile" >
                        <Items>
                            <telerik:RadMenuItem runat="server" Text="Save current selections as default" Font-Size="12px">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem runat="server" Text="Load default selections" Font-Size="12px">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem runat="server" IsSeparator="True" Text="Child RadMenuItem 3" Font-Size="12px">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem runat="server" Text="Load default selections automatically" PostBack="false" Font-Size="12px">
                                <ItemTemplate>
                                    <asp:CheckBox ID="CheckBox3" runat="server" Text=" Always load default selections" Font-Size="11px" />
                                </ItemTemplate>
                            </telerik:RadMenuItem>
                        </Items>
                    </telerik:RadMenuItem>
                </Items>
            </telerik:RadMenu>
        </div>
        <div >
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="64px" Width="80px">
                <asp:Image ID="imgStatusCrearProyecto" ImageUrl="~/Resources/Icons/cross-icon.jpg" runat="server" Height="64px" Width="80px" />
                <asp:Timer ID="Timer1" runat="server" Interval="1000">
                </asp:Timer>
            </telerik:RadAjaxPanel>
        </div>
    </div>
 
    <div style="clear:left;">
    </div>
 
 
    <div id="divData1" class="TableTextoMedio" style="float:left; padding-top:20px;">
         
        <table class="style1">
            <tr>
                <td class="style10">
                    Account:</td>
                <td>
                    <telerik:RadTextBox ID="txtRadAccount" Runat="server" EmptyMessage="Account" LabelWidth="" Width="160px">
                        <EmptyMessageStyle Font-Italic="False" />
                    </telerik:RadTextBox>
                </td>
            </tr>
            <tr>
                <td class="style10">
         
                    Desired Delivery Date:</td>
                <td>
         
                    <telerik:RadDateTimePicker ID="RadDateTimePicker1" Runat="server" Culture="es-ES">
                        <TimeView CellSpacing="-1" Culture="es-ES"></TimeView>
                        <TimePopupButton ImageUrl="" HoverImageUrl=""></TimePopupButton>
                        <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" ShowRowHeaders="False">
                            <SpecialDays>
                                <telerik:RadCalendarDay Repeatable="Today" Date="" ItemStyle-CssClass="rcToday" />
                            </SpecialDays>
                        </Calendar>
                        <DateInput DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" LabelWidth="" EmptyMessage="Delivery Date">
                        </DateInput>
                        <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                    </telerik:RadDateTimePicker>
                </td>
            </tr>
            <tr>
                <td class="style10">
         
                    Time Zone:</td>
                <td>
                    <telerik:RadComboBox ID="cmbRadTimeZone" Runat="server" DataSourceID="XmlDataSourceTimeZones" DataTextField="Text" DataValueField="value"
                        Width="200px" DropDownWidth="500px" HighlightTemplatedItems="True">
                        <ItemTemplate>
                            <div class="combo-item-template" style="font-size:11px">
                                <%# Eval("Text") %>
                            </div>
                        </ItemTemplate>
                    </telerik:RadComboBox>
                    <asp:XmlDataSource ID="XmlDataSourceTimeZones" runat="server" DataFile="~/App_Data/TimeZones.xml"></asp:XmlDataSource>
                </td>
            </tr>
        </table>
    </div>
 
    <div id="divData2" class="TableTextoMedio" style="float: left; padding-left:50px; padding-top:20px;">
                     
        <table class="style1">
           <tr>
               <td class="style11">
                    Purchase Order:</td>
               <td>
                    <telerik:RadTextBox ID="txtRadPO" Runat="server" EmptyMessage="Purchase Order" LabelWidth="" Width="160px">
                        <EmptyMessageStyle Font-Italic="False" />
                    </telerik:RadTextBox>
                </td>
           </tr>
           <tr>
               <td class="style11">
         
                    Client Project Code:</td>
               <td>
         
                    <telerik:RadTextBox ID="txtRadClientCode" Runat="server" EmptyMessage="Client Project Code" LabelWidth="" Width="160px">
                        <EmptyMessageStyle Font-Italic="False" />
                    </telerik:RadTextBox>
                </td>
           </tr>
        </table>
    </div>
 
 
    <div id="div1" class="TableTextoMedio" style="float: left; padding-left:10px; padding-top:20px;">
        <asp:CheckBox ID="chkPONA" runat="server" Text=" Tick if PO is not applicable" AutoPostBack="True" />
    </div>
 
   <div style="clear:both">
   </div>
 
   <br />
    
    <div id="divSourceLanguage" class="TableTextoMedio" style="float:left;">
        <table class="style1">
           <tr>
               <td class="style3">
                    <b>Source Language:</b></td>
               <td>
                     </td>
           </tr>
           <tr>
               <td>
                   <telerik:RadListBox ID="lstRadSouceLangLista" runat="server" Height="110px" Width="250px" AllowTransfer="True"
                       TransferToID="lstRadSouceLangSelected" AutoPostBackOnTransfer="True" EnableMarkMatches="True" AllowTransferOnDoubleClick="True"
                       DataKeyField="Variante" DataSortField="Nombre" DataTextField="Nombre" DataValueField="Variante" Sort="Ascending">
                        <ButtonSettings TransferButtons="Common" ShowDelete="False" ShowTransferAll="False"></ButtonSettings>
                    </telerik:RadListBox> </td>
               <td>
                   <telerik:RadListBox ID="lstRadSouceLangSelected" runat="server" Height="110px" Width="220px" EnableMarkMatches="True" Font-Bold="True"
                       AllowTransferOnDoubleClick="True" >
                    </telerik:RadListBox> </td>
           </tr>
            
        </table>
    </div>
     
    <div id="divTargetLanguages" class="TableTextoMedio" style="float:left; padding-left:50px;">
         
        <table class="style1">
            <tr>
                <td class="style3">
                    <b>Target Languages:</b></td>
               <td>
                     </td>
            </tr>
            <tr>
                <td>
                    <telerik:RadListBox ID="lstRadTargetLangLista" runat="server" Height="110px" Width="250px" AllowTransfer="True" AllowTransferOnDoubleClick="True"
                        SelectionMode="Multiple" TransferToID="lstRadTargetLangSelected" EnableMarkMatches="True" DataKeyField="Variante"
                        DataSortField="Nombre" DataTextField="Nombre" DataValueField="Variante">
                    </telerik:RadListBox>
                </td>
                <td>
                    <telerik:RadListBox ID="lstRadTargetLangSelected" runat="server" Height="110px" Width="220px" EnableMarkMatches="True" Font-Bold="True"
                        ForeColor="Red" AllowTransferOnDoubleClick="True">
                    </telerik:RadListBox>
                </td>
            </tr>
        </table>
    </div>
 
    <div style="clear:both">
    </div>
 
    <br />
    <br />
 
     <div id="divTasks" class="TableTextoMedio" style="float:left;">
 
       <table class="style1">
            <tr>
                <td class="style3">
                    <b>Tasks to be performed:</b></td>
               <td>
                     </td>
            </tr>
            <tr>
                <td>
                    <telerik:RadListBox ID="lstRadTasksList" runat="server" Height="110px" Width="250px" AllowTransfer="True" AllowTransferOnDoubleClick="True"
                        SelectionMode="Multiple" TransferToID="lstRadTasksSelected" EnableMarkMatches="True" DataKeyField="idTarea"
                        DataSortField="Orden" DataTextField="Descripcion" DataValueField="idTarea">
                    </telerik:RadListBox>
                </td>
                <td>
                    <telerik:RadListBox ID="lstRadTasksSelected" runat="server" Height="110px" Width="220px" EnableMarkMatches="True" Font-Bold="True"
                        ForeColor="Red" AllowTransferOnDoubleClick="True">
                    </telerik:RadListBox>
                </td>
            </tr>
        </table>
 
        <br />
        <br />
 
        <div id="div_ttools" style="float:left;">
 
            <div style="padding-left:2px; padding-bottom:3px">
                <strong>Translation tool:</strong>
            </div>
 
            <table class="style4">
                <tr>
                    <td class="style8">
                        <telerik:RadComboBox ID="cmbRadTTools" runat="server" DataSourceID="EntityDataSourceTools" DataTextField="Nombre" DataValueField="idTTool"
                            EnableTextSelection="False" MarkFirstMatch="True" Sort="Ascending" Width="200px" AutoPostBack="True" CheckBoxes="True"
                            DropDownWidth="230px">
                        </telerik:RadComboBox>
                    </td>
                </tr>
                <tr>
                    <td class="style8">
                         </td>
                </tr>
                <tr>
                    <td class="style8" >
                        <div id="div_OtherTTool" runat="server" style="visibility:hidden">
                        <telerik:RadTextBox ID="txtRadOtherTTool" Runat="server" EmptyMessage="Please indicate" LabelWidth="" Width="190px">
                            <EmptyMessageStyle Font-Italic="True"/>
                        </telerik:RadTextBox>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
 
 
        <div id="div_hiddentext" style="float:left; padding-left:40px">
 
            <div style="padding-left:2px; padding-bottom:3px">
                <strong>Is there hidden text?</strong>
            </div>
 
            <table class="style4">
                <tr>
                    <td class="style8">
                        <asp:RadioButton ID="radioHiddenTextYes" runat="server" Checked="True" GroupName="grpHiddenText" Text=" Yes" />
                    </td>
                    <td>
                         </td>
                </tr>
                <tr>
                    <td class="style8">
                        <asp:RadioButton ID="radioHiddenTextNo" runat="server" GroupName="grpHiddenText" Text=" No" Checked="True" />
                    </td>
                    <td>
                         </td>
                </tr>
                <tr>
                    <td class="style8">
                        <asp:RadioButton ID="radioHiddenTextDontKnow" runat="server" GroupName="grpHiddenText" Text=" Don't know" />
                    </td>
                    <td>
                         </td>
                </tr>
            </table>
        </div>
    </div>
 
    <div id="divTranslate" class="TableTextoMedio" style="float:left; padding-left:50px;">
        <div style="padding-left:2px; padding-bottom:3px">
            <strong>Translate:</strong>
        </div>
 
        <table class="style4">
            <tr>
                <td>
 
                    <table>
                            <tr>
                            <td class="style7">
                                <asp:RadioButton ID="radioTranslateAll" runat="server" Checked="True" GroupName="grpTranslate" Text="All" AutoPostBack="True" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style7">
                                <asp:RadioButton ID="radioTranslateSelect" runat="server" GroupName="grpTranslate" Text="Select" AutoPostBack="True" />
                            </td>
                        </tr>
                    </table>
                     
                    <table style="padding-left:15px">
                        <tr>
                            <td class="style7">
                                <asp:CheckBox ID="chkTranslateText" runat="server" Text=" Text" Enabled="False" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style7">
                                <asp:CheckBox ID="chkTranslateTextBoxes" runat="server" Text=" Text boxes" Enabled="False" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style7">
                                <asp:CheckBox ID="chkTranslateImages" runat="server" Text=" Images" Enabled="False" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style7" style="vertical-align:top";>
                                <asp:CheckBox ID="chkTranslateOther" runat="server" Text=" Other:" AutoPostBack="True" Enabled="False" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style7" style="vertical-align:top";>
                                <telerik:RadTextBox ID="txtRadTranslateOther" Runat="server" EmptyMessage="Elements to be translated" LabelWidth="" TextMode="MultiLine"
                                    Width="100%" Rows="8" Enabled="False">
                                    <emptymessagestyle font-italic="False" />
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                    </table>
 
                </td>
            </tr>
        </table>
    </div>
 
    <div id="divFormats" class="TableTextoMedio" style="float:left; padding-left:60px;">
        <div style="padding-left:2px; padding-bottom:3px">
            <strong>Delivery format:</strong>
        </div>
 
        <table class="style4">
            <tr>
                <td class="style7">
                    <asp:CheckBox ID="chkDeliverySource" runat="server" Text=" Source format" Checked="True" />
                </td>
            </tr>
            <tr>
                <td class="style7" style="vertical-align:top";>
                    <asp:CheckBox ID="chkDeliveryOther" runat="server" Text=" Other:" AutoPostBack="True" />
                </td>
            </tr>
            <tr>
                <td class="style7" style="vertical-align:top";>
                    <telerik:RadTextBox ID="txtRadDeliveryOther" Runat="server" EmptyMessage="Describe the formats you desire" LabelWidth="" TextMode="MultiLine"
                        Width="100%" Rows="8" Enabled="False">
                        <emptymessagestyle font-italic="False" />
                    </telerik:RadTextBox>
                </td>
            </tr>
        </table>
    </div>
 
    
    <div style="clear:both">
    </div>
 
    <br />
 
    <div id="divInstructions" class="TableTextoMedio">
        <div style="padding-left:2px; padding-bottom:3px">
            <strong>Translation Instructions:</strong>
        </div>
        <table class="style1">
            <tr>
                <td>
                    <telerik:RadTextBox ID="RadTextBox1" Runat="server" EmptyMessage="Type translation instructions" LabelWidth="" TextMode="MultiLine"
                        Width="740px" Rows="10">
                        <emptymessagestyle font-italic="True" />
                    </telerik:RadTextBox>
                </td>
            </tr>
        </table>
    </div>
 
    <br />
    <br />
 
    <div class="TableTextoPeque">
        <asp:Button ID="Button1" runat="server" Text="Create project" />
    </div>
 
    <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" HideEvent="LeaveTargetAndToolTip" RenderInPageRoot="True"
        OnAjaxUpdate="OnAjaxUpdate" AutoCloseDelay="0" EnableShadow="True" Position="BottomLeft" RelativeTo="Mouse" Width="400px"
        ShowDelay="0" >
        <TargetControls>
            <telerik:ToolTipTargetControl TargetControlID="imgStatusCrearProyecto" IsClientID="false" />
        </TargetControls>
    </telerik:RadToolTipManager>
 
  
 
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Office2007">
    </telerik:RadSkinManager>
 
    <asp:EntityDataSource ID="EntityDataSourceTools" runat="server" ConnectionString="name=Extranet_JSProjects_Entities"
        DefaultContainerName="Extranet_JSProjects_Entities" EnableFlattening="False" EntitySetName="js_TranslationTools"
        Select="it.[idTTool], it.[Nombre]">
    </asp:EntityDataSource>
 
</asp:Content>

CreateProject.aspx.vb
Imports Telerik.Web.UI
Imports System.Data
Imports Extranet_JSProjects_Model
 
Partial Class Web_Clients_CreateProject
    Inherits System.Web.UI.Page
 
    Public Class ErroresAlCrearProyecto
        Private _Campo As String
        Public Property Campo As String
            Get
                Return _Campo
            End Get
            Set(value As String)
                _Campo = value
            End Set
        End Property
 
        Private _DescripcionError As String
        Public Property DescripcionError As String
            Get
                Return _DescripcionError
            End Get
            Set(value As String)
                _DescripcionError = value
            End Set
        End Property
    End Class
 
 
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
 
        If Not IsPostBack Then
            CargarIdiomas(lstRadSouceLangLista)
            CargarIdiomas(lstRadTargetLangLista)
 
            lstRadSouceLangLista.ButtonSettings.TransferButtons = ListBoxTransferButtons.TransferFrom
            lstRadSouceLangLista.Sort = RadListBoxSort.Ascending
            lstRadSouceLangLista.SortItems()
 
            lstRadTargetLangLista.Sort = RadListBoxSort.Ascending
            lstRadTargetLangLista.SortItems()
 
            CargarTareas(lstRadTasksList)
 
            div_OtherTTool.Attributes("style") = "visibility:hidden"
 
            RadDateTimePicker1.MinDate = Now
            'RadToolTipManager1.TargetControls.Add(imgStatusCrearProyecto.ClientID, True)
 
            txtRadProjectName.Focus()
        End If
 
    End Sub
 
 
    Protected Sub CargarIdiomas(lista As RadListBox)
 
        Using myProjectsEntities As New Extranet_JSProjects_Entities
            Dim query = From v In myProjectsEntities.js_IdiomasVariantes Join i In myProjectsEntities.js_Idiomas On v.IdiomaPadre Equals i.IdiomaId
                        Select New With {.Nombre = i.Nombre, .Variante = v.Nombre, .IdiomaId = i.IdiomaId, .IdiomaVarianteId = v.IdiomaVarianteId}
 
            For Each v In query
                Dim texto As String
                Dim valor As Integer
 
                texto = v.Nombre & " - " & v.Variante
                valor = v.IdiomaVarianteId
 
                Dim elemento As New RadListBoxItem
                elemento.Text = texto
                elemento.Value = valor
 
                lista.Items.Add(elemento)
            Next
        End Using
 
    End Sub
 
    Protected Sub CargarTareas(lista As RadListBox)
 
        Using myProjectsEntities As New Extranet_JSProjects_Entities
            Dim query = From t In myProjectsEntities.js_TareasTraduccion
                        Order By t.Orden
                        Select t
 
            For Each t In query
                Dim texto As String
                Dim valor As Integer
 
                texto = t.Descripcion
                valor = t.idTarea
 
                Dim elemento As New RadListBoxItem
                elemento.Text = texto
                elemento.Value = valor
 
                lista.Items.Add(elemento)
            Next
        End Using
 
    End Sub
 
    Protected Sub Timer1_Tick(sender As Object, e As System.EventArgs) Handles Timer1.Tick
        Dim NumeroDeErrores As Integer = 0
 
        'Nombre del proyecto
        If txtRadProjectName.Text.Length = 0 Then
            NumeroDeErrores = NumeroDeErrores + 1
        End If
 
        'Purchase Order
        If txtRadPO.Text.Length = 0 And chkPONA.Checked = False Then
            NumeroDeErrores = NumeroDeErrores + 1
        End If
 
        If NumeroDeErrores = 0 Then
            'RadToolTipManager1.TargetControls.Clear()
            imgStatusCrearProyecto.ImageUrl = "~/Resources/Icons/check-icon.jpg"
        Else
            'RadToolTipManager1.TargetControls.Add(imgStatusCrearProyecto.ClientID, True)
            imgStatusCrearProyecto.ImageUrl = "~/Resources/Icons/cross-icon.jpg"
        End If
 
    End Sub
 
    Private Sub AgregarError(Campo As String, Descripcion As String, ListaDeErrores As List(Of ErroresAlCrearProyecto))
        Dim ErrorEnCurso As New ErroresAlCrearProyecto
 
        ErrorEnCurso.Campo = Campo
        ErrorEnCurso.DescripcionError = Descripcion
 
        ListaDeErrores.Add(ErrorEnCurso)
    End Sub
 
 
    Protected Sub OnAjaxUpdate(sender As Object, e As ToolTipUpdateEventArgs)
 
        Dim ListaDeErrores As New List(Of ErroresAlCrearProyecto)
 
        Using myEntities As New Extranet_JSProjects_Entities
 
            'Eliminar todos los registros que haya en la tabla
            Dim query = From r In myEntities.js_ErroresCrearProyecto
                       Select r
 
            For Each r In query
                myEntities.js_ErroresCrearProyecto.DeleteObject(r)
            Next
 
 
            'Añadir el error a la tabla js_ErroresCrearProyecto
 
            'Nombre del proyecto
            If txtRadProjectName.Text.Length = 0 Then
                AgregarError("Project Name", "Enter a project name", ListaDeErrores)
            End If
 
            'Purchase Order
            If txtRadPO.Text.Length = 0 And chkPONA.Checked = False Then
                AgregarError("Purchase Order", "Enter a PO or tick the checkbox", ListaDeErrores)
            End If
 
            For Each r In ListaDeErrores
                Dim NuevoError As New js_ErroresCrearProyecto
                NuevoError.Campo = r.Campo
                NuevoError.Descripcion = r.DescripcionError
                myEntities.AddTojs_ErroresCrearProyecto(NuevoError)
            Next
 
            myEntities.SaveChanges()
 
        End Using
 
        Dim panel As New UpdatePanel
        panel = e.UpdatePanel
 
        Dim ctrl As Control = Page.LoadControl("CreateProjectErrors.ascx")
        panel.ContentTemplateContainer.Controls.Add(ctrl)
 
    End Sub
 
 
    Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
        Response.Redirect("UploadFiles.aspx")
    End Sub
 
 
    Protected Sub RadListBox2_Deleted(sender As Object, e As Telerik.Web.UI.RadListBoxEventArgs) Handles lstRadSouceLangSelected.Deleted
        lstRadSouceLangLista.ButtonSettings.TransferButtons = ListBoxTransferButtons.TransferFrom
        lstRadSouceLangLista.AllowTransferOnDoubleClick = True
        lstRadSouceLangSelected.AllowTransferOnDoubleClick = False
    End Sub
 
 
    Protected Sub RadListBox2_Inserted(sender As Object, e As Telerik.Web.UI.RadListBoxEventArgs) Handles lstRadSouceLangSelected.Inserted
        lstRadSouceLangLista.ButtonSettings.TransferButtons = ListBoxTransferButtons.TransferTo
        lstRadSouceLangLista.AllowTransferOnDoubleClick = False
        lstRadSouceLangSelected.AllowTransferOnDoubleClick = True
    End Sub
 
    Protected Sub RadComboBoxTTools_DataBound(sender As Object, e As System.EventArgs) Handles cmbRadTTools.DataBound
        cmbRadTTools.SortItems()
 
        'Seleccionar por omisión la opción "No choice"
        For Each elemento As RadComboBoxItem In cmbRadTTools.Items
            If elemento.Text = AppConfiguration._String_NoChoice Then
                elemento.Selected = True
                elemento.Checked = True
            End If
        Next
    End Sub
 
    Protected Sub cmbRadTTools_ItemChecked(sender As Object, e As Telerik.Web.UI.RadComboBoxItemEventArgs) Handles cmbRadTTools.ItemChecked
 
        'Si se selecciona "No Choice" se deseleccionan todos los demás
        'Se se selecciona cualquier otro se deselecciona "No Choice"
 
        If e.Item.Text = AppConfiguration._String_NoChoice Then
            For Each elemento As RadComboBoxItem In cmbRadTTools.Items
                If elemento.Text <> AppConfiguration._String_NoChoice Then
                    elemento.Checked = False
                End If
            Next
        Else
            For Each elemento As RadComboBoxItem In cmbRadTTools.Items
                If elemento.Text = AppConfiguration._String_NoChoice Then
                    elemento.Checked = False
                End If
            Next
        End If
 
        If e.Item.Text = AppConfiguration._String_Other And e.Item.Checked = True Then
            div_OtherTTool.Attributes("style") = "visibility:visible"
        End If
 
        If e.Item.Text = AppConfiguration._String_Other And e.Item.Checked = False Then
            div_OtherTTool.Attributes("style") = "visibility:hidden"
        End If
 
        e.Item.Selected = True
 
        'Si no hay ningún elemento seleccionado, seleccionar "No Choice"
        If cmbRadTTools.CheckedItems.Count = 0 Then
            For Each elemento As RadComboBoxItem In cmbRadTTools.Items
                If elemento.Text = AppConfiguration._String_NoChoice Then
                    elemento.Checked = True
                    elemento.Selected = True
                End If
            Next
        End If
 
    End Sub
 
 
    Protected Sub chkPONA_CheckedChanged(sender As Object, e As System.EventArgs) Handles chkPONA.CheckedChanged
        If chkPONA.Checked = True Then
            txtRadPO.Enabled = False
        Else
            txtRadPO.Enabled = True
        End If
    End Sub
 
    Protected Sub cmbRadTimeZone_DataBound(sender As Object, e As System.EventArgs) Handles cmbRadTimeZone.DataBound
        'Seleccionar la zona horaria del usuario
        For Each elemento As RadComboBoxItem In cmbRadTimeZone.Items
            Dim valor = Convert.ToDouble(elemento.Value)
            If valor = Profile.TimeZone Then
                elemento.Selected = True
            End If
        Next
    End Sub
 
 
    Protected Sub radioTranslateSelect_CheckedChanged(sender As Object, e As System.EventArgs) Handles radioTranslateSelect.CheckedChanged
        chkTranslateImages.Enabled = CType(sender, RadioButton).Checked
        chkTranslateText.Enabled = CType(sender, RadioButton).Checked
        chkTranslateTextBoxes.Enabled = CType(sender, RadioButton).Checked
        chkTranslateOther.Enabled = CType(sender, RadioButton).Checked
    End Sub
 
 
    Protected Sub radioTranslateAll_CheckedChanged(sender As Object, e As System.EventArgs) Handles radioTranslateAll.CheckedChanged
        chkTranslateImages.Enabled = Not CType(sender, RadioButton).Checked
        chkTranslateText.Enabled = Not CType(sender, RadioButton).Checked
        chkTranslateTextBoxes.Enabled = Not CType(sender, RadioButton).Checked
        chkTranslateOther.Enabled = Not CType(sender, RadioButton).Checked
    End Sub
 
    Protected Sub chkTranslateOther_CheckedChanged(sender As Object, e As System.EventArgs) Handles chkTranslateOther.CheckedChanged
        txtRadTranslateOther.Enabled = CType(sender, CheckBox).Checked
    End Sub
 
    Protected Sub chkDeliveryOther_CheckedChanged(sender As Object, e As System.EventArgs) Handles chkDeliveryOther.CheckedChanged
        txtRadDeliveryOther.Enabled = CType(sender, CheckBox).Checked
    End Sub
 
 
End Class


CreateProjectErrors.ascx
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="CreateProjectErrors.ascx.vb" Inherits="Web_Clients_WebUserControl" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<table width="360px" cellpadding="1">
    <tr>
        <td style="width:150px;">
                <strong>Field</strong>
            </td>
            <td style="width:200px;">
                <strong>Error</strong>
            </td>
        </tr>
    <tr>
        <td >
              
        </td>
        <td >
              
        </td>
    </tr>
    <asp:Repeater ID="repeaterErroresCrearProyecto" runat="server">
        <ItemTemplate>
            <tr>
                <td>
                    <%# Eval("Campo")%>
                </td>
                <td>
                    <%# Eval("Descripcion")%>
                </td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
</table>
 
<asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=Extranet_JSProjects_Entities"
    DefaultContainerName="Extranet_JSProjects_Entities" EnableFlattening="False" EntitySetName="js_ErroresCrearProyecto"
    Select="it.[Campo], it.[Descripcion]">
</asp:EntityDataSource>


CreateProject.ascx.vb
Partial Class Web_Clients_WebUserControl
    Inherits System.Web.UI.UserControl
 
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
 
        repeaterErroresCrearProyecto.DataSource = EntityDataSource1
        repeaterErroresCrearProyecto.DataBind()
 
    End Sub
 
End Class
Joaquín
Top achievements
Rank 2
 answered on 19 Jan 2012
1 answer
43 views
Hi,

I'm trying to get the RadScheduler demo with webservice binding to work in our application. If i recreate the demo in a new web application on an .aspx page everything works fine. But when i try to recreate it in a user control (which is dynamically loaded in our app) the javascript and jquery functions start acting up.

it seems the $telerik.$find() function is not working. I've set all scriptreferences that are provided in the demo on my master page but once the function 'addCategoriesToArray' function fires the radPanelBar is not found. i've put the scripts inside a RadScriptBlock so the ClientID's are being resolved nicely.

The first error i'm getting is: Cannot get the value of the property get_element: the object is null or not defined. This happens inside the following function:
function addSelectedCategoriesToArray(categoryNamesArray) {
            var $ = $telerik.$;
            var categoryPanelBar = $find('<%=RadPanelBar1.ClientID %>');
            $(':checkbox:checked', categoryPanelBar.get_element()).each(function () {
                categoryNames.push($(this).attr('name'));
            });
        }

The panelbar is right there on the usercontrol and the id is the same as the resolved id the js is trying to find with $find.
If i alert the categoryPanelbar var it's always null.

Has anyone else encountered this issue and found a solution?


Regards,
Roel
Ivana
Telerik team
 answered on 19 Jan 2012
8 answers
693 views
Hi,
Is there a way to automatically adjust the RADSchedule width and Height based on my user resolution. I have multiple users uses different resolution, some is 1024by 768 and some is bigger. I want to fully utilize the screen. I tried the following code but it didnt work:

<script type="text/javascript">
 
    function OnClientAppointmentMoving(sender, eventArgs) {
        eventArgs.set_cancel(true);
    }
 
 
    function pageLoad() {
        setTimeout(function () {
            $("div.RadScheduler ").center();
        }, 100);       
    }
 
 
 
    jQuery.fn.center = function () {
        
        this.css("height", $(window).height() + "px");
        return this;
    }
 
 
</script>
Any advise?

Regards
Hunter
Top achievements
Rank 1
 answered on 19 Jan 2012
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?