Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
160 views
So I've been trying to use the RadEditor to export content to PDF but I've had very mixed results on what HTML can be added.

I've been reading HTML from another source and then adding it to the content:
RadEditor.Content = stringOfHTML

Here's the HTML I've been using for my content:
<div style="width:700px;">
<div style="width:100%;"><img src="http://www.cloudprojecthosting.com/1050140/Web/Images/imgDCheaderGraphic.png" width="100%" /></div>
 
 
<div style="width:49%; float:left;">
   (%NULL:Author Display Name%)<br/>
  (%NULL:Author Company%)<br/>
 (%NULL:Question%)
</div>
 
<div style="width:49%; float:right;">
   (%NULL:Answer Display Name%)<br/>
   (%NULL:Answer Company%)<br/>
(%NULL:Answer%)
</div>
</div>

If I just add this line it renders in the PDF:
<div style="width:100%;"><img src="http://www.cloudprojecthosting.com/1050140/Web/Images/imgDCheaderGraphic.png" width="100%" /></div>
 But adding any additional lines causes the PDF to open blank?

I've seen older posts where <Table> can't be used because it needs Colgroup and col or something but that was from 2009? 
Do I need to add the content as a specific mode or something?
Rumen
Telerik team
 answered on 25 Feb 2013
0 answers
227 views
Since Q1 2013, the wrapping element of RadButton was changed from an anchor <a> tag to a <span> because the HTML5 specification does not allow nesting <input> elements into <a> tags. If you are using any custom CSS cascades based on the <a> tag, they should be changed to use the <span> tag, e.g.

Old syntax:
a.RadButton .rbDecorated
{
      color: red;
}

New syntax:
span.RadButton .rbDecorated
{
      color: red;
}

You should not experience problems in custom styling scenarios when an anchor was not used in the CSS cascade.
Telerik Admin
Top achievements
Rank 1
Iron
 asked on 25 Feb 2013
4 answers
195 views
I have a hierarchical RadGrid which contains a NestedViewTemplate that has a Panel, TabStrip, and MultiPage inside of it.  On row expand, an ajax request is fired and loads the first tab.  However I would like all of the subsequent tabs to be ajaxified as well.  How can I achieve this?  

Even when I use Design mode and try to add these AjaxControl/AjaxUpdatedControl relationships, I do not have an option for my NestedViewTemplate, TabStrip, and MultiPage (while they are inside the grid)

My code is:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
  <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadMenu1">
      <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelHeight="100%"/>
      </UpdatedControls>
    </telerik:AjaxSetting>
    <telerik:AjaxSetting AjaxControlID="RadGrid1">
      <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="RadGrid1"/>
      </UpdatedControls>
    </telerik:AjaxSetting>
      <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
          <UpdatedControls>
              <telerik:AjaxUpdatedControl ControlID="NestedViewPanel1" />
          </UpdatedControls>
      </telerik:AjaxSetting>
      <telerik:AjaxSetting AjaxControlID="RadMultiPage1">
          <UpdatedControls>
              <telerik:AjaxUpdatedControl ControlID="NestedViewPanel1" />
          </UpdatedControls>
      </telerik:AjaxSetting>
  </AjaxSettings>
</telerik:RadAjaxManager>

<telerik:RadGrid ID="RadGrid1"
                 runat="server"
                 DataKeyNames="PrimaryKey"
                 OnItemCommand="RadGrid1_ItemCommand"
                 OnNeedDataSource="RadGrid1_OnNeedDataSource"
                 EnableViewState="false">
  <MasterTableView>
    <NestedViewSettings>
      <ParentTableRelation>
        <telerik:GridRelationFields DetailKeyField="PrimaryKey" MasterKeyField="PrimaryKey" />
      </ParentTableRelation>
    </NestedViewSettings>
    <NestedViewTemplate>
     <asp:Panel ID="NestedViewPanel1" runat="server" CssClass="viewWrap bordered-bottom">
        <telerik:RadTabStrip runat="server" ID="RadTabStrip1" AutoPostBack="true" MultiPageID="RadMultiPage1"></telerik:RadTabStrip>
        <telerik:RadMultiPage runat="server" ID="RadMultiPage1" EnableEmbeddedScripts="true"></telerik:RadMultiPage>
      </asp:Panel>
    </NestedViewTemplate>
  </MasterTableView>
</telerik:RadGrid>

And my tabs are created programmatically:

string[] testing = { "Test1", "Test2", "Test3", "Test4", "Test5", "Test6" };
 
foreach (string tabName in testing)
{
    RadTab tab = new RadTab();
    tab.Text = tabName;
    RadTabStrip1.Tabs.Add(tab);
    RadPageView pageView = new RadPageView();
    RadMultiPage1.PageViews.Add(pageView);
    pageView.ID = "Page" + RadTabStrip1.Tabs.Count.ToString();
    pageView.Controls.Add(new LiteralControl(pageView.ID);
    RadTabStrip1.SelectedIndex = 0;
    RadTabStrip1.MultiPageID = RadMultiPage1.ID;
    RadTabStrip1.DataBind();
}
Kostadin
Telerik team
 answered on 25 Feb 2013
1 answer
88 views
Hi 
I am not able to get the changed values in the controls in edit mode when I am using either "Popup" (or editforms) modes. Using 'GridEditFormItem' to retrieve the values and it returns old value and not the changed ones. Here is my code:
======================================================================
ASPX:
=================================================================
 <telerik:RadGrid ID="radFootNotes" runat="server" Width="100%" AutoGenerateColumns="false" BackColor="Beige" AllowPaging="false" AllowSorting="false" OnItemCommand="radFootNotes_ItemCommand" onneeddatasource="radFootNotes_NeedDataSource"  >
<MasterTableView AutoGenerateColumns="false" DataKeyNames="FootNoteID" InsertItemPageIndexAction="ShowItemOnCurrentPage" EditMode="PopUp" CommandItemDisplay="TopAndBottom" CommandItemSettings-AddNewRecordText="Add Footnote">
      <Columns>
                 <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>                           <telerik:GridBoundColumn UniqueName="FootNoteText" DataField="FootNoteText" HeaderText="Foot Note" ReadOnly="true" />                            <telerik:GridButtonColumn ConfirmDialogType="RadWindow" CommandName="Rules" ConfirmDialogHeight="100px" ConfirmDialogWidth="220px" Text="Rules"></telerik:GridButtonColumn>
        </Columns>
                       <EditFormSettings EditFormType="Template" PopUpSettings-Width="400px">
                  <PopUpSettings Height="500" Width="800"  Modal="true"   />                               <FormTemplate> 
     <table>
                                <tr><td class="style1">Disclosure Number</td><td><asp:TextBox ID="txtDisclosureNumber" Text='<%# Eval("DisclosureNumber") %>' runat="server" ></asp:TextBox></td></tr>
                                    <tr><td class="style1">FootNote Text</td><td><asp:TextBox ID="txtFootnoteText" Text='<%# Eval("FootnoteText") %>' runat="server" Height="150px" TextMode="MultiLine" Width="670px" ></asp:TextBox></td></tr>
                                    <tr><td class="style1">Font Name</td><td><asp:TextBox ID="txtFontName" Text='<%# Eval("FontName") %>' runat="server" Width="197px" ></asp:TextBox></td></tr>
                                    <tr><td class="style1">Font Size</td><td><asp:TextBox ID="txtFontSize" Text='<%# Eval("FontSize") %>' runat="server" Width="195px" ></asp:TextBox></td></tr>
                                    <tr><td class="style1">Font Color</td><td><asp:TextBox ID="txtFontColor" Text='<%# Eval("FontColor") %>' runat="server" Width="196px" ></asp:TextBox></td></tr>
                                    <tr><td class="style1">List Order</td><td><asp:TextBox ID="txtListOrder" Text='<%# Eval("ListOrder") %>' runat="server" Width="30px" ></asp:TextBox></td></tr>
                                    <tr><td class="style1">Is Active</td><td><asp:CheckBox ID="chkActive" Checked='<%# Eval("IsActive") %>' DataField="IsActive" HeaderText="Active" UniqueName="IsActive" runat="server"></asp:CheckBox></td></tr>
                                    <tr><td class="style1"></td><td><br /></td></tr>
                                    <tr><td class="style1"></td><td>                                         <asp:Button ID="btnUpdate" runat="server" Text='<%# IIf (TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>'                                                                CommandName='<%# IIf (TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>'></asp:Button>
                                         <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"/>
                                    </td></tr>                               </table>
                            </FormTemplate>                          </EditFormSettings>
                     </MasterTableView>
                     <ClientSettings>
                        <ClientEvents OnRowDblClick="RowDblClick" />
                    </ClientSettings>
                </telerik:RadGrid>

==================================================================
VB:
==================================================================
 Protected Sub radFootNotes_ItemCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles radFootNotes.ItemCommand
        If e.CommandName = RadGrid.InitInsertCommandName Then '"Add new" button clicked
            Dim editColumn As GridEditCommandColumn = CType(radFootNotes.MasterTableView.GetColumn("EditCommandColumn"), GridEditCommandColumn)
            editColumn.Visible = False
        ElseIf (e.CommandName = RadGrid.RebindGridCommandName AndAlso e.Item.OwnerTableView.IsItemInserted) Then
            e.Canceled = True
        ElseIf e.CommandName = "Update" Then
            If (TypeOf e.Item Is GridEditableItem) AndAlso e.Item.IsInEditMode Then
                Dim item As GridEditableItem = TryCast(e.Item, GridEditableItem)
                Dim footnoteID As Integer = Item.GetDataKeyValue("FootNoteID")
                'Dim dr As dsFootNote.ReportFootNoteRulesRow = ds.ReportFootNoteRules.NewReportFootNoteRulesRow
                Dim dr As dsFootNote.ReportFootNotesRow = ds.ReportFootNotes.FindByFootNoteID(footnoteID)
               ''Dim editDataitem As GridDataItem = e.Item
                'Dim editform As GridEditFormItem = CType(CType(e.Item, GridDataItem).EditFormItem, GridEditFormItem)
                'Dim ditem As Telerik.Web.UI.GridDataItem = CType(e.Item, Telerik.Web.UI.GridDataItem)
                Dim editform As GridEditFormItem = CType(e.Item, GridEditFormItem)                'Dim editTable As GridEditableItem = TryCast(e.Item, GridEditableItem)
                Dim DisclosureNumber As String = TryCast(editform.FindControl("txtDisclosureNumber"), TextBox).Text
                Dim FootNoteText As String = TryCast(editform.FindControl("txtFootNoteText"), TextBox).Text
                Dim FontName As String = TryCast(editform.FindControl("txtFontName"), TextBox).Text
                Dim FontSize As String = TryCast(editform.FindControl("txtFontSize"), TextBox).Text
                Dim FontColor As String = TryCast(editform.FindControl("txtFontColor"), TextBox).Text
                Dim ListOrder As String = TryCast(editform.FindControl("txtListOrder"), TextBox).Text
                Dim IsActive As Boolean = TryCast(editform.FindControl("chkIsActive"), CheckBox).Checked
                dr.FootNoteID = footnoteID
                If String.IsNullOrEmpty(DisclosureNumber) Then
                    dr.SetDisclosureNumberNull()
                Else
                    dr.DisclosureNumber = DisclosureNumber
                End If
                dr.FootNoteText = FootNoteText
                dr.FontName = FontName
                dr.FontSize = FontSize
                dr.FontColor = FontColor
                dr.ListOrder = ListOrder
                dr.IsActive = IsActive
                'Save Footnote
                OCS.DAL.FootNotes.FootNotes.UpdateReportFootNotes(ds, 2)
                'Rebind the FootNotes Grid
                ds = OCS.DAL.FootNotes.FootNotes.GetReportFootNotes(0, 0, 2)
                radFootNotes.Rebind()
                'Close PopUp
                radFootNotes.MasterTableView.ClearEditItems()
            End If
        ElseIf e.CommandName = "Cancel" Then
            Dim editColumn As GridEditCommandColumn = CType(radFootNotes.MasterTableView.GetColumn("EditCommandColumn"), GridEditCommandColumn)
           editColumn.Visible = False
        Else
            Dim editColumn As GridEditCommandColumn = CType(radFootNotes.MasterTableView.GetColumn("EditCommandColumn"), GridEditCommandColumn)
            If Not editColumn.Visible Then
                editColumn.Visible = True
            End If
        End If
    End Sub

Can I get some help??
Shinu
Top achievements
Rank 2
 answered on 25 Feb 2013
2 answers
101 views
i am current able to get all users for the first node (teamLeaderNode), but on the second node (projectGroupNode) it only add one node, even there are more record for projectgroupnode. projectSubGroupNode is only 1 record display even more record on the database. WOuld you be able advise, thank you



 private void BuildProjectTree()
        {
    
            EntityCollection<VwProjectCollectionEntity> collection = GetProjectData();
    
            treProjects.Nodes.Clear();
    
            ArrayList pgnodes = new ArrayList();
    
            RadTreeNode teamLeaderNode = null;
            RadTreeNode projectGroupNode = null;
            RadTreeNode projectSubGroupNode = null;
            RadTreeNode projectUserResponsibleNode = null;
            RadTreeNode projectWorkplaneNodeNode = null;
            RadTreeNode projectNode = null;
    
            foreach (VwProjectCollectionEntity p in collection)
            {
                teamLeaderNode = null;
                foreach (RadTreeNode n in pgnodes)
                {
                    if (n.Text.Trim().ToUpper() == p.TeamLeader.Trim().ToUpper())
                    {
                        
                        teamLeaderNode = n;
                        break;
                      
                    }
                   
                }
                if (teamLeaderNode != null)
                {
                    projectGroupNode = null;
                    foreach (RadTreeNode n in teamLeaderNode.Nodes)
                    {
    
                        if (n.Text.Trim() == p.ProjectGroupName.Trim())
                        {
                            projectGroupNode = n;
                            break;
                        }
    
                    }
    
    
                    if (projectGroupNode != null)
                    {
                        projectSubGroupNode = null;
                        foreach (RadTreeNode n in projectGroupNode.Nodes)
                        {
                            if (n.Text.Trim() == p.ProjectSubGroupName.Trim())
                            {
                                projectGroupNode = n;
                                break;
                            }
    
                        }
                        if (projectSubGroupNode != null)
                        {
                            projectNode = null;
                            foreach (RadTreeNode n in projectSubGroupNode.Nodes)
                            {
                                if (n.Text.Trim() == p.ProjectTitle.Trim())
                                {
                                    projectNode = n;
                                    break;
    
                                }
                            }
                        }
    
                    }
    
    
                }
                else
                {
    
                    teamLeaderNode = new RadTreeNode(p.TeamLeader.ToUpper());
                    projectGroupNode = new RadTreeNode(p.ProjectGroupName.Trim(), String.Empty);
                    projectSubGroupNode = new RadTreeNode(p.ProjectSubGroupName.Trim());
                    projectNode = new RadTreeNode(p.ProjectTitle.Trim() + " (" + p.ReferenceNumber + " " + "-" + " " + p.ProjectStatusName + ")",
                                                                      p.ProjectId.ToString(), BuildProjectNavigationUrl2(p, false));
    
                    pgnodes.Add(teamLeaderNode);
                    teamLeaderNode.Nodes.Add(projectGroupNode);
                    projectGroupNode.Nodes.Add(projectSubGroupNode);
                    projectSubGroupNode.Nodes.Add(projectNode);
                }
    
            }
    
            //pgnodes.Add(teamLeaderNode);
            foreach (RadTreeNode pg in pgnodes)
            {
    
                treProjects.Nodes.Add(pg);
            }
            //treProjects.ExpandAllNodes();
            treProjects.CollapseAllNodes();
            
        }
Bozhidar
Telerik team
 answered on 25 Feb 2013
2 answers
936 views
Can any tell me how to do  using javascript ? I find some code on the code library, but the RadGrid component version is too old.
My RadGrid is the newest !! 
Than's a lot !!
Eyup
Telerik team
 answered on 25 Feb 2013
1 answer
194 views
Hello,
I am using a Radslider and i want to increase the slider value by 25 on dragging as well as clicking on the slider track. Currently the value is incremented by one.
Any help,
Freddy.
Princy
Top achievements
Rank 2
 answered on 25 Feb 2013
1 answer
96 views
Hi there,

My RadGrid filter function is not working with Simple data binding OnNeedDataSource, Any help is greatly appreciated. Here is my code:

aspx file:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadGridFilterTest.aspx.cs" Inherits="RadGridFilterTest" %>
<!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>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0"
            GridLines="None" Width="800px" AllowFilteringByColumn="true" EnableLinqExpressions="false" AutoGenerateColumns="false"
             OnNeedDataSource="RadGrid1_NeedDataSource" OnPreRender="RadGrid1_PreRender" ShowFooter="True">
            <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True"
            ShowFooter="True" TableLayout="Auto">
                <Columns>
                    <telerik:GridTemplateColumn HeaderText="Ship Name" SortExpression="ShipName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                    ShowFilterIcon="false">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbl_name" runat="server" Text='<%#Eval("ShipName")%>' Visible="true"/>
                        </ItemTemplate>
                   </telerik:GridTemplateColumn>
                   <telerik:GridTemplateColumn HeaderText="Ship Country" SortExpression="ShipCountry" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                    ShowFilterIcon="false">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbl_country" runat="server" Text='<%#Eval("ShipCountry")%>' Visible="true"/>
                        </ItemTemplate>
                   </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </form>
</body>
</html>

cs file
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
  
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using Telerik.Web.UI;
using System.Collections.Generic;
using System.Text;
  
public partial class RadGridFilterTest : System.Web.UI.Page
{
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        LoadData();
    }
  
    private void LoadData()
    {
        RadGrid1.DataSource = GetDataTable("SELECT OrderID, OrderDate, Freight, ShipName, ShipCountry FROM Orders");
    }
  
    public DataTable GetDataTable(string query)
    {
        String ConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        SqlConnection conn = new SqlConnection(ConnString);
        SqlDataAdapter adapter = new SqlDataAdapter();
        adapter.SelectCommand = new SqlCommand(query, conn);
  
        DataTable myDataTable = new DataTable();
  
        conn.Open();
        try
        {
            adapter.Fill(myDataTable);
        }
        finally
        {
            conn.Close();
        }
  
        return myDataTable;
    }
  
  
  
    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        //RadGrid1.Columns[0].CurrentFilterFunction = Telerik.Web.UI.GridKnownFunction.Contains;
        //RadGrid1.Columns[1].CurrentFilterFunction = Telerik.Web.UI.GridKnownFunction.Contains;
    }
}
Shinu
Top achievements
Rank 2
 answered on 25 Feb 2013
1 answer
154 views
Hello,

I have 2 columns on my radgrid. These columns were created by design, the first column is a checkbox and the second column is a 
Dropdownlist. I have problem with the last column because when a insert (using insert command event ) the item, doesn't appears in the Grid.  The datasource is a DataTable with two columns, first column save the dropdownlist value and the second one save the checkbox value.

    
 
Shinu
Top achievements
Rank 2
 answered on 25 Feb 2013
3 answers
113 views
As attach Image, please help me to display name replace Id when group by foreign key. thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 25 Feb 2013
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?