Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
97 views
Hi,

I have a specific need to make the GridGroupHeaderItem to be selectable and should be able to handle the selection change too.  I appreciate any help with example.  Also how to embedd image in the GridGroupHeader?

Thanks,
Indira
Indira
Top achievements
Rank 1
 answered on 08 Jul 2010
2 answers
209 views
Hello Telerik!

I am trying to use some attributes like 'fore- and background-color', from the current selected Skin, for my own Controls.

For Example I implemented a variation of your BreadCrump-Example.
Your Example has an orange colored DIV in front of the BreadCrump.

It's easy to change the color to, let us say green, by editing the style for that DIV in my own CSS.

Now I will change the color of that DIV by changing the style with the SkinChooser.

For Example, if I change the Skin to 'Vista' all the Grids will have a nice blue colored Header.
Only my BreadCrum is still in green (look's very ugly).

In best case I will read the current color of the Grid-Header and use it on my BreadCrump-DIV, without having other "external" CSS-Files or multiple definitions in my CSS for it.

Is this possible?
If yes, how can it be done?

Many Thanks for your help!

Regards
Marcel
Marcel Rossi
Top achievements
Rank 2
 answered on 08 Jul 2010
2 answers
118 views
Hello Group,

I'm attempting to use the GridCalculatedColumn to negate a number coming from my DB but i'm having some troubles.

Telerik.Web.UI version = 2009.3.1314.35

My aspx markup is
<telerik:GridCalculatedColumn UniqueName="VisitAmountCol" HeaderText="Visit Amt."
DataFormatString="{0:C}"  Expression="{0}*-1"
DataFields="visit.visitcost" />

This markup throws the following exception.
Exception Details: Telerik.Web.UI.ParseException: ')' or ',' expected


Any help is greatly appreciated.
Many Thanks!
Will



Will Skelton
Top achievements
Rank 1
 answered on 08 Jul 2010
4 answers
445 views
I've got a gridview (regular one, not radgrid) with a radcombobox in a data column (read: there'll be many on the page, one per row). Its server ID is "ddProduct" for example. I need to be able to access and change the value of a specific row's dropdown via javascript.

I know how to change the selected value via JS using the $find() function, but I am having trouble handling the fact that there are many of this radcombobox with the same server id.

I do have some ways of identifying what row's ddProduct I want to change via javascript, but I'm not sure how I can utilize that in the $find() function...

Any advice?
Jan Peek
Top achievements
Rank 1
 answered on 08 Jul 2010
1 answer
467 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
149 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
194 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
162 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
455 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
137 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?