Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
93 views
Greetings,

I was struggling earlier to figure out why my loading panel was not showing.  I inherited an application and was trying to Ajaxify it.  One of my Loading Panels would not show up even though it was doing a lengthy post-back.  I discovered that having align="left" on a table tag (I know, not good practice) causes the loading panel to disappear.  Here is a sample...

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Sample.aspx.cs" Inherits="Sample" %>
 
<html>
  <head runat="server">
    <title>Loading Panel Sample</title>
  </head>
  <body>
    <form id="form1" runat="server">
      <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"
                              Width="350">
          <table border="1" width="350">
            <tr>
              <td>
                <h2>
                  Loading Panel Will Show
                </h2>
              </td>
            </tr>
            <tr>
              <td>
                filler...
              </td>
            </tr>
            <tr>
              <td>
                filler...
              </td>
            </tr>
            <tr>
              <td>
                filler...
              </td>
            </tr>
            <tr>
              <td>
                filler...
              </td>
            </tr>
            <tr>
              <td>
                <telerik:RadButton ID="RadButton1" runat="server" Text="Post Me" OnClick="RadButton1_Click">
                </telerik:RadButton>
              </td>
            </tr>
          </table>
        </telerik:RadAjaxPanel>
        <br />
        <br />
        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel2">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" LoadingPanelID="RadAjaxLoadingPanel2"
                              Width="350">
          <table align="left" border="1" width="350">
            <tr>
              <td>
                <h2>
                  Loading Panel Will Not Show
                </h2>
              </td>
            </tr>
            <tr>
              <td>
                filler...
              </td>
            </tr>
            <tr>
              <td>
                filler...
              </td>
            </tr>
            <tr>
              <td>
                filler...
              </td>
            </tr>
            <tr>
              <td>
                filler...
              </td>
            </tr>
            <tr>
              <td>
                <telerik:RadButton ID="RadButton2" runat="server" Text="Post Me" OnClick="RadButton2_Click">
                </telerik:RadButton>
              </td>
            </tr>
          </table>
        </telerik:RadAjaxPanel>
      </div>
    </form>
  </body>
</html>

using System;
public partial class Sample : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
  }
 
  protected void RadButton1_Click(object sender, EventArgs e)
  {
    System.Threading.Thread.Sleep(1000);
  }
 
  protected void RadButton2_Click(object sender, EventArgs e)
  {
    System.Threading.Thread.Sleep(1000);
  }
}

I removed the left alignment from the table tags and now working great.  Just wanted to share in case somebody else has this issue.

Matt
Pavlina
Telerik team
 answered on 03 Sep 2014
1 answer
173 views
I have a Radgrid with 4 ItemTemplate columns each item template column has a Textbox. I need to fire SelectedCellChanged event when I move (click tab) from one cell (textbox) to other cell (I need to call a method which does calculations whenever a cell is changed). How do i do that?

Thanks in advance.

Note: I'm working on a web application using c#.

Regards,
Mohan.
Viktor Tachev
Telerik team
 answered on 03 Sep 2014
8 answers
264 views
I'm struggling with borders on my Grid export to pdf. I have a grid that contains 3 detail tables. My biggest problem is that the 2nd and 3rd detail grids are not exporting with borders. The first detail grid exports with a border. I've tried changing all settings, and tried applying the borders in the code-behind to no avail. I'm also unable to remove borders. I tried setting the BorderType to "NoBorders", but the output still contains borders. Is there an issue with multiple detail tables? I've attached a sample export.

​Here's my grid definition:
<telerik:RadGrid ID="CDMGrid" runat="server"
                AllowPaging="True"
                AllowSorting="true"
                PageSize="25"
                AutoGenerateColumns="false" Skin="Office2007"
                OnNeedDataSource="CDMGrid_NeedDataSource"
                OnItemDataBound="CDMGrid_ItemDataBound"
                OnPreRender="CDMGrid_PreRender"
                OnDetailTableDataBind="CDMGrid_DetailTableDataBind"
                Height="657">
                <ExportSettings IgnorePaging="false" OpenInNewWindow="true">
                    <Pdf PageHeight="210mm" PageWidth="297mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="25mm" BorderStyle="Thin" BorderColor="#666666" BorderType="AllBorders" />
                </ExportSettings>
                <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="True" />
                <MasterTableView TableLayout="Fixed" DataKeyNames="ServiceCode, HospRegn, TechnicalDesc" Name="MasterTableView">
                    <Columns>
                        <telerik:GridBoundColumn UniqueName="HospRegn" DataField="HospRegn" HeaderText="Region" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="60" />
                        <telerik:GridBoundColumn UniqueName="ServiceCode" DataField="ServiceCode" HeaderText="Svc Code" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="80" />
                        <telerik:GridBoundColumn UniqueName="GeneralDesc" DataField="GeneralDesc" HeaderText="General Description" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" ItemStyle-Font-Size="11px"  />
                        <telerik:GridBoundColumn UniqueName="TechnicalDesc" DataField="TechnicalDesc" HeaderText="Technical Description" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" Visible="false" />
                        <telerik:GridNumericColumn NumericType="Currency" UniqueName="Price1" DataField="Price1" HeaderText="Current Price" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="85" />
                        <telerik:GridBoundColumn UniqueName="SvcTypeDesc" DataField="SvcTypeDesc" HeaderText="Svc Type" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="100" />
                        <telerik:GridBoundColumn UniqueName="InsCdStr" DataField="InsCdStr" HeaderText="Ins Cd" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="140" />
                        <telerik:GridBoundColumn UniqueName="GLKeyStr" DataField="GLKeyStr" HeaderText="GL Key" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                        <telerik:GridDateTimeColumn UniqueName="InactiveDate" DataField="InactiveDate" HeaderText="Inactive Date" HeaderStyle-HorizontalAlign="Center" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="95" />
                    </Columns>
                    <DetailTables>
                        <telerik:GridTableView AllowPaging="false" AutoGenerateColumns="false" DataKeyNames="" Name="PriceDetail" Width="100%" Font-Size="11px">
                            <Columns>
                                <telerik:GridBoundColumn UniqueName="FormulaCode" DataField="FormulaCode" HeaderText="Formula Code" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <telerik:GridNumericColumn NumericType="Currency" UniqueName="Price1" DataField="Price1" HeaderText="Price 1" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridNumericColumn NumericType="Currency" UniqueName="Price2" DataField="Price2" HeaderText="Price 2" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridNumericColumn NumericType="Currency" UniqueName="Price3" DataField="Price3" HeaderText="Price 3" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridNumericColumn NumericType="Currency" UniqueName="Price4" DataField="Price4" HeaderText="Price 4" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridBoundColumn DataFormatString="0.00" UniqueName="UnitAmt1" DataField="UnitAmt1" HeaderText="Unit Amt 1" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridBoundColumn DataFormatString="0.00" UniqueName="UnitAmt2" DataField="UnitAmt2" HeaderText="Unit Amt 2" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridNumericColumn NumericType="Currency" UniqueName="MinPrice" DataField="MinPrice" HeaderText="Min Price" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridNumericColumn NumericType="Currency" UniqueName="MaxPrice" DataField="MaxPrice" HeaderText="Max Price" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridDateTimeColumn UniqueName="EffectiveDate" DataField="EffectiveDate" HeaderText="Effective Date" HeaderStyle-HorizontalAlign="Center" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="94" />
                            </Columns>
                        </telerik:GridTableView>
                        <telerik:GridTableView AllowPaging="false" AutoGenerateColumns="false" DataKeyNames="" Name="ProcedureDetail" Width="100%" Font-Size="11px">
                            <Columns>
                                <telerik:GridTemplateColumn UniqueName="Filler" />
                                <telerik:GridBoundColumn UniqueName="SegTypeInd" DataField="SegTypeInd" HeaderText="Seg Type" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="100" />
                                <telerik:GridBoundColumn UniqueName="ThirdPartyIndStr" DataField="ThirdPartyIndStr" HeaderText="Third Party Ind" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="140" />
                                <telerik:GridBoundColumn UniqueName="Code" DataField="Code" HeaderText="Code" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridDateTimeColumn UniqueName="EffectiveDate" DataField="EffectiveDate" HeaderText="Effective Date" HeaderStyle-HorizontalAlign="Center" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="94" />
                            </Columns>
                        </telerik:GridTableView>
                        <telerik:GridTableView AllowPaging="false" AutoGenerateColumns="false" DataKeyNames="" Name="CostCenterDetail" Width="100%" Font-Size="11px" BackColor="#fafdc9">
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="Technical Description" UniqueName="TechnicalDesc" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" ItemStyle-BackColor="#fafdc9" HeaderStyle-Width="250" >
                                    <ItemTemplate>
                                        <div style="padding-right: 16px;">
                                            <asp:Label ID="TechnicalDescLabel" runat="server" Text='<%# Eval("TechnicalDesc")%>' />
                                        </div>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Allowable Cost Centers" UniqueName="AllowableCostCenters" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" ItemStyle-BackColor="#fafdc9">
                                    <ItemTemplate>
                                        <div style="padding-right: 16px;">
                                            <asp:Label ID="AllowableCostCentersLabel" runat="server" Text='<%# Eval("CostCenters")%>' />
                                        </div>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                    <PagerStyle AlwaysVisible="True" />
                </MasterTableView>
                <ClientSettings>
                    <Scrolling UseStaticHeaders="true" AllowScroll="true" SaveScrollPosition="True" ScrollHeight="100" />
                    <Selecting AllowRowSelect="False" />
                </ClientSettings>
            </telerik:RadGrid>




Daniel
Telerik team
 answered on 03 Sep 2014
3 answers
314 views
Hi,

I had Radcombobox inside RadWindow. I set z-index of radcombox to be really hight value so that it can appear on top of radwindow when maximize the Radwindow.

 
<telerik:RadComboBox ID="cboLocation" EmptyMessage="Location ID or Name" Width="250px"  CheckBoxes="true" Skin="Default" EnableLoadOnDemand="True" ShowMoreResultsBox="true"  ForeColor="Black" EnableVirtualScrolling="true" Font-Size="12px" OnClientItemChecked="OnClientItemCheckedLoc" OnClientDropDownClosed="OnClientDropDownClosedLoc" AutoPostBack="false" runat="server" OnItemsRequested="cboLocation_ItemsRequested" EnableCheckAllItemsCheckBox="true"  OnClientBlur="IsCheckAllSelectedLoc" ShowToggleImage="false"  ZIndex="1000000" >
</telerik:RadComboBox>


The problem I am facing now is I can't see Show more result when I maximized the Radwindow. Please see attached image for example. If I don't maximized the radwindow Dropdown top bar will hide under browser bookmark bar. I tried to put ItemsPerRequest , but it is still now working. Can anyone help me? 

Thank you. 

Best regards,
Ei
Magdalena
Telerik team
 answered on 03 Sep 2014
3 answers
99 views
I try to display RadTreeList inside RadGrid, but unfortunaltely i have a problem when expand and colapse node in RadTreeList.

My problem is occured with this step :

- Expand Item RadGrid
- Expand First Item TreeList
- Try Colapse First Item TreeList. (not work)

With this post, I have send  a projet, That reproduce the problem :

-  TestWithoutRadGrid.aspx (work)
-  TestWithRadGrid.aspx (not work)

If anyone can help me I'll be very grateful.

Thanks in advance
Viktor Tachev
Telerik team
 answered on 03 Sep 2014
3 answers
169 views
I have a RadTreeView where the nesting is not happening how I'd like.  I think it is confusing values from the ParentDataKey and DataKey.  I am loading data from two tables - ApplicationParent and Application.  The Application table has a ParentId column that is a foreign key to ApplicationParent.

There is one record that I'm having trouble with.  See the attached screenshot "treelist data.jpg".  There is an app with a ParentID of 100.  There also exists an Application with an AppId of 100 and an ApplicationParent record with a ParentId of 100.  In the UI, the nesting occurs as shown in the attached screenshots "treelist ui 1.jpg" and "treelist ui 2.jpg".  What I want is for the application "UBH PIF Tracking" to be nested underneath the parent app of the same name.

Here is my code for the TreeList markup and for loading the data:

<telerik:RadTreeList ID="lstApplications" runat="server" AllowSorting="True"
                    ParentDataKeyNames="ParentID" DataKeyNames="AppID"
                    OnNeedDataSource="lstApplications_NeedDataSource"                                         
                    AutoGenerateColumns="False" AllowPaging="True"
                    PageSize="15" TabIndex="3" >
                    <clientsettings>                                               
                        <Selecting AllowItemSelection="True" />
                        <ClientEvents OnItemClick="OnItemClick" OnItemDblClick="OnItemDblClick" />                       
                        <selecting allowitemselection="True" />
                    </clientsettings>
                    <Columns>
                        <telerik:TreeListBoundColumn DataField="AppID" HeaderText="AppID"
                            UniqueName="AppID" Visible="false" ReadOnly="True" />
                        <telerik:TreeListBoundColumn DataField="Name" HeaderText="Application"
                            ItemStyle-Width="20%" UniqueName="Name" ReadOnly="True">
                            <HeaderStyle Width="20%" />
                            <ItemStyle Width="20%" />
                        </telerik:TreeListBoundColumn>
                        <telerik:TreeListBoundColumn DataField="Description" HeaderText="Description"
                            UniqueName="Description" ReadOnly="True" />                           
                    </Columns>
                </telerik:RadTreeList>


public class MyData
    {
        public static List<MyItem> GetData(String prefixText)
        {
            var mergedList = GetParentData(prefixText).Union(GetChildData(prefixText)).ToList();
            return mergedList;
 
            //return GetChildData(prefixText);
        }
 
        public static List<MyItem> GetParentData(String prefixText)
        {
            SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["DataAccess.Properties.Settings.SecureConnectionString"].ConnectionString);
            SqlCommand cmd = new SqlCommand("SelApplicationsParent", cn);
            cmd.CommandType = CommandType.StoredProcedure;
 
            if (!prefixText.Equals(String.Empty))
            {
                cmd.Parameters.AddWithValue("nrows", 30);                   //Set results limit to prevent typing lag.
                cmd.Parameters.AddWithValue("term", ("%" + prefixText + "%"));    //Set filter by name
            }
 
            List<MyItem> list = new List<MyItem>();
            cn.Open();
 
            SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    string AppID = dr["ParentID"].ToString();
                    string ParentID = ""; //dr["ParentID"].ToString();
                    string Name = dr["Name"].ToString();
                    string Description = dr["Description"].ToString();
 
                    list.Add(new MyItem(AppID, Name, Description, ParentID));
                }
            }
 
            dr.Close();
 
            return list;
        }
 
        public static List<MyItem> GetChildData(String prefixText)
        {
            SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["DataAccess.Properties.Settings.SecureConnectionString"].ConnectionString);
            SqlCommand cmd = new SqlCommand("SelApplicationsChild", cn);
            cmd.CommandType = CommandType.StoredProcedure;
 
            if (!prefixText.Equals(String.Empty))
            {
                cmd.Parameters.AddWithValue("NRows", 30); //Set results limit to prevent typing lag.
                cmd.Parameters.AddWithValue("Parent", ("%" + prefixText + "%"));
            }
 
            List<MyItem> list = new List<MyItem>();
            cn.Open();
 
            SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    string AppID = dr["AppID"].ToString();
                    string ParentID = dr["ParentID"].ToString();
                    string Name = dr["Name"].ToString();
                    string Description = dr["Description"].ToString();
 
                    list.Add(new MyItem(AppID, Name, Description, ParentID));
                }
            }
 
            dr.Close();
 
            return list;
        }
    }
 
    public class MyItem
    {
        public string AppID { get; set; }
        public string ParentID { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
 
        public MyItem(string appID, string name, string description, string parentID)
        {
            AppID = appID;
            ParentID = parentID;
            Name = name;
            Description = description;
        }
    }
 
 protected void lstApplications_NeedDataSource(object sender, TreeListNeedDataSourceEventArgs e)
    {
        lstApplications.DataSource = MyData.GetData(txtFilter.Text);
    }


How do you suggest I solve this problem?  Right now my only idea is to modify the DB to ensure that there are no ApplicationParents that have a ParentId that is equal to an Application.AppId.
Viktor Tachev
Telerik team
 answered on 03 Sep 2014
7 answers
184 views
hello experts...i am in a problem if any one can come up with some advise...

i am using TabStrip with two Tabs. Tab loads on demand and Each tab has a control on which i have Gridview.  when i press the tab it shows me gridview correctly however, when i press the edit button (or any other button) on the gridview then the gridview disappears. Surely this is because of postback. i am using gridview_needSource event but it does not fire not even a single time.

when i use the tab on the aspx page then on Edit button of gridview the gridview_needSource event fires where i fetch the datasource from the Viewstate back to the grid view and gridivew loads again.

how can i control disappearing of the gridview on the control?

 
Nencho
Telerik team
 answered on 03 Sep 2014
5 answers
179 views
Hi,
I have a problem with RadTextbox on ASP.NET,
when i change it's display/visibilty property lets say from "hidden" to "visible" it works, but when my moues hovers over it it disappears and changes back.
I tried the same thing on a normal asp:textbox and it worked just fine.
Can you help me?
Chrome +Javascript.

var txtbEmail = document.getElementById("txtbEmail");
        txtbEmail.style.visibility = "visible";
Vasil
Telerik team
 answered on 03 Sep 2014
1 answer
336 views
I have a grid that works fine otherwise, but when I export it (regardless of Excel, CSV, PDF, etc.) their are two issues:

(1) The first issue is that hypercolumns are shown as blank in the exported file even the programmatic definition is "exportable = false";
(2) All of the columns that contain boundcolumn's only contain the value "System.Data.DataRowView" text instead of the values from the grid (
which display correctly).

I have read other forum entries that discuss this textual value, but they pretty much have to do with data column names not matching the grid column names -- and that is not the case.

I have attached:
(1) a screen capture of the displayed grid with one of the export files superimposed showing the results.  Please remember that is does NOT matter which export file format I select.
(2) the .aspx display file source that I can distribute;
(3) the master file source that I can distribute; and,
(4) the code behind file source code that I can distribute.

Any help anyone can provide would be most appreciated!

Lynn

Source code follows:

the .aspx display file source that I can distribute:
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <h3>
        Agents with Expiring Licenses
    </h3>
    <p>
        These Agents have licenses that are expiring soon.
    </p>
<div class="container">
    <div class="row10">
        <div class="one column" >
              
        </div>
        <div class="fourteen columns" >
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" OnNeedDataSource="RadGrid1_NeedDataSource" Width="99.7%"
                AutoGenerateColumns="false" AllowPaging="false" OnItemDataBound="RadGrid1_ItemDataBound"  AllowFilteringByColumn="True">
                <ExportSettings HideStructureColumns="true" Csv-ColumnDelimiter="Comma" IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true" >
                </ExportSettings>
                <MasterTableView Width="100%" CommandItemDisplay="Top" EnableViewState="true">
                    <PagerStyle Mode="Slider"></PagerStyle>
                    <CommandItemTemplate>
                        <table class="rcCommandTable" width="100%">
                            <tr>
                            <td style="float: right; vertical-align:middle;" >
                                <asp:ImageButton runat="server" ID="btnCSVExport" ImageUrl="../Icons/csvdownload.jpg" CommandName="ExportToCSV" Height="24px" Width="24px" ToolTip="Export to CSV" />
                                <asp:ImageButton runat="server" ID="btnExcelExport" ImageUrl="../Icons/excel.png" CommandName="ExportToExcel" Height="24px" Width="24px" ToolTip="Export to Excel" />
                                <asp:ImageButton runat="server" ID="btnWordExport" ImageUrl="../Icons/ms_word_2.png" CommandName="ExportToWord" Height="24px" Width="24px" ToolTip="Export to Word" />
                                <asp:ImageButton runat="server" ID="btnPDFExport" ImageUrl="../Icons/Pdf.png" CommandName="ExportToPDF" Height="24px" Width="24px" ToolTip="Export to PDF" />
                                  
                            </td>
                            </tr>
                        </table>
                    </CommandItemTemplate>
                    <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true" ShowExportToCsvButton="true" ShowExportToPdfButton="true">
                    </CommandItemSettings>
                    <Columns>
 
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </div>
        <div class="one column" >
              
        </div>
    </div>
</div>
<br />
<div class="container">
    <div class="row10">
        <div class="sixteen columns" style="text-align: center;" >
            <telerik:RadButton ID="CloseMe" runat="server" Text="Close Window" CausesValidation="False" ToolTip= "Closes this window." UseSubmitBehavior="False" OnClientClicked="closemenow" />
        </div>
    </div>
</div>
<div class="container">
    <div class="row10">
        <div class="sixteen columns" style="text-align: center;">
            <asp:Label ID="PageErrors" runat="server" Font-Bold="True" ForeColor="#C00000" Width="95%"></asp:Label>
        </div>
    </div>
</div>
</asp:Content>



the master file source that I can distribute:

<body id="page1">
    <telerik:RadFormDecorator Skin="Office2010Silver" Enabled="true" ID="QsfFormDecorator" DecorationZoneID="rfd-demo-zone" runat="server" DecoratedControls="All" EnableRoundedCorners="true" EnableEmbeddedSkins="true" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ></telerik:RadSkinManager>
    <form id="form1" runat="server">
        <div id="rfd-demo-zone" >
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
 
            </telerik:RadScriptManager>
            <div id="content">
                <div class="main">
                    <div class="xcontainer">
                        <div class="row-main-25" style="padding-bottom: 10px; ">
                            <!-- navbar start -->
                                <div class="sixteen columns ">
                                    <div class="menucontainer" >
                                        <section id="loginx">
                                            <asp:LoginView ID="LoginView1" runat="server" ViewStateMode="Disabled">
                                                <AnonymousTemplate>
                                                    <ul class="sessionnav" id="Ul1" runat="server" style="margin-bottom: 10px; padding-top: 4px; padding-bottom: 6px;">
                                                        <li><a id="A4" runat="server" onclick="doNothing();" title="If checked, the site will attempt to display pages by re-using the same window. If you are using a mobile device this will reduce the number of pages opened.">Reuse Windows</a><asp:CheckBox ID="ReuseWindow1" runat="server" onclick="doClick(this)" AutoPostBack="true" ToolTip="If checked, the site will attempt to display pages by re-using the same window. If you are using a mobile device this will reduce the number of pages opened by Broker+." /></li>
                                                        <li><a id="A3" runat="server" href="~/Account/Login.aspx">Log in</a></li>
                                                        <li><a id="A2" runat="server" href="~/Account/Register.aspx" >Register</a></li>
                                                    </ul>
                                                </AnonymousTemplate>
                                                <LoggedInTemplate>
                                                    <ul class="sessionnav" id="Ul2" runat="server" style="margin-bottom: 10px; padding-top: 4px; padding-bottom: 6px;">
                                                        <li><a id="A5" runat="server" onclick="doNothing();" title="If checked, the site will attempt to display pages by re-using the same window. If you are using a mobile device this will reduce the number of pages opened by Broker+.">Reuse Windows</a><asp:CheckBox ID="ReuseWindow2" runat="server" onclick="doClick(this)" AutoPostBack="true" ToolTip="If checked, the site will attempt to display pages by re-using the same window. If you are using a mobile device this will reduce the number of pages opened by Broker+." /></li>
                                                        <li><a id="A1" runat="server" class="username" href="~/Account/MyAccount.aspx" title="Manage your account"><asp:LoginName ID="LoginName1" runat="server" CssClass="username" /></a></li>
                                                        <li><asp:LoginStatus ID="LoginStatus1" runat="server" CssClass="username" LogoutAction="Redirect" LogoutText="Log off" LogoutPageUrl="~/logout.aspx" /></li>
                                                    </ul>
                                                    <div class="clear"></div>
                                                </LoggedInTemplate>
                                            </asp:LoginView>
                                        </section>
                                    </div>
                                </div>
                            <!-- navbar end -->
                            <!-- logo start -->
                            <div class="row10" style="height: 90px; " >
                                <div class="sixteen columns header-bg" style="height: 90px;">
                                    <div style="float: left; ">      
                                        <img src="" />
                                    </div>
                                    <div class="zippy" style="margin-left: 0px; float: left; height: 90px; text-align: center; overflow: no-display;">
                                        <div class="slogan-line">
                                            <telerik:RadTicker AutoStart="true" runat="server" ID="Radticker1" loop="false" DataSourceID="SqlDataSource1" DataTextField="ScrollerText"  >
                                            </telerik:RadTicker>
                                        </div>
                                    </div>
                                    <div class="findus" style="float: right; height: 90px; text-align: center; background-color: black; ">
                                        <div class="header-icons-and-phone">
                                            <div class="header-icons-links">
                                                <img alt="youtube icon" src="<%=Page.ResolveUrl("~/Icons/youtube.png")%>" height="24" width="24" />
                                                    
                                                <img alt="facebook icon" src="<%=Page.ResolveUrl("~/Icons/facebook.png")%>" height="24" width="24" />
                                                    
                                                <img alt="twitter icon" src="<%=Page.ResolveUrl("~/Icons/twitter.png")%>" height="24" width="24" />
                                            </div>
                                            <div class="header-icons-links2">
                                                <asp:Label Text="Have questions?" ID="Label2" runat="server" Font-Bold="true" Font-Italic="true" Font-Names="Times New Roman" Font-Size="16px" ForeColor="#11bcf0"></asp:Label>
                                                <br />
                                                <asp:Label Text="" ID="Label3" runat="server" Font-Bold="true" Font-Size="16px" ForeColor="white"></asp:Label>
                                            </div>
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="clear"></div>
                                </div>
                            </div>
                            <!-- logo end -->
 
                            <!-- menu start -->
                            <div class="row10" style="width: 100%; background-color: black; " >
                                <div class="sixteen columns " >
                                    <div class="menubar" >
                                        <THDi:BrokerPlusMenu ID="BrokerPlusMenu1" runat="server" MenuToLoad="Broker+ Office" ProfileName="Office" />
                                    </div>
                                </div>
                            </div>
                            <!-- menu end -->
                            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
         
                            </asp:ContentPlaceHolder>
                        </div>



the code behind file source code that I can distribute:

        protected void Page_Init(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                sType = Request["T"];
                string sUserFormRules = Convert.ToString(Session["UserBrokerPlusFormsRules"]);
                string sRule = "";
 
                this.RadGrid1.AllowFilteringByColumn = true;
                GridHyperLinkColumn hypercolumn = null;
                GridBoundColumn boundcolumn = null;
 
                hypercolumn = new GridHyperLinkColumn();
                hypercolumn.HeaderText = "Edit";
                hypercolumn.UniqueName = "Agent";
                hypercolumn.Text = "<img border=\"0\" alt=\"View\" src=\"../Icons/pencil_16.png\" />";
                hypercolumn.DataNavigateUrlFields = new string[] { "Agent" };
                hypercolumn.DataNavigateUrlFormatString = "OfcAgentEdit.aspx?M=Y&T=" + sType + "K=" + "{" + "0" + "}";
                hypercolumn.AllowFiltering = false;
                hypercolumn.HeaderStyle.Width = Unit.Pixel(50);
                hypercolumn.Exportable = false;
                this.RadGrid1.MasterTableView.Columns.Add(hypercolumn);
 
                hypercolumn = new GridHyperLinkColumn();
                hypercolumn.HeaderText = "Email";
                hypercolumn.UniqueName = "SendAgentMail";
                hypercolumn.Text = "<img border=\"0\" alt=\"View\" src=\"../Icons/mailIcon.gif\" />";
                hypercolumn.DataNavigateUrlFields = new string[] { "AgentEmail" };
                hypercolumn.DataNavigateUrlFormatString = "mailto:" + "{" + "0" + "}";
                hypercolumn.HeaderStyle.Width = Unit.Pixel(30);
                hypercolumn.AllowFiltering = false;
                hypercolumn.Exportable = false;
                this.RadGrid1.MasterTableView.Columns.Add(hypercolumn);
 
                boundcolumn = new GridBoundColumn();
                boundcolumn.UniqueName = "AgentID";
                boundcolumn.DataField = "AgentID";
                boundcolumn.HeaderText = "ID";
                boundcolumn.FilterControlWidth = Unit.Pixel(50);
                boundcolumn.HeaderStyle.CssClass = "mediumgridcol";
                boundcolumn.ItemStyle.CssClass = "mediumgridcol";
                boundcolumn.FooterStyle.CssClass = "mediumgridcol";
                boundcolumn.Visible = true;
                boundcolumn.Exportable = true;
                this.RadGrid1.MasterTableView.Columns.Add(boundcolumn);
 
                boundcolumn = new GridBoundColumn();
                boundcolumn.UniqueName = "AgentFullName";
                boundcolumn.DataField = "AgentFullName";
                boundcolumn.HeaderText = "Name";
                boundcolumn.HeaderStyle.Width = Unit.Pixel(240);
                boundcolumn.FilterControlWidth = Unit.Pixel(100);
                boundcolumn.Visible = true;
                this.RadGrid1.MasterTableView.Columns.Add(boundcolumn);
 
                boundcolumn = new GridBoundColumn();
                boundcolumn.UniqueName = "AgentCellular";
                boundcolumn.DataField = "AgentCellular";
                boundcolumn.HeaderText = "Cellular";
                boundcolumn.FilterControlWidth = Unit.Pixel(60);
                boundcolumn.HeaderStyle.CssClass = "smallgridcol";
                boundcolumn.ItemStyle.CssClass = "smallgridcol";
                boundcolumn.FooterStyle.CssClass = "smallgridcol";
                boundcolumn.Visible = true;
                boundcolumn.Visible = true;
                this.RadGrid1.MasterTableView.Columns.Add(boundcolumn);
 
                boundcolumn = new GridBoundColumn();
                boundcolumn.UniqueName = "AgentEmail";
                boundcolumn.DataField = "AgentEmail";
                boundcolumn.HeaderText = "Email";
                boundcolumn.HeaderStyle.CssClass = "smallgridcol";
                boundcolumn.ItemStyle.CssClass = "smallgridcol";
                boundcolumn.FooterStyle.CssClass = "smallgridcol";
                boundcolumn.Visible = true;
                boundcolumn.Visible = true;
                boundcolumn.FilterControlWidth = Unit.Pixel(100);
                this.RadGrid1.MasterTableView.Columns.Add(boundcolumn);
 
                RadGrid1.AllowPaging = Convert.ToBoolean(Session["ShowListsWithPaging"]);
                RadGrid1.PageSize = 20;
            }
            else
            {
                sType = Request["T"];
            }
        }
 
        protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            //  this code is used to make filter columns visible/invisible as the grid grows/shrinks
            if (e.Item is GridFilteringItem)
            {
                GridFilteringItem Filter = (GridFilteringItem)e.Item;
                Filter["AgentID"].CssClass = "mediumgridcol";
                Filter["AgentCellular"].CssClass = "smallgridcol";
                Filter["AgentEmail"].CssClass = "smallgridcol";
            }
        }
 
        protected void CreateNew_Click(object sender, EventArgs e)
        {
            Response.Redirect("OfcAgentEdit.aspx?M=N&K=&T=" + sType);
        }
 
        public DataTable GetDataTable()
        {
            String ConnString = System.Configuration.ConfigurationManager.ConnectionStrings["BrokerPlus"].ConnectionString;
            DataTable dt = new DataTable();
            //string sStatusNeeded = "";
            DateTime dt1 = Convert.ToDateTime("9/1/2014");
            using (SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["BrokerPlus"].ConnectionString))
            {
                using (SqlCommand cmd = new SqlCommand("[Agents_GetAllByAgent_ExpiringLicenses2]", sqlcon))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(new SqlParameter("@Account", Convert.ToInt32(Session["UserAccount"])));
                    cmd.Parameters.Add(new SqlParameter("@Agent_Expire", dt1));
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        da.Fill(dt);
                        return dt;
                    }
                }
            }
        }
 
        protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            RadGrid1.DataSource = GetDataTable();
        }
    }
}


The sql code to the stored procedure being used:

CREATE PROCEDURE [dbo].[Agents_GetAllByAgent_ExpiringLicenses2]
(
    @Account            int,
    @Agent_Expire        date
)
AS
SELECT Agent, AgentEmail, AgentID, AgentFullName, AgentCellular, AgentLicenseExpires, Agent_Account FROM Agents
WHERE AgentLicenseExpires < @Agent_Expire AND Agent_Account = @Account



 the master file source that I can distribute


Viktor Tachev
Telerik team
 answered on 03 Sep 2014
1 answer
97 views
I'm building a tree dynamically server-side and cannot figure out a way to optionally add an image to the right side of the tree node.

In a regular TreeView, I overrode the TreeNode to handle the RenderPostText() method to allow me to optionally insert my own image in the rendered HTML, but that method does not appear to be supported on RadTreeNode().

I know you can use CSS .rtImg to add a permanent image, but I'm not sure how to use that method server-side (if you even can) to have the impage displayed on only some nodes.

Is there another method I am missing?
Thomas Yanez
Top achievements
Rank 1
 answered on 03 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?