Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
193 views
Hi,
I am using SelfHierarchy within my RadGrid and would like to use ExportToExcel and ExportToWord functionality. But when I export to excel or word, I see command buttons and other data are exported as-well. For example I use below code to export rows collapsed.
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
 {
     if (e.CommandName.Contains("Export"))
     {
         RadGrid theGrid = (RadGrid)source;
         theGrid.MasterTableView.HierarchyDefaultExpanded = false;
     }
 }
Excel is OK but Word is totally messed. I see buttons and details tables are exported too.
Petya
Telerik team
 answered on 11 Jan 2016
3 answers
104 views

Hi Team,

I am using Rad Grid in my project. I want to expand row template on click of row from client side. The code runs fine but when I put ASP .Net Update panel, code stops running after page postback. Below is my code. I am implementing this under DNN site.

 

Update panel code:

<asp:UpdatePanel ID="updOnlinePaymentHistory" runat="server">
        <ContentTemplate>

               ..........

</ContentTemplate>
    </asp:UpdatePanel>

 javascript function:

function RowClick(sender, args) {
              var item = args.get_item();
              var lastState = item.get_expanded();
              var Grid = $find("<%= gridPayment.ClientID %>");
              var MasterTable = Grid.get_masterTableView();
              for (var i = 0; i < MasterTable.get_dataItems().length; i++) {
                var row = MasterTable.get_dataItems()[i];
                row.set_expanded(false);
              }
              item.set_expanded(!lastState);

        }

 

HTML defining Rad Grid:

<telerik:RadGrid ID="gridPayment" 
                                AllowPaging="true" 
                                PageSize="24" 
                                runat="server" 
                                AllowSorting="true" 
                                CellSpacing="0" 
                                GridLines="Horizontal" 
                                CssClass="table-responsive"
                                OnItemDataBound="grdPayment_ItemDataBound" 
                                OnPageIndexChanged="gridPayment_PageIndexChanged" 
                                EnableGroupsExpandAll="false" 
                                RegisterWithScriptManager="False">

 

                                   <!-- column and template code here -->

 

                                 <ClientSettings>
                                    <ClientEvents OnRowClick="RowClick" />
                                </ClientSettings>

                     </telerik:RadGrid>

 

When I load page, row expand works fine. but after postback of page, it stops working.

 

Can you please help me out on this.

 

Chirag Khunti

 

Maria Ilieva
Telerik team
 answered on 11 Jan 2016
12 answers
316 views

Hi,

I am having major problems with the RadEditor control.
What makes this particularly troublesome is that it works in IE11
but not Chrome.

I have a RadEditor which is embedded within an asp:ListView control (see below) whic in turn, is embedded into ans ascx user control.


The general idea is that the code behind hides and shows different controls in the ListView rows according to the configuration of a property panel.

When the user makes a selection on the page, the user control is made visible and the asp:ListView below is updated with a new DataBind().

<asp:ListView ID="lveProperties" runat="server"
OnItemDataBound="lveProperties_ItemDataBound">


        <ItemTemplate>





            <asp:Panel ID="pnlProperty" runat="server">


                <div class="row">


                    <asp:Literal ID="litBannerSpacer1"
runat="server" Text="<br />"
Visible="false"></asp:Literal>


                    <div class="<%=col1Width%>
coursenames">


                        <asp:Label ID="lblPropertyName"
runat="server"></asp:Label>


                    </div>


                    <div class="<%=col2Width%>
coursenames">


                        <asp:CheckBox ID="chkCheck"
runat="server" Visible="False"></asp:CheckBox>


                        <telerik:RadTextBox ID="txtText"
runat="server" Visible="false"></telerik:RadTextBox>


                        <telerik:RadNumericTextBox ID="txtNumber"
runat="server" Type="Number"
Visible="false"></telerik:RadNumericTextBox>


                        <telerik:RadComboBox ID="ddlList"
runat="server" Visible="false"
MaxHeight="200"></telerik:RadComboBox>


                        <telerik:RadDatePicker ID="dpDate"
runat="server" Visible="false"
MinDate="1900/01/01"></telerik:RadDatePicker>


                        <telerik:RadEditor ID="txtNText"
runat="server" Visible="false" EditModes="Design,Html"
NewLineMode="Br">


                            <CssFiles>


                                <telerik:EditorCssFile
Value="/Styles/RadEditorContentAreaStyles.css" />


                            </CssFiles>


                            <Languages>


                                <telerik:SpellCheckerLanguage
Code="en-US" Title="English (US)" />


                                <telerik:SpellCheckerLanguage
Code="fr-FR" Title="French" />


                                <telerik:SpellCheckerLanguage
Code="de-DE" Title="German" />


                            </Languages>


                            <Tools>


                                <telerik:EditorToolGroup>


                                    <telerik:EditorTool
Name="Cut" />


                                    <telerik:EditorTool
Name="Copy" ShortCut="CTRL+C" />


                                    <telerik:EditorTool
Name="Paste" ShortCut="CTRL+V" />


                                    <telerik:EditorSeparator
Visible="true" />


                                    <telerik:EditorTool
Name="Undo" />


                                    <telerik:EditorTool
Name="Redo" />


                                </telerik:EditorToolGroup>


                                <telerik:EditorToolGroup>


                                    <telerik:EditorTool
Name="Bold" />


                                    <telerik:EditorTool
Name="Underline" />


                                    <telerik:EditorTool
Name="Italic" />


                                    <telerik:EditorTool
Name="StrikeThrough" />


                                    <telerik:EditorSeparator
Visible="true" />


                                    <telerik:EditorTool
Name="JustifyLeft" />


                                    <telerik:EditorTool
Name="JustifyCenter" />


                                    <telerik:EditorTool
Name="JustifyRight" />


                                    <telerik:EditorSeparator
Visible="true" />


                                    <telerik:EditorTool
Name="InsertOrderedList" />


                                    <telerik:EditorTool
Name="InsertUnorderedList" />


                                    <telerik:EditorSeparator
Visible="true" />


                                    <telerik:EditorTool
Name="Indent" />


                                    <telerik:EditorTool
Name="Outdent" />


                                </telerik:EditorToolGroup>


                                <telerik:EditorToolGroup>


                                    <telerik:EditorTool
Name="ForeColor" />


                                    <telerik:EditorTool
Name="BackColor" />


                                    <telerik:EditorTool
Name="InsertTable" />


                                </telerik:EditorToolGroup>


                                <telerik:EditorToolGroup>


                                    <telerik:EditorTool
Name="FontName" />


                                    <telerik:EditorTool
Name="RealFontSize" />


                                </telerik:EditorToolGroup>


                                <telerik:EditorToolGroup>


                                    <telerik:EditorTool
Name="AjaxSpellCheck" />


                                </telerik:EditorToolGroup>


                            </Tools>


                        </telerik:RadEditor>


                    </div>


                    <asp:Literal ID="litBannerSpacer2"
runat="server" Text="<br /><br />"
Visible="false"></asp:Literal>


                </div>


            </asp:Panel>





Part of this process sets the RadEditor properties:





                        txtNText.Visible = true;


                        txtNText.Width =
Unit.Parse(property.ControlWidth);        // eg "100%"


                        txtNText.Height =
Unit.Parse(property.ControlHeight);      // eg "300"


                        txtNText.MaxTextLength = property.MaxLength;


                        currentValue = GetZoneProperty(0,
languageId, property.PropertyName);


                        if (currentValue == "") currentValue =
defaultValue;


                        txtNText.Content = currentValue;


                        txtNText.Enabled = enabled;





                        // Spell checking


                        txtNText.SpellCheckSettings.AllowAddCustom =
true;



txtNText.SpellCheckSettings.SpellCheckProvider =
SpellCheckProvider.PhoneticProvider;





In IE11, when the RadEditor appears with text populated, it is
correct, however in Chrome, is appears with a single line (see image
attachment).





While debugging the DOM in both IE11 and Chrome, I note that the
iframe is only a few pixels high. IE11 seems to ignore this whereas
Chrome doesn't. I tried various ways, including all of those on the
Telerik forums to 'get' the iframe and set its height, but for some
reason, none of them worked. The Chrome DOM showed this:





<td
id="ctl00_ContentPlaceHolder_ctlZonePropertyPanel_lveProperties_ctrl1_txtNTextCenter"
class="reContentCell" style="height:100%;">


    <label
for="ctl00_ContentPlaceHolder_ctlZonePropertyPanel_lveProperties_ctrl1_txtNTextContentHiddenTextarea"
style="display:none;">RadEditor hidden textarea</label>


    <textarea
id="ctl00_ContentPlaceHolder_ctlZonePropertyPanel_lveProperties_ctrl1_txtNTextContentHiddenTextarea"
name="ctl00$ContentPlaceHolder$ctlZonePropertyPanel$lveProperties$ctrl1$txtNText"
rows="4" cols="20" style="display:none;">%3cp
style%3d%22text-align%3a center%3b%22%3e%3cspan style%3d%22color%3a
%23002060%3b font-size%3a 18px%3b%22%3eWelcome to the Bushfire
Safety Package


%3c/span%3e%3c/p%3e


%3cp%3e


%3cspan style%3d%22color%3a %23002060%3b%22%3eLorem ipsum
dolor.....</textarea>


    <iframe frameborder="0"
src="javascript:'<html></html>';"
id="ctl00_ContentPlaceHolder_ctlZonePropertyPanel_lveProperties_ctrl1_txtNText_contentIframe"
title="Rich text editor with ID
ctl00_ContentPlaceHolder_ctlZonePropertyPanel_lveProperties_ctrl1_txtNText"
style="width: 100%; height: 35px; margin: 0px; padding:
0px;">Your browser does not support inline frames or is currently
configured not to display inline frames.</iframe>


</td>





My RadEditor control is called txtNText so quite how the name has been changed to ...textNTextCenter I don't know.

Even using document.getElementById on ''ctl00_ContentPlaceHolder_ctlZonePropertyPanel_lveProperties_ctrl1_txtNText_contentIframe"
did not find the iframe - how can this be ? All the sample solutions eg:

var editorIframe = $get(editorClientID).getElementsByTagName('iframe')[0];
editorIframe.style.height = '100%';

$('#' + editorClientID).setSize('100%','300px');

Failed to find the iframe.

How can I fix this please ?

Better still, can we have a JavaScript API added to the RadEditor which can be called which just 'works' and fixes this ?

Thankyou

 

PS: Why does pasting into this editor cut all my lines in half and why does it insert a blank line between every line ? This is a nuisance!

Marin Bratanov
Telerik team
 answered on 11 Jan 2016
1 answer
79 views
is there any sample available anywhere in this world that works telerik grids in sharepoint provider hosted app deployed to azure app service?
Pavlina
Telerik team
 answered on 11 Jan 2016
3 answers
160 views

I've seen this snippet of code on the forums which supposedly moves the gantt view to the current date:

 this.RadGantt1.ScrollingService.ScrollToDateTime(DateTime.Today);

Unfortunately it seems to be deprecated and I can't find a suitable option in the help (or in the control methods).

Any help would be appreciated.

 

thanks.

Bozhidar
Telerik team
 answered on 11 Jan 2016
3 answers
122 views
hi.
can you help me to set a tooltip to htmlchart item with radtooltipmanager?
i need the id of items to set to radtooltipmanager:
RadToolTipManager.TargetControls.Add(ID,"", true);

thanks.
Marin Bratanov
Telerik team
 answered on 11 Jan 2016
1 answer
89 views

Hello, Happy New Year everyone.

I set up the scheduler using the example for advanced insert template as described here: http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx

 

I added a method for the click event of the insert button, to so some custom code, and appointment validation. For example I'm checking our database to make sure there is no appointment conflict.

The issue i'm having is that if I handle an exception in that event, the advanced insert form template modal still continue to process, closes, and still hits the insert appointment method for the RadScheduler on the default page.

I would like to keep the modal open until all validation passes, then proceed, is there a way to do this? Or is there a  way to programatically reopen the modal?

 Thanks

 

Plamen
Telerik team
 answered on 11 Jan 2016
1 answer
89 views
I have a RadRotator which is bound to a list of business objects, the RadRotator is placed inside a tile and the user has a requirement to copy the contents that are displayed on the tile (Content Tile). I am not able to click select and copy the contents, the tile contents render as an image, is there a way by which the list that is bound to the rotator can be copied to the clipboard?
Marin Bratanov
Telerik team
 answered on 11 Jan 2016
4 answers
141 views
Hi,
How to Saving and restoring settings for telerik rad tile list like Grid - Persisting Grid Settings?

Thanks & Regards
Anzar.M
Marin Bratanov
Telerik team
 answered on 11 Jan 2016
5 answers
617 views
<telerik:RadGrid ID="RadGrid1" ShowStatusBar="true" GridLines="None" runat="server" AllowAutomaticDeletes="True" 
    AllowAutomaticInserts="True" OnNeedDataSource="RadGrid1_NeedDataSource" PageSize="10" 
    AllowAutomaticUpdates="True" AllowPaging="True" MasterTableView-AllowAutomaticInserts="true" 
    AutoGenerateColumns="True" AutoGenerateDeleteColumn="true" AutoGenerateEditColumn="true"   
    OnInsertCommand="RadGrid1_InsertCommand" OnUpdateCommand="RadGrid1_UpdateCommand" 
     Skin="Web20" OnDeleteCommand="RadGrid1_DeleteCommand">  
    <PagerStyle Mode="NextPrevAndNumeric" /> 
    <MasterTableView InsertItemDisplay="Top">  
    </MasterTableView>   
      
</telerik:RadGrid> 
Hi, This might be a simple issue but I cant figure out what I'm doing wrong. The insert button for the RadGrid is just not showing up like you have in your demos. I'm binding the RADGrid to DataTable with the OnNeedDataSource.  I need the RadGrid to auto generate insert, edit and delete buttons. It does this for the edit and delete buttons but not the insert button. Here is what I have. Please help.

 Thanks
Mahipal
Brian
Top achievements
Rank 2
 answered on 10 Jan 2016
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?