Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
430 views
Hi!

I am fairly new to using telerik controls.  I would like to be able to print the full contents of a radgrid that has scrolling enabled.  I found the following post http://www.telerik.com/community/forums/aspnet-ajax/grid/print-radgrid-contents.aspx I am able to print just the contents of the radgrid that has been rendered client side even if I am able to turn off the scrollbar.  I was able to get the count of the number of the rows and saw that they were what I was expecting but only the first 15 or so rows were being printed.  I also tried to accomplish this server side by turning off the scrolling and calling

ScriptManager

 

 

.RegisterStartupScript(this.Page, this.GetType(), "printRADGrid", "PrintRadGrid();", true);

 

 but the contents of my radgrid seems to be null.  I am also using master pages.  I have spent a while trying to find an easy solution and haven't been very successful.  Can someone please point me in the right direction?  Thanks in advance for your help! 
Maria Ilieva
Telerik team
 answered on 14 Jul 2016
2 answers
271 views

I am trying to hide and show RadHtmlChart based on selection of dropdown.  It works fine (hides and shows) unless i set style="display:none;", in that case it does not show itself. Not sure if it matters, but I load control not on Page_Load, but on Button click.

This is another annoyance with Telerik controls that drives me bananas.

Please suggest something

   <telerik:RadHtmlChart runat="server" ID="pieChart" style="display:none;"
                                          Width="1100px" Height="580px"
                                          Transitions="true">
                        <ChartTitle Text="" >                
                          <Appearance Align="Center" Position="Top" Visible="false">
                                <TextStyle Bold="true"/>
                          </Appearance>
                        </ChartTitle>
                        <Legend>
                            <Appearance Position="Right" Visible="false"></Appearance>
                        </Legend>
                        <PlotArea>
                            <Series>
                                <telerik:PieSeries DataFieldY="TotalEmploymentOM" NameField="IndustryName">
                                     <LabelsAppearance Position="OutsideEnd" DataField="IndustryName">
                                    </LabelsAppearance>
                                    <TooltipsAppearance Color="White" DataFormatString="{0:N0}"/>
                                </telerik:PieSeries>
                            </Series>
                        </PlotArea>
                   </telerik:RadHtmlChart>

function onchange_ddlSelectionOM() {

                var ddltext = $('option:selected', $('#ddlSelectionOM')).text();
                if (ddltext == "Pie") {

                    document.getElementById("<%=grdOM.ClientID %>").style.display = "none";
                    document.getElementById("<%=chartJobsBySectorAnnualOM.ClientID %>").style.display = "none";
                    document.getElementById("<%=pieChart.ClientID %>").style.display = "";
                }

            }

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 14 Jul 2016
1 answer
131 views

Hello,

Is there a way to make the filter image/icon standout out more when the column has a filter applied to it.  I'm currently using the Windows 7 skin and it is hard to tell which columns have a filter applied based on the slight difference in styling between the image of a column with no filter vs the image of a column with an active filter.

 

-Alex

Maria Ilieva
Telerik team
 answered on 14 Jul 2016
3 answers
146 views

We use the RadTileList on a RadTab panel as first tab item. When I click on a Tile a new tab is opened.

On leaving the RadTileList tab I would like to save the vertical scroll position and restore it when the RadTileList tab is visited again.

Any ideas how to accomplish this? I did not found any client-side methods for it.

Marin Bratanov
Telerik team
 answered on 14 Jul 2016
1 answer
352 views

Hi,

 

I'd like to know if Telerik has any component or some tutorial/demo to sign a PDF with a certificate.

 

I found this tutorial: http://demos.telerik.com/aspnet-ajax/editor/examples/import-export/pdf-export/defaultcs.aspx to generate a PDF, but I can't find a way to sign this file with a certificate.

 

Is there any way or any Telerik's component to do this task?

 

This would be required to be used on web pages, at the moment ASP.Net or MVC are both acceptable.

 

Thanks,

Adriano Gaspar.

Petya
Telerik team
 answered on 14 Jul 2016
12 answers
361 views

As shown in the examples I have implemented a Provider for the Gantt chart. The provider appears to be working, when I break through it the methods are called, items are inserted, updated and deleted in the database etc. Both GetTasks and GetDependencies return an ITask list. The problem I'm having is that nothing appears in the Gantt chart (it loads with no Tasks showing). 
When I add new Tasks those will show (and are added to the database) and I can update them etc. After a page refresh they also no longer show.

Here is the provider implementation, GetById returns a DataSet and Mutate returns an object containing the ID of inserted item + success/error info:

public class GanttCustomProvider : GanttProviderBase
    {
        private long _projectId;
        private string _connString;
 
        public GanttCustomProvider(long projectId, string connString) : base()
        {
            _projectId = projectId;
            _connString = connString;
        }
 
        public override ITaskFactory TaskFactory
        {
            get
            {
                return new CustomGanttTaskFactory();
            }
        }
 
        public override List<ITask> GetTasks()
        {
            using (var client = new FunctionsClient())
            {
                var source = client.GetById(new Phase { PROJECT_ID = _projectId, ConnectionString = _connString })
                    .Tables[0].AsEnumerable();
 
                var list = source.Select(row => new CustomTask
                {
                    ID = row["ID"],
                    ParentID = row["PARENT"],
                    Title = row["TITLE"].ToString(),
                    Start = (DateTime)row["START_DATE"],
                    End = (DateTime)row["END_DATE"],
                    Summary = (bool)row["SUMMERY"],
                    OrderID = row["ORDER_ID"],
                    Expanded = (bool)row["EXPANDED"],
                    PercentComplete = Decimal.Parse(row["PERCENTCOMPLETE"].ToString()),
                    Time = (double)row["TIME"]
                }).ToList<ITask>();
                return list;
            }
        }
 
        public override ITask InsertTask(ITask t)
        {
            var task = (CustomTask)t;
            using (var client = new FunctionsClient())
            {
                task.ID = client.Mutate(new Phase
                {
                    PROJECT_ID = _projectId,
                    PARENT = (int?)task.ParentID,
                    TITLE = task.Title,
                    START_DATE = task.Start,
                    END_DATE = task.End,
                    SUMMERY = task.Summary,
                    ORDER_ID = (int?)task.OrderID,
                    EXPANDED = task.Expanded,
                    Mode = Modes.Insert,
                    ConnectionString = _connString
                }).returnID;
                return task;
            }
        }
 
        public override ITask UpdateTask(ITask t)
        {
            var task = (CustomTask)t;
            using(var client = new FunctionsClient())
            {
                client.Mutate(new Phase
                {
                    ID = (int)task.ID,
                    PARENT = (int?)task.ParentID,
                    PROJECT_ID = _projectId,
                    TITLE = task.Title,
                    START_DATE = task.Start,
                    END_DATE = task.End,
                    SUMMERY = task.Summary,
                    ORDER_ID = (int)task.OrderID,
                    EXPANDED = task.Expanded,
                    TIME = task.Time,
                    Mode = Modes.Update,
                    ConnectionString = _connString
                });
            }
            return task;
        }
 
        public override ITask DeleteTask(ITask task)
        {
            using (var client = new FunctionsClient())
            {
                client.Mutate(new Phase
                {
                    ID = (int)task.ID,
                    Mode = Modes.Delete,
                    ConnectionString = _connString
                });
 
                return task;
            }
        }
 
        public override List<IDependency> GetDependencies()
        {
            using (var client = new FunctionsClient())
            {
                var source = client.GetById(new PhaseDependency { ProjectID = _projectId, ConnectionString = _connString })
                    .Tables[0].AsEnumerable();
 
                var list = source.Select(row => new Dependency
                {
                    ID = row["ID"],
                    PredecessorID = row["PredecessorID"],
                    SuccessorID = row["SuccessorID"],
                    Type = (DependencyType)row["Type"]
                }).ToList<IDependency>();
                return list;
            }
        }
 
        public override IDependency InsertDependency(IDependency dependency)
        {
            using (var client = new FunctionsClient())
            {
                dependency.ID = client.Mutate(new PhaseDependency
                {
                    PredecessorID = (int)dependency.PredecessorID,
                    SuccessorID = (int)dependency.SuccessorID,
                    Type = (int)dependency.Type,
                    Mode = Modes.Insert,
                    ConnectionString = _connString
                }).returnID;
            }
            return dependency;
        }
 
        public override IDependency DeleteDependency(IDependency dependency)
        {
            using(var client = new FunctionsClient())
            {
                client.Mutate(new PhaseDependency
                {
                    ID = (int)dependency.ID,
                    Mode = Modes.Delete,
                    ConnectionString = _connString
                });
            }
            return dependency;
        }
 
}

Here are the implementations of the Custom Task and Factory:

 

public class CustomTask : Task
    {
        public CustomTask() : base() { }
 
        public double? Time
        {
            get { return (double?)(ViewState["Time"] ?? (double?)null); }
            set { ViewState["Time"] = value; }
        }
 
        protected override IDictionary<string, object> GetSerializationData()
        {
            var dict = base.GetSerializationData();
            dict["Time"] = Time;
 
            return dict;
        }
 
        public override void LoadFromDictionary(System.Collections.IDictionary values)
        {
            base.LoadFromDictionary(values);
 
            Time = values["Time"] == null ? (float?)null : float.Parse(values["Time"].ToString());
        }
    }
 
    public class CustomGanttTaskFactory : ITaskFactory
    {
        Task ITaskFactory.CreateTask()
        {
            return new CustomTask();
        }
    }

 

And finally the Page the Gantt is on:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GanttTest.aspx.cs" Inherits="GanttTest" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager runat="server" />
 
        <telerik:RadGantt runat="server" id="rgPlanning"  AutoGenerateColumns="false" >
            <YearView UserSelectable="True" />
            <Columns>
                <telerik:GanttBoundColumn DataField="Title" DataType="String" Width="100px" HeaderText="Title"/>
                <telerik:GanttBoundColumn DataField="Start" DataType="DateTime" DataFormatString="dd/MM/yy" Width="100px" HeaderText="Start"/>
                <telerik:GanttBoundColumn DataField="End" DataType="DateTime" DataFormatString="dd/MM/yy" Width="100px" HeaderText="End"/>
                <telerik:GanttBoundColumn DataField="Time" DataType="Number" Width="100px" UniqueName="Time" HeaderText="Hours"/>
            </Columns>
                 
            <CustomTaskFields>
                <telerik:GanttCustomField PropertyName="Time" Type="Number" ClientPropertyName="time"/>
            </CustomTaskFields>
        </telerik:RadGantt>
    </div>
    </form>
</body>
</html>

And code behind:

    public partial class GanttTest : Page
    {
        private long? projectID = 3;
        private string connString = "Connectionstring";
 
        protected void Page_Load(object sender, EventArgs e)
        {
            rgPlanning.Provider = new GanttCustomProvider(projectID.Value, connString);
        }
    }

Sam
Top achievements
Rank 1
 answered on 14 Jul 2016
1 answer
339 views

project using RadClientDataSource to binding RadDropdownTree control using WebService WCF. Load data is ok.

This my code:

.aspx:

<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />

    <telerik:RadClientDataSource ID="RadClientDataSource1" runat="server" 
        AllowBatchOperations="True">
        <ClientEvents OnCustomParameter="ParameterMap" OnDataParse="Parse" />
        <DataSource>
            <WebServiceDataSourceSettings BaseUrl="UserInfoService.svc/">
                <Select Url="GetDonVis" DataType="JSON" RequestType="Post" ContentType="application/json; charset=utf-8" />
            </WebServiceDataSourceSettings>
        </DataSource>
        <Schema>
            <Model>
                <telerik:ClientDataSourceModelField FieldName="MaDonVi" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="TenDonVi" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="ParentId" DataType="String" />
            </Model>
        </Schema>
    </telerik:RadClientDataSource>
    <telerik:RadDropDownTree RenderMode="Classic" EnableFiltering="true" ID="RadDropDownTree1" runat="server" 
            DropDownSettings-Height="220px" Width="100%" DropDownSettings-CloseDropDownOnSelection="true"
            ClientDataSourceID="RadClientDataSource1" DataTextField="TenDonVi" 
            DataValueField="MaDonVi" DataFieldID="MaDonVi"
            DataFieldParentID="ParentId" Skin="Office2007">
                <CollapseAnimation Type="None" />
            </telerik:RadDropDownTree>

 

WebService:

[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json)]
        [OperationContract]
        public CustomersResult GetDonVis()
        {
            //Doc data tu DB
            SqlConnection sqlConnection = new SqlConnection();
             try
             {
                 sqlConnection.ConnectionString = "SERVER=localhost;Database=LongBien;UID=sa;PWD=abcde12345-;";
                 sqlConnection.Open();

                 SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM tblDmDonVi;", sqlConnection);
                 DataTable dataTable = new DataTable("DonVi");
                 da.Fill(dataTable);

                 da.Dispose();

                 List<ServiceDonVi> result = new List<ServiceDonVi>();

                 foreach (DataRow dataRow in dataTable.Rows)
                 {
                     ServiceDonVi donVi = new ServiceDonVi();
                     donVi.MaDonVi = dataRow["MaDonVi"].ToString();
                     donVi.TenDonVi = dataRow["TenDonVi"].ToString();
                     if (dataRow["ParentId"] != DBNull.Value)
                     {
                         donVi.ParentId = dataRow["ParentId"].ToString();
                     }

                     result.Add(donVi);
                 }

                 dataTable.Dispose();

                 CustomersResult a = new CustomersResult();
                 a.Data = result;
                 a.Count = 100;

                 return a;
             }
             catch (Exception exception)
             {
                 throw;
             }
             finally
             {
                 sqlConnection.Close();
                 sqlConnection.Dispose();
             }
        }

 

But I has problem: 

1. When addnew data item -> save data in database is ok. (Example: value selected = 5)

2. When edit this item, how to set selected item keep old value (value = 5) has save in database??? 

 

Veselin Tsvetanov
Telerik team
 answered on 14 Jul 2016
1 answer
207 views

i am using TabStrip with RadMultiPage. 

these tabs share the save asp:Button. i would like to know is it possible to trigger the validationgroup base on the current selected tab?

 

for example i have 3 tabs

Tab 1 - Validation group: "validateIntro"

Tab 2 - Validation group: "validateBody"

Tab 3 - Validation group: "validateFinal"

 

so when user is on tab 1 and click on the Next button, only validateIntro should fire, similarly when user is on tab 2 only validateBody should fire

Veselin Tsvetanov
Telerik team
 answered on 14 Jul 2016
3 answers
108 views

hi.

i would like to check how do i enable the "Select" button when the validation fails?

 

my current mock up is as such

1.<telerik:RadAsyncUpload RenderMode="Lightweight" MultipleFileSelection="Disabled" MaxFileSize="500000" OnClientValidationFailed="validationFailed" AllowedFileExtensions="jpg,jpeg,png" MaxFileInputsCount="1" runat="server" ID="fileCourseImage" PostbackTriggers="btnSubmit">
2.</telerik:RadAsyncUpload>

Ivan Danchev
Telerik team
 answered on 14 Jul 2016
6 answers
263 views

Hi,

 I have a radgrid with EditMode​ = "Popup" and EditType = "WebUserControl"

 I can set some parameters of the PopUp using javascript: 

var popUp;
 
function ShowPopUp(sender, args) {
 
    popUp = args.get_popUp();
 
    popUp.style.height = "auto";
    popUp.style.width = "680px";
    popUp.style.left = ((window.innerWidth - 680) / 2).toString() + "px";
    popUp.style.top = ((window.innerHeight - 515) / 2).toString() + "px";
 
}

But how can I modify the settings from the caption of the popup?

Settings like: 

Height

FontSize

FontColor

BackColor

 

Thank you so much for attention! And sorry for my bad english!

 

 

Eyup
Telerik team
 answered on 14 Jul 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?