Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
116 views
Hello, 
I have customized the appointment editing window to show in a RadDock as a pop-up. When I double click on an appointment, my customized form will be show. The application is running on SharePoint 2010

Heres the c# code..

protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatingEventArgs e)
        {
            appointmentRecurrenceEditor.ResetLayout();
 
            if (e.Mode == SchedulerFormMode.Insert || e.Mode == SchedulerFormMode.Edit)
            {
                e.Cancel = true;
            }
 
            Telerik.Web.UI.Appointment appointmentToEdit = RadScheduler1.PrepareToEdit(e.Appointment, RadScheduler1.EditingRecurringSeries);
 
            ScriptManager.RegisterClientScriptBlock(Page, GetType(), "formScript", "Sys.Application.add_load(openDoubleClickForm);", true);
            PopulateEditForm(appointmentToEdit);
 
        }
 
        private void PopulateEditForm(Telerik.Web.UI.Appointment editedAppointment)
        {
            Telerik.Web.UI.Appointment appointmentToEdit = RadScheduler1.PrepareToEdit(editedAppointment, RadScheduler1.EditingRecurringSeries);
            radPopSplitDuration.Value = appointmentToEdit.Duration.TotalHours;
            RecurrenceRule parsedRule;
            RecurrenceRule.TryParse(appointmentToEdit.RecurrenceRule, out parsedRule);
            appointmentRecurrenceEditor.RecurrenceRule = parsedRule;
 
            RadAjaxManager1.AjaxSettings.AddAjaxSetting(this.RadScheduler1, radPopSplitDuration);
            RadAjaxManager1.AjaxSettings.AddAjaxSetting(this.RadScheduler1, appointmentRecurrenceEditor);
        }

Ajax Manager in my page...
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" EnableAJAX="true">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="radPopSplitDuration">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radPopSplitDuration" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="appointmentRecurrenceEditor">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="appointmentRecurrenceEditor" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

RadDock
<asp:Panel runat="server" ID="DockPanel">
        <telerik:RadDock runat="server" ID="RadDock1" Width="650px" Height="530px" Closed="true"
            Style="z-index: 2000;" Title="<%$Resources:MyResources, SplitDetailsTitle%>">
            <Commands>
                <telerik:DockExpandCollapseCommand />
            </Commands>
            <ContentTemplate>
                <div>
                                <telerik:RadNumericTextBox ID="radPopSplitDuration" runat="server" Width="80">
                                </telerik:RadNumericTextBox>
                    <telerik:RadSchedulerRecurrenceEditor runat="server" ID="appointmentRecurrenceEditor" />
                </div>
            </ContentTemplate>
        </telerik:RadDock>
    </asp:Panel>


ScriptManager in my master page
<telerik:RadScriptManager runat="server" ID="ScriptManager" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" />

Problem...
When I double click, A script error comes as 'Component 'SharedCalendar' was not found' . 

If I were to  remove the recurrence editor from the ajax manager in the aspx page and the ajax settings in the c# code, It will not give any error. It will update other controls such as 'radPopSplitDuration' but not the recurrence editor.

Any help would be gladly appreciated.
Hemika
Top achievements
Rank 1
 answered on 16 Jan 2013
6 answers
130 views
I have a page with a NumericTextBox with EmptyMessage set. This works and the EmptyMessage text is shown when the page loads. There is a problem when you go to a different page and then click the browser back button to return to the original page. In this case the EmptyMessage text is not shown. I tried this in IE8 and Chrome and get the same results in both. Is there a way to make this work?

Here is the code:
<asp:TextBox ID="textExistingAssets" MaxLength="10" Width="100" runat="server" />
<asp:RequiredFieldValidator ErrorMessage="Field is required" ControlToValidate="textExistingAssets" Display="Dynamic"
                        EnableClientScript="False" runat="server" />
 
<telerik:RadInputManager runat="server">
        <telerik:NumericTextBoxSetting Type="Currency" DecimalDigits="0" MinValue="0" MaxValue="2000000000" EmptyMessage="$">
            <TargetControls>
                <telerik:TargetInput ControlID="textExistingAssets" />
            </TargetControls>
            <Validation IsRequired="false" />
        </telerik:TextBoxSetting>
    </telerik:RadInputManager>
Patrick
Top achievements
Rank 1
 answered on 15 Jan 2013
1 answer
102 views
Hello,

I have a 3-tier hierarchy grid that, currently, displays great.  However, I run into problems when I start trying to export the data to PDF/Export.  Because it'd be a ton of code if I tried to post everything, I'll do my best using pseudocode.  Currently, my report hierarchy goes like this:

<radgrid1>
   <mastertableview>
      <detailtables>
         <gridtableview>
            <nestedviewtemplate>
               <radgrid2></radgrid2>
               <radgrid3></radgrid3>
               <radlistview></radlistview>
            </nestedviewtemplate>
         </gridtableview>
         <columns>
         ...
         ...
         ...
         </columns>
      </detailtables>
   </mastertableview>
   <columns>
   ...
   ...
   ...
   </columns>
</radgrid1>


Let's say radgrid1 holds customer names, and its one detail table holds product names, so that all the information in nestedviewtemplate holds production descriptions and such.

With the exception of of radgrid1, everything is databinded via the needdatasource event.  When i go to export to excel, my code looks something like this:

radgrid1.ExportSettings.OpenInNewWindow = true;
radgrid1.ExportSettings.ExportOnlyData = true;
foreach (GridDataItem i in radgrid1.MasterTableView.Items)
{
     i.expanded = true;
     foreach (GridDataItem j in i.ChildItem.NestedTableViews[0].Items)
          j.expanded = true;
}
radgrid1.MasterTableView.ExportToPdf();

The resulting PDF/Excel has all of the data from RadGrid1 and its child table exported, but nothing from the nestedviewtemplate.  Essentially, all I am getting is a list of Customer Names and Product names under them in my report, with no product description data.

Any advice would be great.

Thank you,
Pavlina
Telerik team
 answered on 15 Jan 2013
6 answers
144 views
Hi All,
I am encountering this issue with the radgrid enableheadercontextmenu, When I click one of the columns on my radgrid, the column on the right of my grid are getting hidden too. So it's hiding two columns at the same time. I can't find any settings that is allowing this. I already tried Tablelayout = "fixed" but still got the same problem. Below is the setting of my radgrid.

 

<telerik:RadGrid ID="grid" runat="server" Skin="Office2007"

 

AllowPaging="true" AllowSorting="true"  

 

 

 

 

 

PageSize="20" AutoGenerateColumns="false" 

 

 

 

ShowStatusBar="true" GridLines="None" Width="99%" 

 

 

 

OnNeedDataSource="grid_NeedDataSource"

 

OnItemCreated ="grid_ItemCreated"  

 

SelectedItemStyle-BackColor="LightSteelBlue"

 

 

 

AllowMultiRowSelection="False"

 

<SelectedItemStyle BackColor="LightSteelBlue"></SelectedItemStyle>

 

<HeaderStyle Font-Names="Verdana, Century Gothic" Font-Bold="true" Font-Size="8" ForeColor

="Navy"/> 

 

<ItemStyle Font-Names="Verdana, Century Gothic" Font-Size="8" Wrap

="false"/>

 

<PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />

 

 

 

<AlternatingItemStyle BackColor="AliceBlue" Font-Names="Verdana, Century Gothic" Font-Size="8" Wrap="false" />

 

<MasterTableView Width="100%" AllowMultiColumnSorting="true" TableLayout="Auto"

 

 

 

AllowFilteringByColumn="true" IsFilterItemExpanded="false" EnableHeaderContextFilterMenu="true" EnableHeaderContextMenu ="true">

 

 

 

<GroupByExpressions 

 

<telerik:GridGroupByExpression 

 

<SelectFields 

 

<telerik:GridGroupByField FieldAlias="Week" FieldName="Rotation" FormatString

="{0 : S}"

HeaderValueSeparator = " : " />

 

 

 

</SelectFields 

 

<GroupByFields>

<telerik:GridGroupByField FieldName="Rotation" SortOrder="Ascending"/>

 

</GroupByFields>
</telerik:GridGroupByExpression> 

 

</GroupByExpressions>

 

 

 

<Columns>

 

 

 

<telerik:GridTemplateColumn UniqueName="CategoryName" DataField="Categoryname" HeaderText

="Category">

 

<ItemStyle Wrap="true" Width="130" Font-Names

="Verdana"/>

 

 

<HeaderStyle Width="130" Wrap="true" />

 

<ItemTemplate>
<asp:Label ID="lblCategoryName" runat="server" Text='<%#Eval("CategoryName") %>' Width="130"></asp:Label>

 

 

</ItemTemplate 

 

</telerik:GridTemplateColumn 

 

<telerik:GridBoundColumn UniqueName="Status" DataField="Status" HeaderText

="Status">

<ItemStyle Wrap="true" Width="150" Font-Names

="Verdana"/> 

 

<HeaderStyle Width="150" Wrap="true" />

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridTemplateColumn UniqueName="EventName" DataField="Eventname" HeaderText

="Event Name">

 

<ItemStyle Wrap="true" Width="150" Font-Names

="Verdana"/> 

 

<HeaderStyle Width="150" Wrap="true" />  

 

<ItemTemplate>

 

<asp:Label ID="lblEventName" runat="server" Text='<%#Eval("EventName") %>' Width="150"></asp:Label>

 

</ItemTemplate>

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn UniqueName="EventDetails" DataField="EventDetails" HeaderText

="EventDetails">

 

<ItemStyle Wrap="true" Width="200" Font-Names

="Verdana"/>

 

<HeaderStyle Width="200" Wrap="true" />  

 

<ItemTemplate>

 

<asp:Label ID="lblDetails" runat="server" Text='<%#Eval("EventDetails") %>' Width="200px"></asp:Label> 

 

</ItemTemplate>

 

</telerik:GridTemplateColumn> 

 

<telerik:GridBoundColumn UniqueName="BrandFl" DataField="CompanyEvent" HeaderText="Priority Brand" >

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

<NoRecordsTemplate></NoRecordsTemplate>

 

</MasterTableView>

 

 

 

<FilterMenu EnableImageSprites="False"></FilterMenu>

 

<ClientSettings AllowColumnsReorder="true">

 

 

 

</ClientSettings>

 

</telerik:RadGrid>

 

 

Pavlina
Telerik team
 answered on 15 Jan 2013
2 answers
109 views

Hi, I just wanted to know if it's normal that the client-side function findItemByAttribute() cant find any items when we use "ID" (Capitalization doesnt matter) as the Attribute name? If it is, any references that documents this?

this works:
var foundItem = menu.findItemByAttribute("MenuID", "1");

but not this:
var foundItem = menu.findItemByAttribute("ID", "1");


TIA


Martin




Martin Roussel
Top achievements
Rank 1
 answered on 15 Jan 2013
3 answers
215 views
Hi!

We are using a RadComboBox with filter="contains" with a webservice supplying results on demand. All is working well. However, lately, we have changed our search to use Lucene.NET indexing and not Database queries.
Now. Lucene.NET allows wildcards in queries, and this is where problems begin. Webservice returns a set of results, but RadComboBox doesn't display them due to Filter being set to Contains. If I remove Filter property, results are displayed, but not highlighted.
Also, Lucene.NET has it's own highlighter, which I tried to use mimicking what RadComboBox does, when filter is set, but to no avail, as em tag is apparently stripped form RadComboBoxDropDown when filter is not set. I also tried to use custom html tag, but that then gets displayed in combobox input field, which I don't want.

Is there a way of either implementing wildcards in RadComboBox filter or a way to override em stripping so that I can use Lucene.Net highlighter.
Vlad
Top achievements
Rank 1
 answered on 15 Jan 2013
2 answers
126 views
I have a RadComboBox where I select a value which in turn enables a RadButton. I click the RadButton and an asp panel with form controls (textboxes, radio buttons, etc.) appears.

It should be mentioned that this RadComboBox is in another asp panel immediately above the panel with the form controls. These two asp panels are contained within a RadAjaxPanel.

The first time I change the index of the RadComboBox from the default -1 value, the SelectedIndexedChanged fires, the RadButton enables properly, click the button and panel appears with the form controls - no problem. Now the SelectedIndexedChanged event also hides the panel with the form controls - the RadButton click event makes the panel visible.

The next time I change the index of the RadComboBox, the SelectedIndexChanged does not fire - the cursor just hangs in the RadComboBox. Sometimes it will fire but after a long delay. If you change to the -1 default value, it never fires. The SelectedIndexChanged event fires perfectly if the asp panel with the form controls is not visible and all I am doing is toggling whether the RadButton is enabled or not.

I've even run the project in debug and when I change the RadComboBox index, it doesn't even go to the SelectedIndexChanged event at all. As a side note, all of this code is contained in a user control. The two panels that should be looked at are pnlAddLockSeries and pnlAddLockSeriesFormFields - not through doing all the add and edit functions of the code yet but wanted to get through this problem first. The ascx file is show first followed by the code behind.

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SeriesLockCRUD.ascx.vb" Inherits="EK8734MQPV3091_Controls_SeriesLockCRUD" %>
<div style="text-align:center"><asp:ValidationSummary ID="ValidationSummary1" ValidationGroup="AddLockSeries" ShowMessageBox="true" ShowSummary="false" runat="server" /><asp:ValidationSummary ID="ValidationSummary2" ValidationGroup="EditLockSeries" ShowMessageBox="true" ShowSummary="false" runat="server" /></div>
<telerik:RadToolTipManager ID="RadToolTipManager1" Width="200px" AutoCloseDelay="20000" HideDelay="3000" Skin="Sunset" runat="server" >
    <TargetControls>
        <telerik:ToolTipTargetControl TargetControlID="imgHelpAddLockSeries" IsClientID="true" />
        <telerik:ToolTipTargetControl TargetControlID="imgHelpEditLockSeries" IsClientID="true" />
        <telerik:ToolTipTargetControl TargetControlID="imgHelpSeriesPrefix" IsClientID="true" />
        <telerik:ToolTipTargetControl TargetControlID="imgHelpSeriesStart" IsClientID="true" />
        <telerik:ToolTipTargetControl TargetControlID="imgHelpSeriesEnd" IsClientID="true" />
        <telerik:ToolTipTargetControl TargetControlID="imgHelpSeriesSuffix" IsClientID="true" />
        <telerik:ToolTipTargetControl TargetControlID="imgHelpSeriesLeadingZeros" IsClientID="true" />
        <telerik:ToolTipTargetControl TargetControlID="imgHelpTwoCountSeries" IsClientID="true" />
        <telerik:ToolTipTargetControl TargetControlID="imgHelpTwoCountSeriesFirstCountStart" IsClientID="true" />
        <telerik:ToolTipTargetControl TargetControlID="imgHelpTwoCountSeriesFirstCountEnd" IsClientID="true" />
        <telerik:ToolTipTargetControl TargetControlID="imgHelpTwoCountSeriesSecondCountStart" IsClientID="true" />
        <telerik:ToolTipTargetControl TargetControlID="imgHelpTwoCountSeriesSecondCountEnd" IsClientID="true" />
    </TargetControls>
</telerik:RadToolTipManager>
<telerik:RadAjaxPanel ID="rapSeriesLock" runat="server">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
    <tr>
        <td class="YellowLargeBold" align="center" style="width:100%">
            Lock Series Add / Edit
        </td>
    </tr>
    <tr>
        <td class="BlackSmall" valign="top" >
        <br />
            <table style="border: 1px solid #F59F1A; margin-left:auto; margin-right:auto" cellpadding="1" cellspacing="0" width="40%">
                <tr>
                    <td class="rightborders" style="text-align:center">
                        <asp:LinkButton ID="lbAddLockSeries" CssClass="textGreensmall" OnClick="lbAddLockSeries_OnClick" Text="Add Lock Series" runat="server" />
                    </td>
                    <td class="rightborders" style="text-align:center">
                        <asp:LinkButton ID="lbEditLockSeries" CssClass="textsmall" OnClick="lbEditLockSeries_OnClick" Text="Edit Lock Series" runat="server" />
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<asp:Panel ID="pnlAddLockSeries" runat="server" >
<br />
<table cellpadding="2" cellspacing="0" width="70%" style="border-width:0px; margin-left:0px; margin-right:auto" class="BlackSmall">
    <tr>
        <td class="GreenSmallBold" valign="top">
            Add Lock Series <img src="../Images/help_icon.gif" id="imgHelpAddLockSeries" alt="" style="vertical-align:bottom" title="Select a Manufacturer from the Combo Box, click the ''Build New Lock Series'' button and the form fields will appear to add the Lock Series" />  <asp:LinkButton ID="lbCloseAddLockSeries" CssClass="textsmall" Text="Close Add Lock Series Section" OnClick="lbCloseAddLockSeries_OnClick" runat="server" /><br /><br />
        </td>
        <td class="GreenSmallBold" valign="top" style="width:300px">
            <telerik:RadComboBox ID="rcbManfAddLockSeries" Label="Manufacturer: " CssClass="BlackSmall" Width="200px" AppendDataBoundItems="true" AutoPostBack="true" OnSelectedIndexChanged="rcbManfAddLockSeries_SelectedIndexChanged" DataValueField="ManufacturerID" DataTextField="Manufacturer" runat="server" />
        </td>
        <td class="GreenSmallBold" valign="top">
            <telerik:RadButton ID="rbBuildNewLockSeries" OnClick="rbBuildNewLockSeries_OnClick" AutoPostBack="true" runat="server" Text="Build New Lock Series" />
        </td>
    </tr>
</table>
</asp:Panel>
<asp:Panel ID="pnlAddLockSeriesFormFields" runat="server">
<table class="bottomborders" style="border: 1px solid #F59F1A" cellpadding="2" cellspacing="0" width="100%">
    <tr>
        <td align="right" style="width:170px">
            Series Prefix: 
        </td>
        <td class="rightborders" style="width:140px">
            <telerik:RadTextBox ID="txtSeriesPrefix" MaxLength="10" Width="60px" runat="server" /> <img src="../Images/help_icon.gif" id="imgHelpSeriesPrefix" alt="" style="vertical-align:bottom" title="This is the one or more letter prefix such as ''FR'' for the Steelcase FR301 - FR801 series. VERY IMPORTANT: We also use this series prefix for two count series such as Chicago Locks 1X1 - 7X6 Series where the letter ''X'' is considered the series prefix" />
        </td>
        <td align="right" style="width:200px">
            Series Number Start: 
        </td>
        <td class="rightborders" style="width:130px">
            <telerik:RadTextBox ID="txtSeriesStart" MaxLength="6" Width="40px" runat="server" /> <img src="../Images/help_icon.gif" id="imgHelpSeriesStart" alt="" style="vertical-align:bottom" title="This is the numerical start of a series such ''301'' for the Steelcase series FR301 - FR801. In the case where there are leading zeros, just put the actual number start. As an example, for the Haworth SL001 - SL300 series, just put the number ''1'' in the blank even though there are two leading zeros - more on leading zeros later." />
            <asp:CompareValidator ID="cvtxtSeriesStart" ControlToValidate="txtSeriesStart" Operator="DataTypeCheck" Type="Integer" ValidationGroup="AddLockSeries" Display="None" runat="server" ErrorMessage="You must use whole numbers for the series start." />
            <asp:RequiredFieldValidator ID="reqtxtSeriesStart" ControlToValidate="txtSeriesStart" runat="server" Display="None" ErrorMessage="You must enter a Lock Series Start Number and it must be in whole numbers." />
        </td>
        <td align="right" style="width:180px">
            Series Number End: 
        </td>
        <td class="rightborders" style="width:130px">
            <telerik:RadTextBox ID="txtSeriesEnd" MaxLength="6" Width="40px" runat="server" /> <img src="../Images/help_icon.gif" id="imgHelpSeriesEnd" alt="" style="vertical-align:bottom" title="This is the numerical end of a series such ''801'' for the Steelcase series FR301 - FR801. If there is no series end such as American Specialties E114, just leave a number zero in the form blank." />
            <asp:CompareValidator ID="cvtxtSeriesEnd" ControlToValidate="txtSeriesEnd" Operator="DataTypeCheck" Type="Integer" ValidationGroup="AddLockSeries" Display="None" runat="server" ErrorMessage="You must use whole numbers for the series end." />
        </td>
        <td align="right" style="width:170px;">
            Series Suffix: 
        </td>
        <td class="rightborders" style="width:150px">
            <telerik:RadTextBox ID="txtSeriesSuffix" MaxLength="10" Width="60px" runat="server" /> <img src="../Images/help_icon.gif" id="imgHelpSeriesSuffix" alt="" style="vertical-align:bottom" title="This is the one or more letter suffix such as ''XA'' for the Chicago Lock 1001XA-3000XA series. It also applies to ''New Style'' and ''Old Style'' such as Kimball in which case there is a space and then [new style] or a space and then [old style]." />
        </td>
        <td align="right" style="width:160px">
            Series Start <br />Leading Zeros:
        </td>
        <td style="width:150px">
            <telerik:RadTextBox ID="txtSeriesLeadingZeros" MaxLength="6" Width="40px" runat="server" /> <img src="../Images/help_icon.gif" id="imgHelpSeriesLeadingZeros" alt="" style="vertical-align:bottom" title="This is the number of leading zeros for the START of a particular series. An example would be the Eagle series CC001 - CC240 where there are TWO leading zeros at the start of the series." />
            <asp:CompareValidator ID="cvtxtSeriesLeadingZeros" ControlToValidate="txtSeriesLeadingZeros" Operator="DataTypeCheck" Type="Integer" ValidationGroup="AddLockSeries" Display="None" runat="server" ErrorMessage="You must use whole numbers for the series leading zeros. If there are no leading zeros, leave the number zero in the form blank." />
        </td>
    </tr>
    <tr>
        <td align="right">
            Two Count Series: 
        </td>
        <td class="rightborders">
            <asp:RadioButton ID="TwoCountSeriesYes" GroupName="TwoCountSeries" Text="Yes" runat="server" /><asp:RadioButton ID="TwoCountSeriesNo" GroupName="TwoCountSeries" Text="No" runat="server" /> <img src="../Images/help_icon.gif" id="imgHelpTwoCountSeries" alt="" style="vertical-align:bottom" title="This is a true/false for two count series such as Chicago Locks 1X1 - 7X6 Series - i.e. it counts from 1X1 to 1X6, then 2X1 to 2X6 and so on. Most of the time this will be 'False' or 'No' and so 'No' is checked by default. If 'No' is checked, you do not have to fill out the remaining Two Count form blanks (leave the default zeros there) but do complete the rest of the form." />
        </td>
        <td align="right">
           Two Count Series <br />1st Number Start: 
        </td>
        <td class="rightborders">
            <telerik:RadTextBox ID="txtTwoCountSeriesFirstCountStart" MaxLength="6" Width="40px" Text="0" runat="server" /> <img src="../Images/help_icon.gif" id="imgHelpTwoCountSeriesFirstCountStart" alt="" style="vertical-align:bottom" title="Again with Chicago Locks 1X1 - 7X6 Series, this would be the FIRST number 1 of '1X1'" />
            <asp:CompareValidator ID="cvtxtTwoCountSeriesFirstCountStart" ControlToValidate="txtTwoCountSeriesFirstCountStart" Operator="DataTypeCheck" Type="Integer" ValidationGroup="AddLockSeries" Display="None" runat="server" ErrorMessage="You must use whole numbers for the Two Count Series 1st Number Start." />
        </td>
        <td align="right">
           Two Count Series <br />1st Number End: 
        </td>
        <td class="rightborders">
            <telerik:RadTextBox ID="txtTwoCountSeriesFirstCountEnd" MaxLength="6" Width="40px" Text="0" runat="server" /> <img src="../Images/help_icon.gif" id="imgHelpTwoCountSeriesFirstCountEnd" alt="" style="vertical-align:bottom" title="Again with Chicago Locks 1X1 - 7X6 Series, this would be the SECOND number 1 of '1X1'" />
            <asp:CompareValidator ID="cvtxtTwoCountSeriesFirstCountEnd" ControlToValidate="txtTwoCountSeriesFirstCountEnd" Operator="DataTypeCheck" Type="Integer" ValidationGroup="AddLockSeries" Display="None" runat="server" ErrorMessage="You must use whole numbers for the Two Count Series 1st Number Start." />
        </td>
        <td align="right">
           Two Count Series <br />2nd Number Start: 
        </td>
        <td class="rightborders">
            <telerik:RadTextBox ID="txtTwoCountSeriesSecondCountStart" MaxLength="6" Width="40px" Text="0" runat="server" /> <img src="../Images/help_icon.gif" id="imgHelpTwoCountSeriesSecondCountStart" alt="" style="vertical-align:bottom" title="Again with Chicago Locks 1X1 - 7X6 Series, this would be the FIRST number 7 of '7X6'" />
            <asp:CompareValidator ID="cvtxtTwoCountSeriesSecondCountStart" ControlToValidate="txtTwoCountSeriesSecondCountStart" Operator="DataTypeCheck" Type="Integer" ValidationGroup="AddLockSeries" Display="None" runat="server" ErrorMessage="You must use whole numbers for the Two Count Series 2nd Number Start." />
        </td>
        <td align="right">
           Two Count Series <br />2nd Number End: 
        </td>
        <td class="rightborders">
            <telerik:RadTextBox ID="txtTwoCountSeriesSecondCountEnd" MaxLength="6" Width="40px" Text="0" runat="server" /> <img src="../Images/help_icon.gif" id="imgHelpTwoCountSeriesSecondCountEnd" alt="" style="vertical-align:bottom" title="Again with Chicago Locks 1X1 - 7X6 Series, this would be the SECOND number 6 of '7X6'" />
            <asp:CompareValidator ID="cvtxtTwoCountSeriesSecondCountEnd" ControlToValidate="txtTwoCountSeriesSecondCountEnd" Operator="DataTypeCheck" Type="Integer" ValidationGroup="AddLockSeries" Display="None" runat="server" ErrorMessage="You must use whole numbers for the Two Count Series 2nd Number End." />
        </td>
    </tr>
    <tr>
        <td align="center" valign="middle" colspan="10" style="border-bottom-width:0px; height:40px">
            <telerik:RadButton ID="rbnSubmitNewLockSeries" OnClick="rbnSubmitNewLockSeries_OnClick" CausesValidation="true" ValidationGroup="AddLockSeries" Width="200px" Height="30px" runat="server" Text="Add New Lock Series" />
            <asp:Label ID="lblAddLockSeriesSuccess" Visible="false" runat="server" /><asp:Timer ID="tmAddLockSeriesSuccess" Interval="10000" OnTick="tmAddLockSeriesSuccess_OnTick" runat="server" />
        </td>
    </tr>
</table>
</asp:Panel>
<asp:Panel ID="pnlEditLockSeries" runat="server" >
<br />
<table cellpadding="2" cellspacing="0" width="90%" style="border-width:0px; margin-left:0px; margin-right:auto" class="BlackSmall">
    <tr>
        <td class="RedSmallBold">
            Edit Lock Series <img src="../Images/help_icon.gif" id="imgHelpEditLockSeries" alt="" style="vertical-align:bottom" title="Select a Manufacturer from the first combo box and then select a series from the second combo box and the form fields will appear for editing purposes" />  <asp:LinkButton ID="lbCloseEditLockSeries" CssClass="textsmall" Text="Close Edit Lock Series Section" OnClick="lbCloseEditLockSeries_OnClick" runat="server" /><br /><br />
        </td>
        <td class="GreenSmallBold" valign="top" style="width:300px">
            <telerik:RadComboBox ID="rcbManfEditLockSeries" Label="Manufacturer: " CssClass="BlackSmall" Width="200px" AppendDataBoundItems="true" AutoPostBack="true" OnSelectedIndexChanged="rcbManfEditLockSeries_SelectedIndexChanged" DataValueField="ManufacturerID" DataTextField="Manufacturer" runat="server" />
        </td>
        <td class="GreenSmallBold" valign="top" style="width:300px">
            <telerik:RadComboBox ID="rcbEditLockSeries" Label="LockSeries: " CssClass="BlackSmall" Width="200px" AppendDataBoundItems="true" AutoPostBack="true" OnSelectedIndexChanged="rcbEditLockSeries_SelectedIndexChanged" DataValueField="SeriesLockID" DataTextField="Series" runat="server" />
        </td>
        <td class="GreenSmallBold" valign="top">
            <telerik:RadButton ID="rbEditExistingLockSeries" OnClick="rbEditExistingLockSeries_OnClick" AutoPostBack="true" runat="server" Text="Edit Lock Series" />
        </td>
    </tr>
</table>
</asp:Panel>
<asp:Panel ID="pnlEditLockSeriesFormFields" runat="server">
 
</asp:Panel>
</telerik:RadAjaxPanel>

And here is the code behind:
Imports DAL
Imports System
Imports System.IO
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Configuration
Imports System.Web.UI.WebControls
Imports System.Collections.Generic
Imports Telerik.Web.UI
Imports Microsoft.VisualBasic
Partial Class EK8734MQPV3091_Controls_SeriesLockCRUD
    Inherits System.Web.UI.UserControl
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack And Not Page.IsCallback Then
            pnlAddLockSeries.Visible = False
            pnlEditLockSeries.Visible = False
            rbBuildNewLockSeries.Enabled = False
            rcbEditLockSeries.Enabled = False
            rbEditExistingLockSeries.Enabled = False
            pnlAddLockSeriesFormFields.Visible = False
            pnlEditLockSeriesFormFields.Visible = False
 
            Dim ManufacturersList As List(Of Manufacturer)
            ManufacturersList = Manufacturer.GetAllManufacturers
            If Not ManufacturersList Is Nothing And ManufacturersList.Count > 0 Then
                rcbManfAddLockSeries.Items.Insert(0, New RadComboBoxItem("- Select a Manufacturer -", "-1"))
                rcbManfEditLockSeries.Items.Insert(0, New RadComboBoxItem("- Select a Manufacturer -", "-1"))
                rcbManfAddLockSeries.DataSource = ManufacturersList
                rcbManfEditLockSeries.DataSource = ManufacturersList
                rcbManfAddLockSeries.DataBind()
                rcbManfEditLockSeries.DataBind()
            End If
        End If
    End Sub
    Public Sub rcbManfAddLockSeries_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles rcbManfAddLockSeries.SelectedIndexChanged
 
        pnlAddLockSeriesFormFields.Visible = False
 
        If rcbManfAddLockSeries.SelectedValue <> "-1" Then
            rbBuildNewLockSeries.Enabled = True
            Exit Sub
        Else
            rbBuildNewLockSeries.Enabled = False
            Exit Sub
        End If
    End Sub
    Protected Sub rbBuildNewLockSeries_OnClick(ByVal sender As Object, ByVal e As EventArgs)
        pnlAddLockSeriesFormFields.Visible = True
        ' Intitialize text box values where necessary
        txtSeriesEnd.Text = "0"
        txtSeriesLeadingZeros.Text = "0"
        TwoCountSeriesNo.Checked = True
        txtTwoCountSeriesFirstCountStart.Text = "0"
        txtTwoCountSeriesFirstCountEnd.Text = "0"
        txtTwoCountSeriesSecondCountStart.Text = "0"
        txtTwoCountSeriesSecondCountEnd.Text = "0"
        Exit Sub
    End Sub
    Protected Sub rbnSubmitNewLockSeries_OnClick(ByVal sender As Object, ByVal e As EventArgs)
        If Page.IsValid Then
 
        End If
    End Sub
     
    Public Sub rcbManfEditLockSeries_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)
 
        pnlEditLockSeriesFormFields.Visible = False
 
        If rcbManfEditLockSeries.SelectedValue <> "-1" Then
            rcbEditLockSeries.Items.Clear()
            rcbEditLockSeries.Enabled = True
            Dim ManfLockSeries As List(Of SeriesLock)
            ManfLockSeries = SeriesLock.GetAllSeriesLocksByManufacturerID(CInt(rcbManfEditLockSeries.SelectedValue))
            If Not ManfLockSeries Is Nothing And ManfLockSeries.Count > 0 Then
                rcbEditLockSeries.Items.Insert(0, New RadComboBoxItem("- Select a Lock Series -", "-1"))
                rcbEditLockSeries.DataSource = ManfLockSeries
                rcbEditLockSeries.DataBind()
                rcbEditLockSeries.Focus()
            Else
                rcbEditLockSeries.Enabled = False
                rbEditExistingLockSeries.Enabled = False
            End If
        Else
            rcbEditLockSeries.Items.Clear()
            rcbEditLockSeries.Enabled = False
            rbEditExistingLockSeries.Enabled = False
        End If
    End Sub
    Public Sub rcbEditLockSeries_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)
        If rcbEditLockSeries.SelectedValue <> "-1" Then
            rbEditExistingLockSeries.Enabled = True
        Else
            rbEditExistingLockSeries.Enabled = False
        End If
    End Sub
    Protected Sub rbEditExistingLockSeries_OnClick(ByVal sender As Object, ByVal e As EventArgs)
        'ClearFormControls(pnlEditLockSeriesFormFields)
        pnlEditLockSeriesFormFields.Visible = True
        ' will have to initialize a lot of fields here.
    End Sub
    Protected Sub tmAddLockSeriesSuccess_OnTick(ByVal sender As Object, ByVal e As System.EventArgs)
        lblAddLockSeriesSuccess.Visible = False
        tmAddLockSeriesSuccess.Enabled = False
        Exit Sub
    End Sub
    Protected Sub lbAddLockSeries_OnClick(ByVal sender As Object, ByVal e As EventArgs) Handles lbAddLockSeries.Click
        pnlAddLockSeries.Visible = True
    End Sub
    Protected Sub lbEditLockSeries_OnClick(ByVal sender As Object, ByVal e As EventArgs) Handles lbEditLockSeries.Click
        pnlEditLockSeries.Visible = True
    End Sub
    Protected Sub lbCloseAddLockSeries_OnClick(ByVal sender As Object, ByVal e As EventArgs) Handles lbCloseAddLockSeries.Click
        pnlAddLockSeries.Visible = False
        pnlAddLockSeriesFormFields.Visible = False
    End Sub
    Protected Sub lbCloseEditLockSeries_OnClick(ByVal sender As Object, ByVal e As EventArgs) Handles lbCloseEditLockSeries.Click
        pnlEditLockSeries.Visible = False
        pnlEditLockSeriesFormFields.Visible = False
    End Sub
End Class
Boyan Dimitrov
Telerik team
 answered on 15 Jan 2013
1 answer
74 views
how to create the the view page in table
MasterChiefMasterChef
Top achievements
Rank 2
 answered on 15 Jan 2013
2 answers
528 views
Does anyone know if i can change the font size on the combobox item list?
Braden Holbrook
Top achievements
Rank 1
 answered on 15 Jan 2013
3 answers
259 views
Hey guys,
In my form I have an file upload control which uploads an image for the radimageeditor. I forced the radimageeditor to automaticly call the cropping feature when an image is loaded. To improve the usability Ive hidden the cropping settings form. The problem now is that if I click on the "Button1" the image will be cropped for just a second and after the postback the image isnt cropped anymore. If i do it in two steps:
 1. Click on a button which fires the applyModifications() javascript methond
 2. Click on a button which fires the postback

everything is fine but I want to do that in just one step. Is there any solution for such a Problem?




This is the current asp.net markup code:
<telerik:RadAsyncUpload ID="AsyncUpload1" runat="server" OnFileUploaded="AsyncUpload1_FileUploaded"
    MaxFileSize="524288"  AllowedFileExtensions="jpg,png,gif,bmp"
    AutoAddFileInputs="false" />
<asp:Button ID="Button3" Text="Upload Image" runat="server" CausesValidation="False" /><br />
 
<telerik:RadImageEditor id="theImageEditor" runat="server" Width="400" Height="400"
    onclientcommandexecuted="modifyCommand" OnClientLoad="OnClientLoad"  OnImageLoading="theImageEditor_ImageLoading" >
    </telerik:RadImageEditor>
    <asp:Button ID="Button1" Text="Crop" runat="server" OnClick="Button1_Click" OnClientClick="applyModifications();"  />
<style>
    .rieDraggableResizeHandle
    {
        display: none;
    }
    .RadImageEditor .rieToolBar
    {
        display: none;
    }
    .rieResizeHandle
    {
        display: none;   
    }
</style>
<script type="text/javascript">
    function modifyCommand(imageEditor, args) {
        if (args.get_commandName()) {
            waitForCommand(imageEditor, args.get_commandName(), function (widget) {
                if (widget._constraintBtn != null) {
                    widget._constraintBtn.set_checked(false); //stop the aspect ration constraint
                    widget.set_width(200);
                    widget.set_height(300);
                    widget._widthTxt.disabled = true;
                    widget._heightTxt.disabled = true;
                    widget._updateCropBoxFromControls();
                }
            });
        }
    }
 
    function waitForCommand(imageEditor, commandName, callback) {
        var timer = setInterval(function () {
            var widget = imageEditor.get_currentToolWidget();
            if (widget && widget.get_name() == commandName) {
                clearInterval(timer);
                callback(widget);
            }
        }, 100);
    }
    function OnClientLoad(sender, eventArgs) {
        //executer la commende Crop
        var imageEditor = $telerik.toImageEditor(sender);
        imageEditor.fire("Crop", eventArgs);
        var imageEditorId = imageEditor.get_id();
        //cacher le dialog box
        $('#' + imageEditorId + '_ToolsPanel').hide();
 
         
    }
    function applyModifications() {
        var x = $find("<%=theImageEditor.ClientID %>");
        var txtx = $("#<%=theImageEditor.ClientID %>_ToolsPanel_C_txtX").val();
        var txty = $("#<%=theImageEditor.ClientID %>_ToolsPanel_C_txtY").val();
        var txtWidth = $("#<%=theImageEditor.ClientID %>_ToolsPanel_C_txtWidth").val();
        var txtHeight = $("#<%=theImageEditor.ClientID %>_ToolsPanel_C_txtHeight").val();
        var xy = new Sys.UI.Bounds(
                parseInt(txtx),
                parseInt(txty),
                parseInt(txtWidth),
                parseInt(txtHeight));
 
        x._cropImage(xy);
        x.applyChangesOnServer();
    }
</script>


This is the code behind:

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        Context.Cache.Remove(Session.SessionID + "UploadedFile");
    }
 
    // Initially fill the imageeditor with an image
    theImageEditor.ImageUrl = "~/_layouts/images/Design/background.png";
}
 
protected void Button1_Click(object sender, EventArgs e)
{
    System.Drawing.Image image = theImageEditor.GetEditableImage().Image;
    byte[] imageData = getBytesFromImage(image);
    // save the theoretically cropped image to the file system
    using (BinaryWriter binWriter = new BinaryWriter(File.Open(@"C:\Test.png", FileMode.Create)))
    {
        binWriter.Write(imageData);
    }
}
private byte[] getBytesFromImage(System.Drawing.Image image)
{
    MemoryStream ms = new MemoryStream();
    image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
    return ms.ToArray();
}
 
 
 
protected void theImageEditor_ImageLoading(object sender, ImageEditorLoadingEventArgs args)
{
    //Handle Uploaded images
    if (!Object.Equals(Context.Cache.Get(Session.SessionID + "UploadedFile"), null))
    {
        using (EditableImage image = new EditableImage((MemoryStream)Context.Cache.Get(Session.SessionID + "UploadedFile")))
        {
            args.Image = image.Clone();
            args.Cancel = true;
        }
    }
}
 
protected void AsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
{
    //Clear changes and remove uploaded image from Cache
    theImageEditor.ResetChanges();
    Context.Cache.Remove(Session.SessionID + "UploadedFile");
    using (Stream stream = e.File.InputStream)
    {
        byte[] imgData = new byte[stream.Length];
        stream.Read(imgData, 0, imgData.Length);
        MemoryStream ms = new MemoryStream();
        ms.Write(imgData, 0, imgData.Length);
 
        Context.Cache.Insert(Session.SessionID + "UploadedFile", ms, null, DateTime.Now.AddMinutes(20), TimeSpan.Zero);
    }
}


Kind regards,
Frank Rademacher
Vessy
Telerik team
 answered on 15 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?