Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
188 views

Environment: Internet Explorer 11 (11.0.12) with Document Mode Edge (Default), Telerik UI for ASP.NET AJAX Library Q2 2014 version 2014.2.724

​Steps to reproduce:

1. In Visual Studio, create a new ASP.NET Web Application using the Empty template and the Web Forms as a core reference.
2. Add references to Telerik.Web.UI and Telerik.Web.UI.Skins assemblies.
3. Add the Default.aspx Web Forms item into the root of the project.
4. In Default.aspx page, add the following HTML:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication2.Default" %><br>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
<
html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title></title>
</head>
<body>
  <form id="form1" runat="server">   
   <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
    <telerik:RadEditor ID="RadEditor1" runat="server">
      <Snippets>
        <telerik:EditorSnippet Name="2 Column Div Layout">           
          <!-- Row 1 -->
          <div class="row">
           <div class="span7">
             <div class="row">
              <div class="span4">
                <p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
                </div>
              <div class="span3">
                <p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
                </div>
             </div>
           </div>
          </div>
          <!-- Pad -->
          <div class="pad15"></div>
          <!-- Row 2 -->
          <div class="row">
           <div class="span7">
             <div class="row">
              <div class="span4">
                <p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
              </div>
              <div class="span3">
                <p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
              </div>
             </div>
           </div>
          </div>
        </telerik:EditorSnippet>
      </Snippets>
    </telerik:RadEditor>
  </form>
</body>
</html>

5. Build and run the project using IE 11.
6. In the Editor control click the Insert Code Snippet button and select the 2 Column Div Layout code snippet.
7. Switch to the HTML tab and then back to Design one.
8. Click the Insert Code Snippet button and select the 2 Column Div Layout code snippet one more time.

Actual Result:

<!-- Row 1 -->
<div class="row">
<div class="span7">
<div class="row">
<div class="span4">
<p>
<!-- Row 1 -->
<div class="row">
<div class="span7">
<div class="row">
<div class="span4">
</div>
</div>
</div>
</div>
</p>
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
<p>
<div class="row">
<div class="span7">
<div class="row">
<div class="span3">
</div>
</div>
</div>
</div>
<!-- Pad -->
<div class="pad15">&nbsp;</div>
<!-- Row 2 -->
<div class="row">
<div class="span7">
<div class="row">
<div class="span4">
</div>
</div>
</div>
</div>
</p>
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et. </p>
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et. </p>
<p>
<div class="row">
<div class="span7">
<div class="row">
<div class="span3">
</div>
</div>
</div>
</div>
Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
</div>
<div class="span3">
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
</div>
</div>
</div>
</div>
<!-- Pad -->
<div class="pad15">&nbsp;</div>
<!-- Row 2 -->
<div class="row">
<div class="span7">
<div class="row">
<div class="span4">
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
</div>
<div class="span3">
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
</div>
</div>
</div>
</div>

Expected Result:

<!-- Row 1 -->
<div class="row">
<div class="span7">
<div class="row">
<div class="span4">
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
</div>
<div class="span3">
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
</div>
</div>
</div>
</div>
<!-- Pad -->
<div class="pad15">&nbsp;</div>
<!-- Row 2 -->
<div class="row">
<div class="span7">
<div class="row">
<div class="span4">
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et. </p>
</div>
<div class="span3">
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et. </p>
</div>
</div>
</div>
</div>
<!-- Row 1 -->
<div class="row">
<div class="span7">
<div class="row">
<div class="span4">
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
</div>
<div class="span3">
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et.</p>
</div>
</div>
</div>
</div>
<!-- Pad -->
<div class="pad15">&nbsp;</div>
<!-- Row 2 -->
<div class="row">
<div class="span7">
<div class="row">
<div class="span4">
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et. </p>
</div>
<div class="span3">
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus, suspendisse ac nec et. </p>
</div>
</div>
</div>
</div>

Note:
If you skip step #7 the Actual Result would be different, but still incorrect:
<!-- Row 1 --><br>
<div class="row"><br>
<div class="span7"><br>
<div class="row"><br>
<div class="span4"><br>
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus,<br>
suspendisse ac nec et.</p><br>
</div><br>
<div class="span3"><br>
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus,<br>
suspendisse ac nec et.</p><br>
</div><br>
</div><br>
</div><br>
</div><br>
<!-- Pad --><br>
<div class="pad15">&nbsp;</div><br>
<!-- Row 2 --><br>
<div class="row"><br>
<div class="span7"><br>
<div class="row"><br>
<div class="span4"><br>
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus,<br>
suspendisse ac nec et. </p><br>
</div><br>
<div class="span3"><br>
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus,<br>
suspendisse ac nec et.<br>
<!-- Row 1 --><br>
<div class="row"><br>
<div class="span7"><br>
<div class="row"><br>
<div class="span4"><br>
</div><br>
</div><br>
</div><br>
</div><br>
</p><br>
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus,<br>
suspendisse ac nec et.</p><br>
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus,<br>
suspendisse ac nec et.</p><br>
<p><br>
<div class="row"><br>
<div class="span7"><br>
<div class="row"><br>
<div class="span3"><br>
</div><br>
</div><br>
</div><br>
</div><br>
<!-- Pad --><br>
<div class="pad15">&nbsp;</div><br>
<!-- Row 2 --><br>
<div class="row"><br>
<div class="span7"><br>
<div class="row"><br>
<div class="span4"><br>
</div><br>
</div><br>
</div><br>
</div><br>
</p><br>
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus,<br>
suspendisse ac nec et. </p><br>
<p>Enim ultrices, elementum phasellus. Mauris sed nulla sed, egestas feugiat a dictum libero, nunc sapien tri tique facilisis venenatis risus,<br>
suspendisse ac nec et. </p><br>
</div><br>
</div><br>
</div><br>
</div>

Oleg
Top achievements
Rank 1
 answered on 10 Oct 2014
2 answers
76 views
HI,

I have a standalone RadLivetile that gets populated by a PageMethod (Webmethod).
In certain situations I want to stop calling of the Pagemethod that populates the tile, i.e. the tile should stop updating itself.
I tried to use

var livetile = $find("<%=RadLiveTile1.ClientID %>");

livetile.set_updateInterval(0);

but the Pagemethod is still called, i.e. the above call has no effect !

I run Windows 8.1 and see the Problem on all Major Browsers (IE,FF,Chrome)

Is this a bug i.e. do other People have the same problem or am I doing something wrong ?

Really hope someone can help !
Every Feedback is highly appreciated.
Best regards
Hans-Juergen





​
Hans-Jürgen
Top achievements
Rank 1
 answered on 10 Oct 2014
1 answer
102 views
Hello,

I am hoping someone can help me with my code.  I have an user control which contains a single RadCombobox.  This is the code.

<tlrk:RadComboBox
 ID="InternalComboBox"
 runat="server"
 HighlightTemplatedItems="true"  >
 <ItemTemplate>
 <div onclick="StopPropagation(event)" >                                   
  <asp:CheckBox ID="ComboCheckBox" runat="server" CssClass="formTextElevenPx" style="vertical-align: middle;" />
  <span id="CheckBoxLabel" runat="server"><%# DataBinder.Eval(Container, "Text")%></span>
 </div>
 </ItemTemplate>
</tlrk:RadComboBox>

I use some Javascript in this page and in my page_prerender event I call the javascript.

<script type="text/javascript">
 
function StopPropagation(e) {
  //cancel bubbling
  e.cancelBubble = true;
  if (e.stopPropagation) {
   e.stopPropagation();
  }
 }
 
 function onCheckBoxClick_<% =uniqueKey %>() {
  var combo = $find("<%= InternalComboBox.ClientID %>");
   UpdateMessage(combo);
 }
 function UpdateMessage(combo) {  
  var items = combo.get_items();
  var text = "";
  for (var i = 1; i < items.get_count(); i++) {
   var item = items.getItem(i);
   var chk1 = $get(combo.get_id() + '_i' + i + '_ComboCheckBox');
   if (chk1.checked)
    text+= item.get_text() + ", ";
  }
  return text.trim();
 }
 
</script>

I call this Javascript in the onclick event of the RadComboCheckbox like this -
protected string uniqueKey;
 protected void Page_PreRender(object sender, EventArgs e)
 
  this.uniqueKey = Guid.NewGuid().ToString("N");
  foreach (RadComboBoxItem i in InternalComboBox.Items)
  {
   CheckBox cbx = i.FindControl("ComboCheckBox") as CheckBox;
   if (cbx != null)
   {
    cbx.Attributes["onclick"] = "return onCheckBoxClick_" + uniqueKey + "()";
   }
  }

So I call the javascript in the cbx.Attributes["onclick"] event.  

This user control when placed in a normal page works without any issues.  But when I place the usercontrol inside a Radwindow then the javascript associated with the usercontrol -onCheckBoxClick will not load and it shows an Reference not found javascript error.  Why does this happen and how would I fix it.  Would appreciate any help you can provide me.

Thanks
Boyan Dimitrov
Telerik team
 answered on 10 Oct 2014
3 answers
147 views
Hello, 

I have a problem with my RadMenu, the text in the RadMenu Item is centered but the item itself isn't centered.

Please take a look at the attached file for more info.

I obviously tried putting CSS on the different classes in the skin but I havent been able to move that 'blue/green' block to the center. 

Thanks !
Mark
Top achievements
Rank 1
 answered on 10 Oct 2014
8 answers
520 views
Hi Sir,

i Want to Create Dynamic RadScheduler Context Menu.

Like In Blank Row Of Scheduler Context Menu Appear New and Disable Paste Menu.

And Where Appointment is given Then There Context Menu Appear Like Edit, Copy, Paste, Cut etc. When I Copy Any Appointment and then Again go to blank Row then Context menu appear New And Paste Option. How can Achive this type of Condition. Please Help Me.


Thanks
Chandan Kumar.
Hristo Valyavicharski
Telerik team
 answered on 10 Oct 2014
17 answers
268 views
radasyncupload doesn't work in IE 9. does anybody have any idea?
Hristo Valyavicharski
Telerik team
 answered on 10 Oct 2014
1 answer
117 views
Hi,

It is a very simple and specific requirement in attached image. Please help according to image

Want to show Project name in column than in scheduler i want to show in which stage a specific project on specific date.


Please help.
Hristo Valyavicharski
Telerik team
 answered on 10 Oct 2014
1 answer
481 views
Hi all,

Using VS 2010 with UI for ASP.NET AJAX Q2 2014 SP1. 

My intentions are:

1) Export only Parent Grid and 2 Child Grid Rows in Each page.
2) Repeat the Parent Grid Column Header in each New Page.
3) Bottom of PDF export, show page count (i.e. 1 of n etc.).
4) If Last Page has only 1 child row, export it with Parent Grid.Below are my codes and attached is desired PDF export.

Thanks

gc_0620

_______________

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager runat="server" ID="ScriptManager1" />
    <div>
        <telerik:RadGrid Skin="Web20" ID="RadGrid1" ShowStatusBar="True" DataSourceID="SqlDataSource1"
            runat="server" AutoGenerateColumns="False" AllowPaging="True"
            AllowMultiRowEdit="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True" EnableLinqExpressions="False" AutoGenerateDeleteColumn="True"
            AutoGenerateEditColumn="True" OnPdfExporting="RadGrid1_PdfExporting"
            OnItemCreated="RadGrid1_ItemCreated"
            onitemdatabound="RadGrid1_ItemDataBound" ResolvedRenderMode="Classic">
            <ExportSettings>
                <Pdf PageTitle="Rad Grid Selected Customers Export" />
            </ExportSettings>
            <PagerStyle Mode="NumericPages"></PagerStyle>
            <MasterTableView DataSourceID="SqlDataSource1" Name="Master" DataKeyNames="CustomerID"
                CommandItemDisplay="Top">
                <DetailTables>
                    <telerik:GridTableView Name="Orders" DataKeyNames="OrderID" CommandItemDisplay="Top"
                        DataSourceID="SqlDataSource2" Width="100%" runat="server">
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="CustomerID" MasterKeyField="CustomerID" />
                        </ParentTableRelation>
                        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                        <Columns>
                            <telerik:GridBoundColumn SortExpression="OrderID" HeaderText="OrderID" HeaderButtonType="TextButton"
                                DataField="OrderID" UniqueName="OrderID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="OrderDate" HeaderText="Date Ordered" HeaderButtonType="TextButton"
                                DataField="OrderDate" UniqueName="OrderDate" DataFormatString="{0:D}">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Freight" HeaderText="Freight" HeaderButtonType="TextButton"
                                DataField="Freight" UniqueName="Freight">
                            </telerik:GridBoundColumn>
                        </Columns>
                        <EditFormSettings EditFormType="Template">
                            <FormTemplate>
                                <table id="ChildTableMain" class="form-controls" cellspacing="2" cellpadding="1"
                                    width="99.9%" border="0" rules="none" style="border-collapse: collapse; background: #DCDCDC; border-width:0px;">
                                    <colgroup>
                                        <col />
                                    </colgroup>
                                    <tr>
                                        <td>
                                            <asp:Label ID="OrderDetailLabel" CssClass="form-edit_Update" runat="server" Text="Order details"
                                                Font-Underline="True"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <table id="ChildTableDetail" border="0" style="border-width: 0px;" class="form-controls"
                                                width="99.9%">
                                                <colgroup>
                                                    <col />
                                                    <col />
                                                    <col />
                                                    <col />
                                                </colgroup>
                                                <tr>
                                                    <td style="font-size: 11px">
                                                        Order ID:
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TxtOrderID" runat="server" Text='<%# Bind( "OrderID") %>' TabIndex="1" />
                                                    </td>
                                                    <td style="font-size: 11px">
                                                        Date Ordered:
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TxtOrderDate" runat="server" Width="200px" Text='<%# Bind( "OrderDate","{0:D}") %>'
                                                            TabIndex="2" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="font-size: 11px">
                                                        Freight:
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TxtFreight" Width="300px" runat="server" Text='<%# Bind( "Freight") %>'
                                                            TabIndex="3">
                                                        </asp:TextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </FormTemplate>
                        </EditFormSettings>
                        <SortExpressions>
                            <telerik:GridSortExpression FieldName="OrderDate"></telerik:GridSortExpression>
                        </SortExpressions>
                    </telerik:GridTableView>
                </DetailTables>
                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                <ExpandCollapseColumn Visible="True">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="CustomerID" HeaderText="CustomerID" DataField="CustomerID"
                        UniqueName="CustomerID" ReadOnly="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="CompanyName" HeaderText="CompanyName" DataField="CompanyName"
                        UniqueName="CompanyName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="ContactName" HeaderText="ContactName" DataField="ContactName"
                        UniqueName="ContactName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Address" HeaderText="Address" SortExpression="Address"
                        UniqueName="Address">
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings EditFormType="Template">
                    <FormTemplate>
                        <table id="Table2" class="form-controls" cellspacing="2" cellpadding="1" width="99.9%"
                            border="0" rules="none" style="border-collapse: collapse; background: #DCDCDC; border-width:0px;">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                    <asp:Label ID="CustDetailLabel" CssClass="form-edit_Update" runat="server" Text="Customer details"
                                        Font-Underline="True"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table id="TableDetail" border="0" class="form-controls" style="border-width: 0px"
                                        width="99.9%">
                                        <colgroup>
                                            <col />
                                            <col />
                                            <col />
                                            <col />
                                        </colgroup>
                                        <tr>
                                            <td style="font-size: 11px">
                                                Customer Id:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtCustomer" runat="server" Text='<%# Bind( "CustomerID") %>' TabIndex="1" />
                                            </td>
                                            <td style="font-size: 11px">
                                                Contact Name:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtContact" runat="server" Width="200px" Text='<%# Bind( "ContactName") %>'
                                                    TabIndex="2" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="font-size: 11px">
                                                Company:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtCompany" Width="200px" runat="server" Text='<%# Bind( "CompanyName") %>'
                                                    TabIndex="3">
                                                </asp:TextBox>
                                            </td>
                                            <td style="font-size: 11px">
                                                Address:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtAddress" Width="300px" runat="server" Text='<%# Bind( "Address") %>'
                                                    TabIndex="3">
                                                </asp:TextBox>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr visible="false">
                                <td align="right" colspan="2">
                                    <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                    </asp:Button>
                                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                        CommandName="Cancel"></asp:Button>
                                </td>
                            </tr>
                        </table>
                    </FormTemplate>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
        </telerik:RadGrid>
        <br />
        <asp:Button ID="Button1" runat="server" Text="Export selected items with child items"
            OnClick="Button1_Click" />
        <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [Address] FROM [Customers] WHERE ([CustomerID] <= @CustomerID)"
            runat="server" DeleteCommand="DELETE FROM [Customers] WHERE [CustomerID] = @CustomerID"
            InsertCommand="INSERT INTO [Customers] ([CustomerID], [CompanyName], [ContactName], [Address]) VALUES (@CustomerID, @CompanyName, @ContactName, @Address)"
             
            UpdateCommand="UPDATE [Customers] SET [CompanyName] = @CompanyName, [ContactName] = @ContactName, [Address] = @Address WHERE [CustomerID] = @CustomerID">
            <DeleteParameters>
                <asp:Parameter Name="CustomerID" Type="String" />
            </DeleteParameters>
            <SelectParameters>
                <asp:Parameter DefaultValue="BLAUS" Name="CustomerID" Type="String" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="CompanyName" Type="String" />
                <asp:Parameter Name="ContactName" Type="String" />
                <asp:Parameter Name="Address" Type="String" />
                <asp:Parameter Name="CustomerID" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="CustomerID" Type="String" />
                <asp:Parameter Name="CompanyName" Type="String" />
                <asp:Parameter Name="ContactName" Type="String" />
                <asp:Parameter Name="Address" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Orders Where CustomerID = @CustomerID"
            runat="server">
            <SelectParameters>
                <asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="string" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
_____________________
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;
using System.Data.SqlClient;
using Telerik.Web.UI.GridExcelBuilder;
using System.Collections.Specialized;
using System.Collections;
using System.IO;
using System.Text;
using System.Globalization;
using System.Threading;
 
public partial class _Default : System.Web.UI.Page
{
    private void Set_Export_Options()
    {
        //Landscape  
        RadGrid1.ExportSettings.Pdf.PageHeight = Unit.Parse("8.5in");
        RadGrid1.ExportSettings.Pdf.PageWidth = Unit.Parse("11in");
 
        //// 1/2 inch margins  
        RadGrid1.ExportSettings.Pdf.PageLeftMargin = Unit.Parse(".5in");
        RadGrid1.ExportSettings.Pdf.PageRightMargin = Unit.Parse(".5in");
        RadGrid1.ExportSettings.Pdf.PageTopMargin = Unit.Parse(".5in");
        RadGrid1.ExportSettings.Pdf.PageBottomMargin = Unit.Parse(".5in");
 
        RadGrid1.ExportSettings.OpenInNewWindow = true;
        RadGrid1.ExportSettings.IgnorePaging = true;
        RadGrid1.ExportSettings.ExportOnlyData = true;
        RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
    }
    public void Configure_Selected_Row_Pdf_Export(GridItem item)
    {
        if (item.IsInEditMode)
        {
            item.OwnerTableView.BorderWidth = Unit.Pixel(0);
 
            item.Style["border-width"] = "0px";
            item.Style["text-align"] = "center";
            item.Style["font-family"] = "Arial";
            if (item.OwnerTableView.Name == "Master")
            {
                item.Style["background-color"] = "#555";
                item.Style["color"] = "#fff";
            }
 
            else
            {
                item.Style["background-color"] = "#aaa";
            }
        }
    }
 
    bool isExport = false;
    string selectedItem = "";
    protected void Button1_Click(object sender, EventArgs e)
    {
        Set_Export_Options();
        isExport = true;
        selectedItem = RadGrid1.SelectedIndexes[0];
        RadGrid1.MasterTableView.ExportToPdf();
    }
 
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (isExport)
        {
            if (e.Item.OwnerTableView.Name == "Master" && e.Item.ItemIndexHierarchical != selectedItem)
            {
                e.Item.Display = false;
                e.Item.Expanded = false;
            }
            else if (e.Item is GridDataItem || e.Item is GridHeaderItem)
            {
                e.Item.Edit = true;
                e.Item.Display = false;
                e.Item.Style.Add("display", "none");
            }
 
           
        }
    }
 
    protected void RadGrid1_PdfExporting(object sender, GridPdfExportingArgs e)
    {
        e.RawHTML = e.RawHTML.Replace("99.9%", "696px");
 
        
    }
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if(isExport)
            Configure_Selected_Row_Pdf_Export(e.Item); 
    }
}

Kostadin
Telerik team
 answered on 10 Oct 2014
1 answer
136 views
This isn't so much a question as feedback since I'm not able to post code due to the nature of my job, but I have a page where I'm using a RadTabStrip and RadMultiPage and on one of those pages I have a RadGrid being filled with data from an ObjectDataSource in an n-Tier application.  The RadGrid works great, it fills with all my GridBound columns, I've set OverrideDataSourceControlSorting to allow it to sort my custom object with no problems.

However, when I attempted to use CommandItemTemplate I ran into a pretty significant formatting issue.  The default CommandItemDisplay (add and refresh) appear fine, but as soon as I add the CommandItemTemplate all my columns and data formatting disappear.  The columns don't show up at all and everything is on a single line without formatting, including the CommandItemDisplay area.  I was using the skin "WebBlue" and even that wasn't showing, it was a big white box with everything crammed together.

I spent quite a bit of time attempting to find a solution including copying your CommandItemTemplate demo code into a new page and what I found is that the ObjectDataSource seems to be causing an issue.  I don't know what it is (custom object maybe?) but it was frustrating to not be able to find any solution or anyone using the same structure as I am. 

Is there something I'm missing about using an ObjectDataSource that the RadGrid would be handling differently than an SQLDataSource?  It seems to me that it should just be looking for the column information and not care where it's coming from...
Konstantin Dikov
Telerik team
 answered on 10 Oct 2014
13 answers
868 views
Hi All,

I used RadAjaxManager,RadAjaxLoadingPanel,RadTabstrip,RadGrid..scriptmanager

In pageveiw contain grid ,dropdown and button. 
When i click on one control before it's processing done i click on another control it gives me the error as

Microsoft JScript runtime error: Sys.InvalidOperationException: A control is already associated with the element.

Slav
Telerik team
 answered on 10 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?