Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
93 views
how to use Telerik PDFViewer in ASP.NET 2.0,please can you send me sample code.

i am using Telerik dlls version 2012.2.602.40,
Subhashchandra
Top achievements
Rank 1
 asked on 16 Aug 2012
1 answer
187 views
I am using RadCaptcha in our website and I want to change the label (type the code from the image) in to (type the letters from the image).I tried with CSS, but i can not able to override the label.Could you please suggest me how to override the label.
Princy
Top achievements
Rank 2
 answered on 16 Aug 2012
2 answers
408 views
Hi - I am new to telerik controls. I have added a checkbox in Radgrid column header. In the code behing trying to find the column header checkbox control.

My code:

<telerik:RadGrid ID="RadGrid1" Width="97%"
            AllowPaging="True" PageSize="15" runat="server" AllowSorting="True" AllowFilteringByColumn="True" 
            GridLines="None">
            <MasterTableView Width="100%" AutoGenerateColumns="False" DataKeyNames="GrowerId">
                 <Columns>
                     <telerik:GridTemplateColumn UniqueName="TemplateColumn" SortExpression="CompanyName">
                     <HeaderTemplate
                                        <asp:CheckBox id="headerChkbox" OnCheckedChanged="chkHeader_CheckedChanged"  AutoPostBack="true" runat="server" Text="Select All" ></asp:CheckBox
                                       </HeaderTemplate
var chkHeader = RadGrid1.MasterTableView.GetColumn("headerChkbox").HeaderAbbr = "checkbox";
 


I was trying that chkHeader code. it says cannot find uniquename headerChkbox. Please help
Shinu
Top achievements
Rank 2
 answered on 16 Aug 2012
2 answers
113 views
Hi,

Inside Window, how can I put components that are in a panel align to left? Inside window, always they are in center position.

<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow ID="RadWindow1" runat="server" Modal="true" ">
                <ContentTemplate>
                 <asp:Panel ID="panTest" runat="server">
                <p>Test</p>
                </asp:Panel>
                 </ContentTemplate>
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

The result is: 
___________________
|               Test              |
|                                    |
|__________________|

I would like:
___________________
|Test                             |
|                                    |
|__________________|
Princy
Top achievements
Rank 2
 answered on 16 Aug 2012
2 answers
103 views
I have a grid with a date column.  Here is the code:

<telerik:RadGrid ID="grdEvaluations" runat="server"                 
                AllowAutomaticDeletes="True" Width="790px" 
                AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" 
                AutoGenerateColumns="False" AutoGenerateDeleteColumn="True" 
                AutoGenerateEditColumn="True" CellSpacing="0" DataSourceID="sqlEvaluations" 
                GridLines="None" PageSize="20"><MasterTableView DataKeyNames="EvaluationsKey" DataSourceID="sqlEvaluations" CommandItemDisplay="Top"><CommandItemSettings ExportToPdfText="Export to PDF" /><RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" 
                        Visible="True"><HeaderStyle Width="20px" /></RowIndicatorColumn><ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                        Visible="True"><HeaderStyle Width="20px" /></ExpandCollapseColumn><Columns>
                            <telerik:GridBoundColumn DataField="EvaluationsKey" DataType="System.Int32"  
                            Display="False" FilterControlAltText="Filter EvaluationsKey column" 
                            HeaderText="EvaluationsKey" ReadOnly="True" SortExpression="EvaluationsKey" 
                            UniqueName="EvaluationsKey" AllowFiltering="False"></telerik:GridBoundColumn><telerik:GridDropDownColumn DataField="OfficialID" DataSourceID="sqlOfficials" 
                            FilterControlAltText="Filter OfficialDDL column" HeaderText="Official" 
                            ListTextField="Comment" ListValueField="username" UniqueName="OfficialID" 
                            FilterControlToolTip="Filter by OfficialID" 
                            FilterImageToolTip="Filter by OfficialID"></telerik:GridDropDownColumn>
                            <telerik:GridDateTimeColumn DataField="EvalDate" DataFormatString="{0:d}" 
                            FilterControlAltText="Filter EvalDate column" HeaderText="Eval Date" 
                            UniqueName="EvalDate">
                                <HeaderStyle Width="150px" />
                                <ItemStyle Width="150px" />
                            </telerik:GridDateTimeColumn><telerik:GridDropDownColumn DataField="EvaluatorID" DataSourceID="sqlOfficials" 
                            FilterControlAltText="Filter Evaluator column" 
                            FilterControlToolTip="Filter by OfficialID" 
                            FilterImageToolTip="Filter by OfficialID" HeaderText="Evaluator" 
                            ListTextField="Comment" ListValueField="username" UniqueName="EvaluatorID"></telerik:GridDropDownColumn><telerik:GridTemplateColumn AllowFiltering="False" DataField="FilePath" 
                            FilterControlAltText="Filter FilePath column" HeaderText="Evaluation Sheet" 
                            UniqueName="FilePath"><EditItemTemplate><asp:HyperLink ID="hylFilePath" runat="server" NavigateUrl='<%# "~/FileUploads/Evals/" & Eval("FilePath") %>'></asp:HyperLink></EditItemTemplate><InsertItemTemplate>* Max File Size is 200 Kb <telerik:RadAsyncUpload  OnFileUploaded="uplFilePathInsert_OnFileUploaded" ID="uplFilePathInsert" runat="server" MaxFileInputsCount="1" TargetFolder="~/FileUploads/Evals/" MaxFileSize="204800" ToolTip="File size must be less than 200 Kb"></telerik:RadAsyncUpload></InsertItemTemplate><ItemTemplate><asp:HyperLink ID="hylFilePath" runat="server" NavigateUrl='<%# "~/FileUploads/Evals/" & Eval("FilePath") %>'></asp:HyperLink><asp:Label ID="lblFilePath" runat="server" Text='<%# Eval("FilePath") %>' Visible="false"></asp:Label></ItemTemplate></telerik:GridTemplateColumn><telerik:GridBoundColumn AllowFiltering="False" DataField="Comment" 
                            FilterControlAltText="Filter Comment column" HeaderText="Comment" 
                            SortExpression="Comment" UniqueName="Comment"></telerik:GridBoundColumn></Columns><EditFormSettings><EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn></EditFormSettings></MasterTableView><FilterMenu EnableImageSprites="False"></FilterMenu></telerik:RadGrid>

The grid renders properly and everything looks great in IE and FireFox.  However in Safari and Chrome the column width for the Eval Date column is HUGE.  If I set AllowFilter="False" for the EvalDate column the grid looks good in Safari and Chrome again.

Is there a work-around for this and is this a known bug?

Thanks,

Dan

Dan
Top achievements
Rank 2
 answered on 16 Aug 2012
5 answers
95 views
I've noticed that when we have 2 tabs in a form and have rad textbox controls on both tabs, the tab that is not in focus has controls with different widths than specified in the markup. This is happening in IE 7.0. I have confirmed that this is working properly on all other browsers.

I've attached the source code below:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="RadControlsWebApp1.WebForm3" %>
 
<!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" />
    <style type="text/css">
        body
        {
            font-family: Arial, Helvetica, Sans-Serif;
            font-size: 11pt;
            color: Black;
        }
         
        div.MasterContainer
        {
            width: 600px;
            height: 400px;
            padding: 0px;
            margin: auto;
            margin-top: 40px;
        }
    </style>
</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>
    <div class="MasterContainer">
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
            SelectedIndex="0" Skin="Hay" Width="100%">
            <Tabs>
                <telerik:RadTab runat="server" Text="Tab1" Value="Tab1" Owner="RadTabStrip1" PageViewID="rpvTab1"
                    />
                <telerik:RadTab runat="server" Text="Tab2" Value="Tab2" Owner="RadTabStrip1" PageViewID="rpvTab2" />
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
            <telerik:RadPageView ID="rpvTab1" runat="server" Width="100%" >
                <table style="padding: 0px; margin: 0px; border-style: none; border-width: 0px; width: 500px;">
                    <tr>
                        <td>
                            Title:
                        </td>
                        <td>
                            <telerik:RadTextBox ID="RadTextBox1" runat="server" Enabled="true" MaxLength="100" Text="Test"
                                Width="240px">                               
                            </telerik:RadTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Gender:
                        </td>
                        <td>
                            <telerik:RadComboBox ID="RadComboBox1" runat="server" EmptyMessage="Choose Gender"
                                Width="240px">
                                <Items>
                                    <telerik:RadComboBoxItem runat="server" Text="Male" Value="Male" />
                                    <telerik:RadComboBoxItem runat="server" Text="Female" Value="Female" />
                                </Items>
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                </table>
            </telerik:RadPageView>
            <telerik:RadPageView ID="rpvTab2" runat="server" Width="100%">
                <table style="padding: 0px; margin: 0px; border-style: none; border-width: 0px; width: 500px;">
                    <tr>
                        <td>
                            Title:
                        </td>
                        <td>
                            <telerik:RadTextBox ID="txtTitle" runat="server" Enabled="true" MaxLength="100" Text="Test"
                                Width="240px">                               
                            </telerik:RadTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Gender:
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cmbxGender" runat="server" EmptyMessage="Choose Gender"
                                Width="240px">
                                <Items>
                                    <telerik:RadComboBoxItem runat="server" Text="Male" Value="Male" />
                                    <telerik:RadComboBoxItem runat="server" Text="Female" Value="Female" />
                                </Items>
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                </table>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
    </div>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    </form>
</body>
</html>


Patrick Culp
Top achievements
Rank 1
 answered on 15 Aug 2012
5 answers
203 views
I had written a page that employed a RadGrid with an EditTemplate that contained a RadTreeView that itself contained a NodeTemplate. It all worked fine until my RadTreeView got too many nodes in it and just ran way too slow. I decided I need to move toward a Load on Demand solution for the RadTreeView. But the complexity of needing to generate a partial tree of templated nodes within an edited RadGrid has proven just more than I can figure out how to do.

So, I've boiled it down to a simple case that I think captures all the important parts of my implementation. There's a commented section in the code-behind that can be uncommented to enable Load on Demand. I didn't supply any of my futile implementations in TreeView_NodeExpand because none of them have worked. I'm asking for what might go in there to make this example work.

My aspx file is:

<%@ Page AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs"
         Inherits="Telerik.Web.Examples.Grid.Integration.GridWithTreeViewComboBoxEditors.DefaultCS"
         Language="c#" %>
  
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head runat="server"></head>
<body class="BODY">
   <form runat="server" id="mainForm" method="post">
      <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
      <asp:UpdatePanel RunAt="Server"> <ContentTemplate>
         <telerik:RadGrid  ID="FooGrid" OnNeedDataSource="FooGrid_NeedDataSource"
                           OnItemDataBound="FooGrid_ItemDataBound"
                           AutoGenerateEditColumn="true" runat="server" >
            <MasterTableView>
               <EditFormSettings EditFormType="Template">
                  <FormTemplate>
                     <telerik:RadTreeView ID="TreeView" DataTextField="Text" DataFieldID="Key"
                                          DataFieldParentID="Parent" DataValueField="Key"
                                          OnNodeExpand="TreeView_NodeExpand" RunAt="Server" >
                        <NodeTemplate>
                           <telerik:RadButton
                                 ButtonType="ToggleButton" ToggleType="CheckBox" AutoPostBack="false"
                                 Checked='<%# Bind("CanView") %>' Text="View" ID="CanViewButton"
                                 RunAt="Server" />
                           <telerik:RadButton
                                 ButtonType="ToggleButton" ToggleType="CheckBox" AutoPostBack="false"
                                 Text="Alter" RunAt="Server" />
                           - <%# DataBinder.Eval(Container, "Text") %>
                        </NodeTemplate>
                     </telerik:RadTreeView>
                     <telerik:RadButton
                           Text='<%#   (Container is GridEditFormInsertItem) ?
                                       "Insert" : "Update" %>'
                           CommandName='<%#  (Container is GridEditFormInsertItem) ?
                                             "PerformInsert" : "Update" %>' RunAt="Server" />
                     <telerik:RadButton Text="Cancel" CommandName="Cancel" RunAt="Server" />
                  </FormTemplate>
               </EditFormSettings>
            </MasterTableView>
         </telerik:RadGrid>
      </ContentTemplate> </asp:UpdatePanel>
   </form>
</body>
</html>

And my code-behind is:

using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using Telerik.Web.UI;
using System;
using System.Collections.Generic;
  
namespace Telerik.Web.Examples.Grid.Integration.GridWithTreeViewComboBoxEditors {
  
    public partial class DefaultCS : Page {
  
        public void FooGrid_NeedDataSource(Object sender, GridNeedDataSourceEventArgs e) {
            FooGrid.DataSource=new GreekGods();
        }
  
        public void FooGrid_ItemDataBound(Object sender, GridItemEventArgs e) {
            GridEditFormItem item=e.Item as GridEditFormItem;
            if (item != null && item.IsInEditMode) {
                RadTreeView treeView=item.FindControl("TreeView") as RadTreeView;
                if (treeView != null) {
                    treeView.DataSource=new TreeDataList();
                    treeView.DataBind();
                    // To enable Load on Demand, uncomment these lines
//                  foreach (RadTreeNode pNode in treeView.Nodes) {
//                      pNode.ExpandMode=TreeNodeExpandMode.ServerSideCallBack;
//                      pNode.Nodes.Clear();
//                  }
                }
            }
        }
  
        public void TreeView_NodeExpand(Object sender, RadTreeNodeEventArgs e) {
            // What can go in here that will allow me to create nodes according to
            // the NodeTemplate in the aspx file.
        }
    }
  
    //////////// From here down is just canned data
  
    public class GreekGod {
        private string name;
        public string Name { get { return name; } set { name = value; } }
  
        private string description;
        public string Description { get { return description; } set { description = value; } }
  
        private string romanName;
        public string RomanName { get { return romanName; } set { romanName = value; } }
  
        public GreekGod(string name, string description, string romanName)  {
            this.name = name;
            this.description = description;
            this.romanName = romanName;
        }
    }
  
    public class GreekGods : List<GreekGod> {
        public GreekGods() {
            this.Add(new GreekGod("Aphrodite", "Goddess of love, beauty and fertility", "Venus"));
            this.Add(new GreekGod("Apollo", "God of prophesy, music and healing", "Apollo"));
            this.Add(new GreekGod("Ares", "God of war", "Mars"));
        }
    }
  
    public class TreeData {
        private string key;
        public string Key { get { return key; } set { key=value; } }
        private string text;
        public string Text { get { return text; } set { text=value; } }
        private string parent;
        public string Parent { get { return parent; } set { parent=value; } }
        private bool canView;
        public bool CanView { get { return canView; } set { canView=value; } }
  
        public TreeData(string key, string text, string parent)
        { Key=key; Text=text; Parent=parent; }
    }
  
    public class TreeDataList: List<TreeData> {
        public TreeDataList() {
            Add(new TreeData("0", "P1", null)); this[0].CanView=true;
            Add(new TreeData("1", "P1C1", "0"));
            Add(new TreeData("2", "P2", null));
            Add(new TreeData("3", "P2C1", "2"));
            Add(new TreeData("4", "P2C2", "2"));
            Add(new TreeData("5", "P3", null));
            Add(new TreeData("6", "P3C1", "5"));
        }
    }
}

Thanks.

kd

Kevin
Top achievements
Rank 1
 answered on 15 Aug 2012
1 answer
138 views
Hi All,

I'm having some issues building a RadGrid using Advanced Data Binding.  I have a grid that is displaying a report that's run by selection options and clicking a button.  When the button is clicked the first page generates correctly, but any time you try to use any of the paging (click page number, forward, back) the DataSourse appears to be wiped out and the grid becomes invisible again since it is empty.  Any help would be appreciated.

Grid:
<telerik:RadGrid ID="GridComplianceReport" Width="100%" 
     AllowPaging="True" PageSize="30" runat="server" AllowSorting="true" Visible="false" 
     OnNeedDataSource="GridComplianceReport_NeedDataSource" GridLines="None" >
     <MasterTableView Width="100%" />
     <PagerStyle Mode="NextPrevAndNumeric" />
</telerik:RadGrid>

OnNeedDataSource:
protected void GridComplianceReport_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    Employee parentEmployee = new Employee();
    Employee childEmployee = new Employee();
    if (Session["Employee"] != null)
    {
        parentEmployee = (Employee)Session["Employee"];
    }
    if (Session["ChildEmployee"] != null)
    {
        childEmployee = (Employee)Session["ChildEmployee"];
        if (Session["SelectedEmployeeID"].ToString() == parentEmployee.EmployeeID)
        {
            FillComplianceReport(parentEmployee);
        }
        else
        {
            FillComplianceReport(childEmployee);
        }
    }
    else //no child employee, populate with logged in employee
    {
        FillComplianceReport(parentEmployee);
    }
}
private void FillComplianceReport(Employee employee)
{
    lblReportsHeader.Text = employee.Name;
    string who = "";
    ArrayList complianceType = new ArrayList();
    ArrayList complianceStatus = new ArrayList();
    List<Reports> complianceReport = new List<Reports>();
    who = rdbEmployeeType.SelectedItem.Value;
    foreach (ListItem item in chkComplianceTypes.Items)
    {
        if (item.Selected)
            complianceType.Add(item.Value);
    }
    foreach (ListItem item in chkComplianceStatus.Items)
    {
        if (item.Selected)
            complianceStatus.Add(item.Value);
    }
    complianceReport = EmployeeBLL.GetComplianceReports(employee.EmployeeID, who, complianceType, complianceStatus);
    Session["ComplianceReport"] = complianceReport;
    GridComplianceReport.DataSource = complianceReport;
    if (compliancereport.Count > 0)
        GridComplianceReport.Visible = true;
    ReportsExceptionPanel.Visible = false;
}
On Button Click:
protected void btnGenerateComplianceReport_Click(object sender, ImageClickEventArgs e)
{
    GridComplianceReport.Visible = true;
    GridComplianceReport.DataSource = null;
    GridComplianceReport.Rebind();
}
Kate
Top achievements
Rank 1
 answered on 15 Aug 2012
2 answers
188 views
Ok, here is my noob question :-)

I have a footer usercontrol (ascx). This footer control launch server side a radwindow (that is another aspx page).

Here is my code:

RadWindow newWindow = new Telerik.Web.UI.RadWindow();
newWindow.ID = "HelpDeskMessageWindow";
newWindow.NavigateUrl = "ErrorPopup.aspx";
newWindow.AutoSize = true;
newWindow.Modal = true;
RadWindowManager1.Windows.Add(newWindow);
newWindow.VisibleOnPageLoad = true;

As you can see in order to do that I have to put the radwindowmanager inside the usercontrol.

I'm worried about this, because I think that the radwindowmanager should stay in the parent aspx page who contains the control.

What is the best way to do that? i'm doing something wrong?
Thanks a lot

Stefano
Top achievements
Rank 1
 answered on 15 Aug 2012
2 answers
62 views
Hi ,
I have a Page (page1.aspx) that have RadSplitter and RadWindow , I have another Page ( page2.aspx) that have a radgrid . 
page2.aspx is contentpane , when user click a button content load in leftpane of splitter . I want access radwindow from content page(page2.aspx) but I can only see page2.aspx controls.
rtech
Top achievements
Rank 1
 answered on 15 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?