Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
479 views
Hi friends,

i have two user controls in a page. in usercontrol1 i have binded an image and onclick of that image it will call an JS function which is used for deleting.
In usercontrol2 i have a search textbox whenever i type a string and hit enter it should undergo a search.
but a weird thing is happening and i dont know why it is happening.

when i enter a text and hit enter, the control flow calls the binding in the usercontrol1 which in turn calls the jS function.

Does anyone have any clue on this? please give me a clear picture on this.
Martin
Telerik team
 answered on 08 Jul 2010
2 answers
163 views
I have a grid with detail tables. I'm trying to Export to Excel. Using Just ExportToExcel works although I get a blank first column But I need to add styling and remove <br> from header text so I thought I'd use ExcelML format. This produces only the data for whichever is the current sort column and notthing else.
 
<telerik:RadGrid ID="rgInvoices" runat="server" GridLines="None" AllowPaging="True" 
    AllowMultiRowSelection="true" ShowStatusBar="true" AllowSorting="True" AutoGenerateColumns="False" 
    GroupingEnabled="False" Skin="CentreTelerikNoSelectStyle" EnableEmbeddedSkins="false" 
    OnNeedDataSource="rgInvoices_NeedDataSource" PageSize="10" OnItemCreated="rgInvoices_ItemCreated" 
    OnItemDataBound="rgInvoices_ItemDataBound" OnDetailTableDataBind="rgInvoices_DetailTableDataBind" 
    HeaderStyle-Font-Bold="true" OnExcelMLExportStylesCreated="RadGrid1_ExcelMLExportStylesCreated" 
    OnExcelMLExportRowCreated="RadGrid1_ExcelMLExportRowCreated">  
   <ClientSettings> 
        <Selecting AllowRowSelect="True" EnableDragToSelectRows="false" /> 
        <ClientEvents OnRowSelecting="CancelNonInputSelect" OnRowDeselecting="CancelNonInputSelect" /> 
    </ClientSettings> 
    <MasterTableView OverrideDataSourceControlSorting="True" DataKeyNames="PK,InvoiceType,Number,DealerRefNumber,DueDate,OriginalAmount,OpenAmount,TransactionType" 
        AllowNaturalSort="false" CommandItemDisplay="Top" CommandItemStyle-Font-Bold="true">  
        <CommandItemTemplate> 
            <div style="padding: 5px 20px 5px 5px; text-align: left; float: left">  
                <asp:Label ID="lblSearchResults" class="ReportTitleBold" SkinID="none" runat="server" 
                    meta:resourcekey="lblInvoices"></asp:Label>&nbsp;&nbsp;  
                <CENTRE:CentreImageButton ID="btnAddToSelectedInvoices" runat="server" meta:resourcekey="btnAddToSelectedInvoices" 
                    CausesValidation="false" OnClick="btnAddToSelectedInvoices_Click"></CENTRE:CentreImageButton>&nbsp;  
                <CENTRE:CentreImageButton ID="btnExportAll" runat="server" meta:resourcekey="btnExportAll" OnClick="btnExportAll_Click"></CENTRE:CentreImageButton> 
            </div> 
            <div style="padding: 5px 5px 5px 0px; float: right; white-space: nowrap">  
                <asp:Label ID="lblTotals" runat="server" meta:resourcekey="lblTotals"></asp:Label>&nbsp;  
                <asp:Label ID="lblTotalOpenAmount" runat="server"></asp:Label>&nbsp;</div> 
            <div style="clear: both;"></div> 
        </CommandItemTemplate> 
        <SortExpressions> 
            <telerik:GridSortExpression FieldName="DueDate" SortOrder="Ascending" /> 
        </SortExpressions> 
        <Columns> 
            <telerik:GridTemplateColumn HeaderText="<%$ Resources:PaymentHistoryHeader %>" HeaderStyle-HorizontalAlign="Center" 
                ItemStyle-HorizontalAlign="Center" UniqueName="PaymentLog">  
                <ItemTemplate> 
                    <asp:ImageButton ID="btnLog" runat="server" ImageUrl="~/images/magnify.gif" CommandName="PaymentLog" CommandArgument='<%# Eval("Number") %>' /> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 
            <telerik:GridClientSelectColumn UniqueName="SelectColumn" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" /> 
            <telerik:GridBoundColumn HeaderText="<%$ Resources:NumberHeader %>" DataField="Number"></telerik:GridBoundColumn> 
            <telerik:GridNumericColumn HeaderText="<%$ Resources:DealerRefNumberHeader %>" DataField="DealerRefNumber"></telerik:GridNumericColumn> 
            <telerik:GridBoundColumn HeaderText="<%$ Resources:StatusHeader %>" DataField="Status"></telerik:GridBoundColumn> 
            <telerik:GridBoundColumn HeaderText="<%$ Resources:NameHeader %>" DataField="Name"></telerik:GridBoundColumn> 
            <telerik:GridBoundColumn HeaderText="<%$ Resources:TransactionDateHeader %>" DataField="TransactionDate" 
                DataFormatString="{0:d}" DataType="System.DateTime"></telerik:GridBoundColumn> 
            <telerik:GridBoundColumn HeaderText="<%$ Resources:PostedDateHeader %>" DataField="PostedDate" 
                DataFormatString="{0:d}" DataType="System.DateTime"></telerik:GridBoundColumn> 
            <telerik:GridBoundColumn HeaderText="<%$ Resources:DueDateHeader %>" DataField="DueDate" 
                DataFormatString="{0:d}" DataType="System.DateTime"></telerik:GridBoundColumn> 
            <telerik:GridBoundColumn HeaderText="<%$ Resources:OriginalAmountHeader %>" DataField="OriginalAmount" 
                DataFormatString="{0:N}" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn HeaderText="<%$ Resources:OpenAmountHeader %>" DataField="OpenAmount" 
                DataFormatString="{0:N}" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right">  
            </telerik:GridBoundColumn> 
        </Columns> 
        <DetailTables> 
            <telerik:GridTableView Width="100%">  
                <Columns> 
                    <telerik:GridBoundColumn DataField="Field2"></telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Field3"></telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Field4"></telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Field5"></telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Field6"></telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Field7"></telerik:GridBoundColumn> 
                </Columns> 
            </telerik:GridTableView> 
        </DetailTables> 
    </MasterTableView> 
    <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="<%$ Resources:CommonStrings,RadGridPagerTextFormat %>" /> 
</telerik:RadGrid> 
 
protected void btnExportAll_Click(object sender, ImageClickEventArgs e)  
{  
    rgInvoices.ExportSettings.ExportOnlyData = true;  
    rgInvoices.ExportSettings.IgnorePaging = true;  
    rgInvoices.ExportSettings.OpenInNewWindow = true;  
    rgInvoices.ExportSettings.FileName = "InvoiceActivity";  
    rgInvoices.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML;  
    rgInvoices.Columns.FindByUniqueName("PaymentLog").Display = false;  
    rgInvoices.Columns.FindByUniqueName("SelectColumn").Display = false;  
    rgInvoices.MasterTableView.HierarchyDefaultExpanded = true;  
    rgInvoices.Rebind();  
    //foreach (GridItem commandItem in rgInvoices.MasterTableView.GetItems(GridItemType.CommandItem))  
    //{  
    //    commandItem.Visible = false;  
    //}  
 
    rgInvoices.MasterTableView.ExportToExcel();  
} 

The _ExcelML methods are empty so it's not happening because of them.
The initial sort is by Due Date. If I change the sort column, I get that column in the export but nothing else.

This is all I get:
Due Date
11/15/2009 0:00
11/15/2009 0:00
...

Thanks,
Dave
David Louth
Top achievements
Rank 1
 answered on 08 Jul 2010
6 answers
216 views
Telerik,
    I have implemented a version of a character counter I've found on this site.Using tools such as Drip I've found that the javascript leaks memory when using IE. I'm using the Q3 from 2009, and I have access to the latest Telerik library. Would updating it to the newest version help solve some of the problem? Have I implemented the functionality wrong? Do I need to have a cleanup function somewhere in here? I use the character counter on two editors (a short description, and a product description) on the same page. Please let me know if I've done something wrong or if I can implement this function below

          MyModule = function(element) { 
                 MyModule.initializeBase(this, [element]); 
             } 
 
             MyModule.prototype = 
            { 
                initialize: function() { 
                    MyModule.callBaseMethod(this, 'initialize'); 
                    var selfPointer = this; 
                    this.get_editor().add_selectionChange(function() { selfPointer.CountCharAction(); }); 
                    this.get_editor().attachEventHandler("onkeyup", function() { selfPointer.CountCharAction(); }); 
                    this.get_editor().attachEventHandler("onpaste", function() { selfPointer.CountCharAction(); }); 
                    this.get_editor().attachEventHandler("onblur", function() { selfPointer.CountCharAction(); });                     
                    this.CountCharAction(); 
                }, 
                                 
                //A method that does the actual work - it is usually attached to the "selection changed" editor event 
                CountCharAction: function() { 
                    var controlName = this.get_editor(); 
                    var element = this.get_element(); 
                    var chars = 0; 
                    var content; 
 
                    if (controlName.get_id().indexOf("Short") > 0) { 
                        content = this.get_editor().get_html(true); 
                        if (content) { 
                            var punctRegX = /[!\.?;,:&_\-\-\{\}\[\]\(\)~#'"]/g; 
                            var trimRegX = /(^\s+)|(\s+$)/g; 
                            content = content.replace(punctRegX, ""); 
                            content = content.replace(trimRegX, ""); 
 
                            if (content) { 
                                chars = content.length; 
                            } 
                        } 
                        if (chars > 55) { 
                            element.innerHTML = "<span style='line-height:22px; color:#F90A0A'> Characters: " + chars + "&nbsp; Short Description cannot be over 55 characters</span>"; 
                        } 
                        else { 
                            element.innerHTML = "<span style='line-height:22px'> Characters: " + chars + "&nbsp;</span>"; 
                        } 
                    } 
                    else { 
                        content = this.get_editor().get_text(); 
                        if (content) { 
                            var punctRegX = /[!\.?;,:&_\-\-\{\}\[\]\(\)~#'"]/g; 
                            var trimRegX = /(^\s+)|(\s+$)/g; 
                            var removeNL = /[\n\r\t]/g; 
 
                            content = content.replace(removeNL, ""); 
                            content = content.replace(" ", ""); 
                            content = content.split(' ').join(''); 
                            content = content.replace(trimRegX, "").replace(trimRegX, ""); 
 
                            chars = content.length; 
                            if (chars > 22500) { 
                                element.innerHTML = "<span style='line-height:22px; color:#F90A0A'> Characters: " + chars + "&nbsp; Product Description cannot be over 22,500 characters</span>"; 
                            } 
                            else { 
                                element.innerHTML = "<span style='line-height:22px'> Characters: " + chars + "&nbsp;</span>"; 
                            } 
                        } 
                    } 
                } 
            }; 
 
            MyModule.registerClass('MyModule', Telerik.Web.UI.Editor.Modules.ModuleBase); 
    

both editors have this modules line

                            <Modules> 
                              <telerik:EditorModule Name="MyModule" Enabled="true" Visible="true" /> 
                              <telerik:EditorModule Name="RadEditorStatistics" Enabled="true" Visible="false" />                               
                            </Modules>     

Thanks for the help.
Alex
Top achievements
Rank 2
 answered on 08 Jul 2010
2 answers
170 views
Hello,

In this help topic, the scheduler can be localized by creating a global resource file (RadScheduler.Main.resx) and copying it for each language.

Is there a way to tell the scheduler to look at a different (or local) resource file?
The reason for this is that I wish to use the scheduler for several different applications in the same website, each requiring slightly different values in the resx file.

For instance, on one scheduler I want to have the 'ConfirmDeleteText' say 'Are you sure you want to delete this appointment?', but on another I want it to say 'Are you sure you want to delete this availability?'. I tried doing the following:

        protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!IsPostBack) 
            { 
                RadScheduler1.Localization.Show24Hours = "test"; 
            } 
        } 




It showed the word 'test' in the correct spot, but reverted back to the value in the resource file after an AJAX postback. (Using Q3 2009, .NET 2.0)

Thank you,
Josh

Josh
Top achievements
Rank 1
 answered on 08 Jul 2010
7 answers
462 views
Hi,

I am trying to find out how to add table styles to the RadEditor for SharePoint.
We are on version "5.5.0.0". (or at least that's what the folder says)

When I right-click on a table and choose "Table Properties" there is a "CSS Class layout" section that allows you to select different styles for a table like: telerik-reTable-1, telerik-reTable-2, etc.

Is there a way to add a new style to this or, if not, how do I change one of the current styles?

Thanks,
George 
George
Top achievements
Rank 1
 answered on 08 Jul 2010
5 answers
140 views
Hi,
I need help localize the Scheduler.
The culture I need would be German. The culture property of the Scheduler is already set to German, as is the Thread.
What else is necessary for the Scheduler to localize it to German?

Thank you
René
René Hézser
Top achievements
Rank 1
 answered on 08 Jul 2010
2 answers
100 views
Is it possible to localize the RadEditor control on a multilingual site (en, fr) which uses variation labels for localization? If so, how would I go about it?

Terry
Terry
Top achievements
Rank 1
 answered on 08 Jul 2010
3 answers
110 views
Hi

I'm using a RadTreeView inside a RadPane (of a RadSplitter). The RadPane has the overflow: auto property set, i.e. the treeview gets scrolled. This works fine in all browsers, except for IE. Please view the result here.

I am using the 2010.1.519.20 assembly.
Since the panel (with other controls) beneath the RadTreeView gets scrolled correctly it seems like only the RadTreeView has this problem.

Thanks in advance for some help
Kind regards
Roman
Roman
Top achievements
Rank 1
 answered on 08 Jul 2010
7 answers
331 views
Hello,

I saw a lot of nice examples about master/detail grids on your example pages. But I need to display my master/detail data in a different manner.
If there is only one detail record then all data (master and detail) should be displayed in one row, if there  are multiple detailrows then the first row should display the data of the master record together with the data of the first detail row. All further detailrows should only display the detail data. The result should look like follows (text in brackets is only for description):

MasterColumn1, MasterCol2, MasterCol3, DetailCol1,DetailCol2   (first detaildata record)
                                                                   DetailCol1,DetailCol2   (second detaildata record)
MasterColumn1, MasterCol2, MasterCol3, DetailCol1,DetailCol2   (first detaildata record)
                                                                   DetailCol1,DetailCol2   (second detaildata record)
                                                                   DetailCol1,DetailCol2   (third detaildata record)
MasterColumn1, MasterCol2, MasterCol3, DetailCol1,DetailCol2   (first and only detaildata record)


I could transfer my master/detail data in a flat table structure, leaving the master data empty for subsequent detail rows but then the structure gets lost after sorting.

Another possibility could be to display the detail data in a grid nested in a column, so I would have 3 mastercolumns and one column, that displays the 2 detailcolumns in a grid. Could this be done using the RadGrid features ? All examples I saw, are displaying the nested grid below the master record.

Does anybody have an idea how to solve this task ?
Robert

Veli
Telerik team
 answered on 08 Jul 2010
3 answers
108 views
http://www.telerik.com/help/aspnet-ajax/editor_disablehidemodules.html

If I don't need any of the modules, does setting them to visible = false gain any speed or render size? 
Currently I hide the toolbar as well.  It shows as regular multi-line textbox.

            <RadEditor ID="txtAvailabilityDetails" xmltag="AvailabilityDetails" Runat="server" OnClientLoad="OnClientLoadRadEditor" AutoResizeHeight="True" Skin="Simple"
                                  BorderStyle="None" BorderWidth="0px" style="height:auto" ToolProviderID="txtMaterialsRequired"
                                  EditModes="Design" ToolsFile="~\EmptyTools.xml" Height="25px" >
                <Content/>
            </RadEditor>   
Rumen
Telerik team
 answered on 08 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?