Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
396 views
Hello ! I have RadGrid with PDF exporting button on my page. All fonts on the page are "SegoeUI" and in the RadGrid too, but when I export grid data to PDF document the fonts in the table becomes like "Times New Roman"..  

Tryied to add styles to RawHtml on PdfExporting event but nothing happened. 
Travis
Top achievements
Rank 1
 answered on 01 Jul 2014
4 answers
224 views
Hi 
   I currently have a 2 level tree view that displays departments and then assets within those departments. To do this I am using a sql stored procedure to prepare the data. See the attatched file to see the output of this stored procedure. I am then using the following c# code to bind the tree view.  
DataTable assets = new DataTable();
 
          using (SqlConnection connection = new SqlConnection(ConnectionString))
          {
              using (SqlCommand command = new SqlCommand("GetAssetHierarchyByUserId", connection))
              {
                  command.Parameters.Add(new SqlParameter("UserId", UserId));
 
                  command.CommandType = CommandType.StoredProcedure;
 
                  SqlDataAdapter adapter = new SqlDataAdapter(command);
 
                  connection.Open();
 
                  try
                  {
                      adapter.Fill(assets);
                  }
                  finally
                  {
                      connection.Close();
                  }
              }

My Question is, how do I go about adding another level of data to the tree. I want to now display SITES, that have Departments that have Assets. I.E I want to add a grand parent. what would be the correct schema for my stored procedure output to achieve this. 

Thanks
   Dave
tafi
Top achievements
Rank 1
 answered on 01 Jul 2014
5 answers
1.0K+ views
Hello,

There is a way to disable insert row in radgrid from codebehind if it matches some criteria? 
also, i found a way to disable GridEditCommandColumn, but it disables the two buttons, i only want to disable one.

thanks in advance
MikeS
Top achievements
Rank 1
 answered on 01 Jul 2014
4 answers
98 views
Hi,

I am using version 2013.3.1114.35 of your ASP.NET for AJAX controls.

In the past, you have implemented the following awesome workaround, to allow a custom header to be exported, when exporting from a grid.

protected void RadGrid1_GridExporting(object source, GridExportingArgs e)
 {
     string customHeader = "<table><tr><td>CUSTOM HEADER</td></tr></table>";
     e.ExportOutput = e.ExportOutput.Replace("<table cellspacing", customHeader + "<table cellspacing");
 }

I implemented that years ago and it had been working for a long time.  However, it no longer works.  The code runs without error, but the Custom Header is NOT exported.  Only the report data is exported...

For us I don't know exactly when it broke, but I would suspect it was when we upgraded to 2013.3.1114.35.  

Q.  Can you confirm this?
Q.  Can you suggest a "fix"?  Perhaps I just need a different customHeader string???

Any help is appreciated.

Regards,
Michael
Kostadin
Telerik team
 answered on 01 Jul 2014
5 answers
142 views
By default the offset is set relative to its parent item, but is there a way to have it relative to the menu object itself?

What I´m trying to achieve is have items contentTemplates use 100% width of the menu, setting offsets solves the issue until the width of the parent items is changes (i.e. changes language)


Example below, the third item 'Products' has an offset set to it, but I need it to either dynamically change depending on its parent item position or have it relative to the menu object itself, as is the position gets misplaces when the user changes language (and the items width changes).

Christian

<telerik:RadMenuItem runat="server" Text="Home" Value="home" NavigateUrl="Default.aspx">
        </telerik:RadMenuItem>
        <telerik:RadMenuItem runat="server" Text="Company" Value="about" NavigateUrl="about.aspx">
        </telerik:RadMenuItem>
        <telerik:RadMenuItem runat="server" Text="Products" Value="products" PostBack="false" GroupSettings-OffsetX="-216">
            <ContentTemplate>
                <div class="menuProductContent">
                    <table width="100%">
                        <tr>
                            <td style="vertical-align:top;">
                                <h1><asp:Label runat="server" ID="labProductgroupsHeader" Text="Product groups"></asp:Label></h1>
                                <telerik:RadSiteMap runat="server" ID="productIndex" EnableEmbeddedSkins="false" Skin="mrplant" DefaultLevelSettings-ListLayout-RepeatColumns="2" OnNodeDataBound="productIndex_NodeDataBound">
                                    <Nodes>
                                        <telerik:RadSiteMapNode Text="Singlestems & sprays" NavigateUrl="products.aspx?productgroup=1"></telerik:RadSiteMapNode>
                                        <telerik:RadSiteMapNode Text="flowers" NavigateUrl="products.aspx?productgroup=2"></telerik:RadSiteMapNode>
                                        <telerik:RadSiteMapNode Text="Succulents & round shaped items" NavigateUrl="products.aspx?productgroup=3"></telerik:RadSiteMapNode>
                                        <telerik:RadSiteMapNode Text="Potted and hanging bushes" NavigateUrl="products.aspx?productgroup=4"></telerik:RadSiteMapNode>
                                        <telerik:RadSiteMapNode Text="Garlands" NavigateUrl="products.aspx?productgroup=5"></telerik:RadSiteMapNode>
                                        <telerik:RadSiteMapNode Text="Trees" NavigateUrl="products.aspx?productgroup=6"></telerik:RadSiteMapNode>
                                        <telerik:RadSiteMapNode Text="Candlerings & wreaths" NavigateUrl="products.aspx?productgroup=7"></telerik:RadSiteMapNode>
                                    </Nodes>
                                </telerik:RadSiteMap>
                            </td>
                            <td style="text-align:right; vertical-align:top;">
                                <asp:Panel runat="server" ID="panSearch" DefaultButton="btnSearch">
                                    <h1><asp:Label runat="server" ID="labSearchHeader" Text="Search"></asp:Label></h1>
                                    <telerik:RadTextBox runat="server" ID="txtSearch" EmptyMessage="Partno. / Description" EnableEmbeddedSkins="false" Skin="mrplant"></telerik:RadTextBox>
                                     <telerik:RadButton runat="server" ID="btnSearch" Text="Search" EnableEmbeddedSkins="false" Skin="mrplant" OnClick="btnSearch_Click"></telerik:RadButton>
                                </asp:Panel>
                                <br />
                                <asp:Panel runat="server" ID="panPage" DefaultButton="btnPage">
                                    <%--<h1><asp:Label runat="server" ID="labPageHeader" Text="Page"></asp:Label></h1>--%>
                                    <telerik:RadNumericTextBox runat="server" ID="txtPage" NumberFormat-DecimalDigits="0" EmptyMessage="Catalogue page no." EnableEmbeddedSkins="false" Skin="mrplant"></telerik:RadNumericTextBox>
                                     <telerik:RadButton runat="server" ID="btnPage" Text="Go to" EnableEmbeddedSkins="false" Skin="mrplant" OnClick="btnPage_Click"></telerik:RadButton>
                                </asp:Panel>
                            </td>
                        </tr>
 
                    </table>
                </div>
            </ContentTemplate>
        </telerik:RadMenuItem>

Magdalena
Telerik team
 answered on 01 Jul 2014
1 answer
39 views
Hi, there's is something weird behavior when dragging an appointment in month view, when I drag the appointment the end time is changed automatically to 12 AM, I thought it was something in my code but when I try the same using this demo  http://demos.telerik.com/aspnet-ajax/scheduler/examples/creatingappointmentswithdraganddrop/defaultcs.aspx the same happens, I was wondering what can I do to fix this.

thank you.
Nencho
Telerik team
 answered on 01 Jul 2014
1 answer
254 views
Hi,

I am trying to activate the InsertItemTemplate using button cmdAdd but I can't have it activated. What am I doing wrong?

Thanks in advance,
David

The Webform:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title></title>
</head>
<body>
  <form id="form1" runat="server">
  <telerik:RadScriptManager runat="server" ID="rsm"></telerik:RadScriptManager>
    <div>
      <telerik:RadListView ID="RadListView1" runat="server" ItemPlaceholderID="panel1">
        <LayoutTemplate>
          <fieldset>
            <table>
              <tr>
                <td>
                  <asp:Label ID="lblHeader01" runat="server" Text="header01" Width="160"></asp:Label></td>
                <td>
                  <asp:Label ID="lblHeader02" runat="server" Text="header02" Width="160"></asp:Label></td>
              </tr>
            </table>
            <panel id="panel1" runat="server"></panel>
            <asp:Button ID="cmdAdd" runat="server" Text="Add" OnClick="cmdAdd_Click"></asp:Button>
          </fieldset>
        </LayoutTemplate>
        <ItemTemplate>
          <fieldset>
            <table>
              <tr>
                <td>
                  <telerik:RadTextBox ID="txtItem01" runat="server" Text='<%# Eval("field01") %>'></telerik:RadTextBox>
                  <td>
                    <telerik:RadTextBox ID="txtItem02" runat="server" Text='<%# Eval("field02") %>'></telerik:RadTextBox>
                  </td>
              </tr>
            </table>
          </fieldset>
        </ItemTemplate>
        <EditItemTemplate>
          <fieldset>
            <table>
              <tr>
                <td>
                  <telerik:RadTextBox ID="Edit01" runat="server" Text='<%# Bind("field01")%>'></telerik:RadTextBox></td>
                <td>
                  <telerik:RadTextBox ID="Edit02" runat="server" Text='<%# Bind("field02")%>'></telerik:RadTextBox></td>
              </tr>
            </table>
          </fieldset>
        </EditItemTemplate>
        <InsertItemTemplate>
          <table>
            <tr>
              <td>
                <telerik:RadTextBox ID="Insert01" runat="server" Resize="None" Text='<%# Eval("field01")%>'></telerik:RadTextBox></td>
              <td>
                <telerik:RadTextBox ID="Insert02" runat="server" Resize="None" Text='<%# Eval("field02")%>'></telerik:RadTextBox></td>
            </tr>
          </table>
        </InsertItemTemplate>
      </telerik:RadListView>
      <br />
    </div>
  </form>
</body>
</html>

The Code Behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace xxx
{
  public partial class Test4 : System.Web.UI.Page
  {
    public class myExpedClass
    {
      public string field01 { get; set; }
      public string field02 { get; set; }
    }
    myExpedClass myExpedObject;
    List<myExpedClass> myList;
    protected void Page_Load(object sender, EventArgs e)
    {
      if (!IsPostBack)
      {
        // Instantiate
        myList = new List<myExpedClass>();
        // Record 01
        myExpedObject = new myExpedClass();
        myExpedObject.field01 = "R1C1";
        myExpedObject.field02 = "R1C2";
        myList.Add(myExpedObject);
        // Record 02
        myExpedObject = new myExpedClass();
        myExpedObject.field01 = "R2C1";
        myExpedObject.field02 = "R2C2";
        myList.Add(myExpedObject);
        // Link the list to the RadListView
        RadListView1.DataSource = myList;
        RadListView1.DataBind();
      }
    }
    protected void cmdAdd_Click(object sender, EventArgs e)
    {
      // Show InsertItemTemplate
      RadListView1.ShowInsertItem();
    }
  }
}
Eyup
Telerik team
 answered on 01 Jul 2014
1 answer
129 views
Hi,

i have a problem with my radgrid ; i use horizontal scrolling and FrozenColumnsCount is set to 4.
In one of the columns, i have a radbutton in a template column. 


<telerik:RadGrid ID="rgPreparation" runat="server" AllowSorting="true" AllowFilteringByColumn="true" AutoGenerateColumns="false" AllowCustomPaging="false" Height="700px" Culture="fr-FR" AllowPaging="true" PageSize="15" ShowFooter="true" ShowStatusBar="True" 
onitemcreated="rgPreparation_ItemCreated"
onitemdatabound="rgPreparation_ItemDataBound" 
  onneeddatasource="rgPreparation_NeedDataSource" 
  onexcelexportcellformatting="rgPreparation_ExcelExportCellFormatting" 
  onitemcommand="rgPreparation_ItemCommand">
<ClientSettings EnableRowHoverStyle="true" AllowKeyboardNavigation="true">
  <ClientEvents OnKeyPress="OnKeyPress" /> 
  <Scrolling AllowScroll="true" UseStaticHeaders="true" FrozenColumnsCount="4" />
</ClientSettings>
<GroupingSettings CaseSensitive="false" />
<MasterTableView DataKeyNames="Id" HeaderStyle-Font-Underline="false" AlternatingItemStyle-HorizontalAlign="Left" AlternatingItemStyle-Font-Size="7pt" HeaderStyle-Font-Bold="true" ItemStyle-Font-Size="7pt" HeaderStyle-Font-Size="7pt" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" FilterItemStyle-HorizontalAlign="Left" NoMasterRecordsText="Cliquer sur ''Actualiser'' pour afficher la préparation de commande..." ShowHeadersWhenNoRecords="true">
<Columns>
<telerik:GridBoundColumn DataField="TypeProduit" HeaderText="Type" SortExpression="TypeProduit" UniqueName="coloneType" ItemStyle-Font-Size="7pt" FooterStyle-Font-Size="7pt" AllowFiltering="false" />
<telerik:GridBoundColumn UniqueName="colonneFamille" DataField="Famille.IdNom" HeaderText="Famille" SortExpression="Famille.IdNom" ItemStyle-Font-Size="7pt" FooterStyle-Font-Size="7pt" AllowFiltering="false" FilterControlWidth="10px" FooterText="Nb de produits :" />
<telerik:GridBoundColumn UniqueName="colonneIdProduit" DataField="Id" HeaderText="Code Produit" SortExpression="Id" Aggregate="Count" FooterAggregateFormatString=" {0} " AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="false" FilterControlWidth="50px" />
<telerik:GridBoundColumn UniqueName="colonneNomProduit" DataField="Nom" HeaderText="Produit" SortExpression="Nom" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
<telerik:GridBoundColumn UniqueName="Conditionnement" DataField="Conditionnement" HeaderText="Conditionnement de dispensation" SortExpression="Conditionnement" AllowFiltering="false" />



<telerik:GridTemplateColumn HeaderText="Stock Tampon (Calcul automatique ?)" HeaderTooltip="'Oui' : Calcul automatique de la quantité tampon ; 'Non' : Renseignez manuellement la quantité tampon" UniqueName="quantiteTampon" ItemStyle-BackColor="LightGray" AllowFiltering="false" ItemStyle-Width="150px">
<ItemTemplate> 
                            <div style="float:left">
   <telerik:RadNumericTextBox ID="rtbQuantiteTampon" runat="server" Width="50px" Skin="Vista">
                                    <NumberFormat AllowRounding="false" DecimalDigits="0" />
   </telerik:RadNumericTextBox>
                            </div>
                            <div style="float:left">
                                <telerik:EchoRadButton ID="rbAppliquerFormuleTampon" runat="server" ToggleType="CheckBox" ButtonType="StandardButton" Skin="Metro" Width="30px" AutoPostBack="false" OnClientClicked="check" LienHtml="true" style="position:relative"></telerik:EchoRadButton>
                            </div>
</ItemTemplate>
</telerik:GridTemplateColumn>



      <telerik:GridButtonColumn UniqueName="actionSupprimerProduit" CommandName="Delete" ButtonType="ImageButton" HeaderText="Supprimer le produit de la commande" ConfirmText="Êtes-vous sûr de vouloir supprimer ce produit de la commande ?"  HeaderStyle-Font-Underline="false" HeaderStyle-Font-Bold="false" ShowFilterIcon="false" Visible="false" />

</Columns>
</MasterTableView>
</telerik:RadGrid>

When i scroll the bar from left to right, the radbutton is still visible even if the column is hidden (take a look at the printscreens in attach files).

I put this style in my page but it still not work :
<style type="text/css">
.RadGrid .rgDataDiv
{
position: relative;
}
</style>

Is there a solution for this problem ? thanks in advance,

Freddy















Galin
Telerik team
 answered on 01 Jul 2014
1 answer
64 views
I can't make the radpagelayout control has 100% width and height in big resolution (1920x1080). Do you can help me?
Ivan Zhekov
Telerik team
 answered on 01 Jul 2014
1 answer
119 views
I open a RadAlert server-side but it won't close when you click the OK button, at least in IE 9. It does in Firefox so maybe it's a browser js implemenation issue. This post(http://www.telerik.com/forums/radalert-won-t-close-with-ok-in-ie) didn't provide any help.

I'm using version 2014.1.403.45 of the Telerik.Web.UI

Any ideas?
Marin Bratanov
Telerik team
 answered on 01 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?