Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
771 views
I'm creating some Radcharts programmatically (no aspx file...it's a web part).

I set Appearance.Dimensions.Height.Value (and .Width), and tried setting Appearance.Dimensions.AutoSize to false.

The chart image is properly sized, but the generated HTML contains this:
<div id="ctl00_ctl23_g_2c6dbf0b_0bfd_497c_aa14_bf4418896fcd_AverageChart" class="RadChart" style="height:300px;width:400px;">
    <img alt="" style="border-width: 0px;" ...
</div>

Where does the style with default height and width in the div element come from?  I add two charts to the page (using Controls.Add(averageChart); ) and they overlay each other because the html doesn't use the correct height.

ASP.NET AJAX 2013 Q2
.NET 3.5 Windows 2008 R2

Thanks,
Randy Lindsey
Randy
Top achievements
Rank 1
 answered on 19 Jun 2013
15 answers
462 views
Hi,

First of all, I want to thank you for producing such a great product like RadScheduler.

Anyway, after I have purchased and try a bit more with it in my current project, I got 2 issues which need your kindly helps/hints to sort it out.

The 1st one is that I got a script error message everytime my mouse cursor hover over any appointment which you can see in the first attachment. (I have implemented a custom provider and post the code below)

The 2nd one is that the resource header row is not well aligned correctly with the appointment area which you can see in the second attachment.

Please suggest.

Here is my custom provider code.
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using AIAPS.DomainModel.Entities; 
using AIAPS.DomainModel.Repositories; 
using Telerik.Web.UI; 
 
namespace AIAPS.DomainModel.Utilities 
{ 
    public class ApsSchedulerProvider : SchedulerProviderBase 
    { 
        private List<Resource> _resources; 
 
        private void LoadResources() 
        { 
            _resources = new List<Resource>(); 
 
            Resource res = new Resource("Machine", "M-001", "M-001"); 
            _resources.Add(res); 
            res = new Resource("Machine", "M-002", "M-002"); 
            _resources.Add(res); 
            res = new Resource("Machine", "M-003", "M-003"); 
            _resources.Add(res); 
            res = new Resource("Machine", "M-004", "M-004"); 
            _resources.Add(res); 
            res = new Resource("Machine", "P-001", "P-001"); 
            _resources.Add(res); 
            res = new Resource("Machine", "P-002", "P-002"); 
            _resources.Add(res); 
        } 
 
        public ApsSchedulerProvider() 
        { 
            LoadResources(); 
        } 
 
        public override void Delete(RadScheduler owner, Appointment appointmentToDelete) 
        { 
            throw new NotImplementedException(); 
        } 
 
        public override IEnumerable<Appointment> GetAppointments(RadScheduler owner) 
        { 
            //throw new NotImplementedException(); 
            List<Appointment> appointments = new List<Appointment>(); 
            foreach (ApsProcessTimeline timeline in ApsProcessTimelinesRepository.List.OrderBy(t => t.BeginTime)) 
            { 
                Appointment app = new Appointment(); 
                app.ID = timeline.ApsProcessTimelineId; 
                app.Start = timeline.BeginTime.Value; 
                app.End = timeline.FinishTime.Value; 
                app.Description = timeline.MachineID; 
                app.Subject = timeline.MachineID; 
                app.Resources.Add(new Resource("Machine", timeline.MachineID, timeline.MachineID)); 
                appointments.Add(app); 
            } 
 
            owner.TimelineView.ShowResourceHeaders = true; 
            owner.TimelineView.GroupBy = "Machine"; 
            owner.TimelineView.GroupingDirection = GroupingDirection.Vertical; 
            //owner.TimelineView.NumberOfSlots = appointments.Count; 
            owner.TimelineView.HeaderDateFormat = "dd/MM/yy"; 
             
            owner.SelectedDate = appointments[0].Start; 
 
            return appointments; 
        } 
 
        public override IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner) 
        { 
            //throw new NotImplementedException(); 
            List<ResourceType> resourceTypes = new List<ResourceType>(); 
            resourceTypes.Add(new ResourceType("Machine")); 
            return resourceTypes; 
        } 
 
        public override IEnumerable<Resource> GetResourcesByType(RadScheduler owner, string resourceType) 
        { 
            //throw new NotImplementedException(); 
            return _resources.FindAll(delegate(Resource res) { return res.Type == resourceType; }); 
        } 
 
        public override void Insert(RadScheduler owner, Appointment appointmentToInsert) 
        { 
            throw new NotImplementedException(); 
        } 
 
        public override void Update(RadScheduler owner, Appointment appointmentToUpdate) 
        { 
            throw new NotImplementedException(); 
        } 
    } 
} 
 

*Note that currently I have only one type of resource which is "Machine" and it is being stored on "MachineID" field.

I am looking forward for your suggestion.

Thank you and best regards,
Seree W.
Carl
Top achievements
Rank 1
 answered on 19 Jun 2013
1 answer
252 views
Hi,

Im using the following pie chart mark:

<telerik:RadHtmlChart ID="rhcGraficoResumoLeitos" SkinsOverrideStyles="true" runat="server" Width="350px" Height="300px">
                                        <ChartTitle Text="Ocupação dos leitos">
                                        </ChartTitle>
                                        <PlotArea>
                                            <Series>
                                                <telerik:PieSeries DataFieldY="Quantidade" ColorField="Cor" NameField="Situação" ExplodeField="IsExploded">
                                                    <LabelsAppearance DataFormatString="{0:N0}">
                                                    </LabelsAppearance>
                                                </telerik:PieSeries>
                                            </Series>
                                        </PlotArea>
                                    </telerik:RadHtmlChart>

And code behind:

private void CarregarResumoLeitos()
        {
            rhcGraficoResumoLeitos.DataSource = GetData();
            rhcGraficoResumoLeitos.DataBind();
        }
 
        private DataSet GetData()
        {
            ControladorInternacao controladorInternacao = new ControladorInternacao();
            List<SalaAtendimentoDTO> listaSalaAtendimento = controladorInternacao.ListarResumoLeitos(AmbienteConexao.Usuario().Cnes);
 
            Color[] barColors = new Color[8]{
               Color.Purple,
               Color.SteelBlue,
               Color.Aqua,
               Color.Yellow,
               Color.Navy,
               Color.Green,
               Color.Blue,
               Color.Red
           };
 
            DataSet ds = new DataSet("Estabelecimento");
            DataTable dt = new DataTable("SalaAtendimento");
 
            dt.Columns.Add("Gênero");
            dt.Columns.Add("Situação");
            dt.Columns.Add("Quantidade");
            dt.Columns.Add("Cor");
            dt.Columns.Add("IsExploded");
 
            int i = 0;
            foreach (SalaAtendimentoDTO salaAtendimentoDTO in listaSalaAtendimento)
            {
                dt.Rows.Add(salaAtendimentoDTO.Genero == string.Empty ? "teste" : salaAtendimentoDTO.Genero, salaAtendimentoDTO.SituacaoSala, salaAtendimentoDTO.Quantidade.ToString(), barColors[i++], true);
            }
 
            ds.Tables.Add(dt);
            return ds;
        }
 
        private static Color CorAleatoria()
        {
            Random randonGen = new Random();
            KnownColor[] names = (KnownColor[]) Enum.GetValues(typeof(KnownColor));
            KnownColor randomColorName = names[randonGen.Next(names.Length)];
            Color randomColor = Color.FromKnownColor(randomColorName);
            return randomColor;
        }


But im not able to color each item in the pie chart.

Can anyone help me please ?

Thanks in advance.
Danail Vasilev
Telerik team
 answered on 19 Jun 2013
2 answers
105 views
Ok,

I'm getting a javascript error any time a RadSearchBox is contained within any element that has a display:none style set to it.

As an example, let's say you want to put a RadSearchBox inside a user control which is inside a RadPanelBar.

Each one of the below user controls contains a RadSearchBox.
<telerik:RadPanelBar ID="RadPanelBar1" runat="server">
  <Items>
      <telerik:RadPanelItem Text="Launch a Something" runat="server">                       
         <ContentTemplate>
            <CRWP:ucLaunchSomething id="ucLaunchSomethingCtl" runat="server"></CRWP:ucLaunchSomething>
          </ContentTemplate>
      </telerik:RadPanelItem>
      <telerik:RadPanelItem runat="server" Text="Launch a Something Else">                       
         <ContentTemplate>
            <CRWP:ucLaunchSomethingElse id="ucLaunchSomethingElseCtl" runat="server"></CRWP:ucLaunchSomethingElse>
         </ContentTemplate>
      </telerik:RadPanelItem>
   </Items>
</telerik:RadPanelBar>

When the above is rendered (in at least IE9), it throws a javascript error in the following line:

z.style.width=(y-(x+w+v+6))+"px";


One of the problems is that y == 0 at this point so it's trying to set the width to a negative number. JavaScript error in IE JavaScript Console is SCRIPT:87 Invalid argument.

Any suggestions on how to make it work without throwing the javascript error would be greatly appreciated.

Thanks



Ben
Top achievements
Rank 1
 answered on 19 Jun 2013
1 answer
112 views
Hello Everyone,

I am having a strange problem. I am adding radeditor to my page with the skin "SiteFinity". When I change the font family for some text in edit mode of editor it is not applying while in the html mode I can see that the correct font family is being applied to the text and in preview mode it displays the correct font.

If I use the default skin for radeditor then the font family is applied in all modes of editor. 

I have found the reason, below is the css rendered in the browser which is preventing to display the correct font family in edit mode 

.Sitefinity.RadEditor, .Sitefinity.RadEditor * {
font-family: Arial,Sans-Serif;
}

Any help can save my life. I am scratching my head!!

I have attached the images to show the problem.. Please dont ask for the sample code project since I can not do that because it is a very big project and very complex code. I hope we can solve it this way.
Ivaylo
Telerik team
 answered on 19 Jun 2013
2 answers
178 views
I have read your online documentation AND watched the relevant SharePoint 2010 videos.
I have also searched your forum to see if there is a similar issue.
I have sent two emails to support but unfortunately received unsatisfactory responses that did not address my questions.

I have installed the Rad Editor for SharePoint 2010 and activated the following site features:
• Use RadEditor to edit HTML fields
• Use RadEditor to edit List Items
 
I have activated the following SPRadListView Site Collection Feature:
 I also added the following line to the ListTools.xml file:
<telerik:EditorModule Name="RadEditorHtmlInspector" Visible="true" Enabled="true" /> to the <modules /> section.
and I added the following code to the ListConfig.xml

<modules>
  <module name="RadEditorDomInspector" />
  <module name="RadEditorHtmlInspector" dockingZone="Module" enabled="true" visible="false"  />

 </modules>

Please see attached for the screenshot I get when I click to edit or add a list item.

 Basically, what I have showing up in SharePoint is not consistent with the demo on your site: http://sharepoint.telerik.com/aspnet-ajax/web-parts/Pages/Content-Editor-Web-Part-using-RadEditor.aspx

I also need to add the following functionality to the editor.
Paste From Word
Strip Formatting from Word etc., AND show the HTML module.
Please provide the appropriate assistance.
Cecil
Top achievements
Rank 1
 answered on 19 Jun 2013
1 answer
219 views
Hi,
I am trying to group my RadScheduler by a resource (Staff). The scheduler has appointments on it and the appointments have resources added by the provider. However, as soon as I add GroupBy="Staff" to the markup, I get no appointments displaying and the scheduler only shows the "all day" row. Interrestingly, a breakpoint in the AppointmentsPopulating method shows the appointments (with the correct resources) but the AppointmentCreated method never fires.

Below is how I've set up the provider to add the Staff resource.
In my provider I have a dictionary defined this way "Private dictResources As IDictionary(Of ResourceType, IEnumerable(Of Resource))" which the GetAppointments method populates like this:
Select Case strType.ToUpper()
    Case "STAFF"
        typType = New ResourceType(strType, True)
        lstResource = GetStaffResources(myInfo.intSite_pKey)
End Select
If Not lstResource Is Nothing Then GetResources.Add(typType, lstResource)

The GetStaffResources method contains the following:
For Each dr As DataRow In dt.Rows
    Dim pKey As Integer = dr.Item(dt.Columns.IndexOf("pKey"))
    Dim Contact_pKey As Integer = dr.Item(dt.Columns.IndexOf("Contact_pKey"))
    Dim Name As String = dr.Item(dt.Columns.IndexOf("Fullname"))
 
    Dim item As New clsSchedResStaff()
 
    item.pKey = pKey
    item.Contact_pKey = Contact_pKey
    item.Name = Name
 
    Dim res As New Resource
    res.Key = item.pKey
    res.Text = item.Name
    res.DataItem = item
    res.Type = "Staff"
 
    GetStaffResources.Add(res)
Next

Finally, LoadResource (which is called from GetAppointments just before the Appointment is added to the list of appointments) looks like this:
Private Sub LoadResources(apt As Appointment)
    Dim arrStaffPKeys As String() = apt.Attributes("StaffPKeys").Split(";")
    For Each pairResource As KeyValuePair(Of ResourceType, IEnumerable(Of Resource)) In dictResources
        Dim lstResources As List(Of Resource) = pairResource.Value.ToList()
        Dim strType As String = pairResource.Key.Name.ToUpper()
 
        For Each theResource As Resource In lstResources
            Select Case strType
                Case "STAFF"
                    Dim item As clsSchedResStaff = DirectCast(theResource.DataItem, clsSchedResStaff)
                    If arrStaffPKeys.Contains(item.Contact_pKey) Then
                        apt.Resources.Add(theResource)
                    End If
            End Select
        Next
    Next
End Sub

As I said, all this works fine until I try to group by "Staff" and then no appointments get to the page. In fact, no TimeSlots get to the page either except the AllDay row. Any help you can provide regarding what could be the cause of this symptom would be appreciated.

Thanks,
Danny
Boyan Dimitrov
Telerik team
 answered on 19 Jun 2013
1 answer
182 views
For anyone wanting to redirect to another page or use the RadTileList as a menu you will quickly find the navigation URL opens a new tab. To avoid this behavior you can simply remove the navigation URL property and replace it with some javascript.

Here is a simple example using 3 tiles and 3 pages to redirect to.

<telerik:RadTileList runat="server" EnableThemeing="true" TileRows="1" SelectionMode="none" OnClientTileClicked="OnClientTileClicked">
            <Groups>
                <telerik:TileGroup>
                    <telerik:RadIconTile Name="Editor" Shape="Wide" Target="_blank" ImageUrl="http://demos.telerik.com/aspnet-ajax/tilelist/Img/Icons/icon_imageeditor.png" BackColor="#00b37d" Title-Text="Image Editor">
                         <PeekTemplate>
                              <img src="http://demos.telerik.com/aspnet-ajax/tilelist/Img/Wide/img_edit.png" alt="DevTools" style="display: block;" />
                         </PeekTemplate>
                         <PeekTemplateSettings Animation="Slide" AnimationDuration="800" Easing="easeInOutBack"
                              ShowInterval="5000" CloseDelay="5000" ShowPeekTemplateOnMouseOver="true" HidePeekTemplateOnMouseOut="true" />
                    </telerik:RadIconTile>
                    <telerik:RadIconTile Name="OrgChart" Target="_blank" Shape="Square" ImageUrl="http://demos.telerik.com/aspnet-ajax/tilelist/Img/Icons/icon_orgchart.png">
                         <Title Text="OrgChart"></Title>
                    </telerik:RadIconTile>
                    <telerik:RadIconTile Name="ListView" Target="_blank" Shape="Square" ImageUrl="http://demos.telerik.com/aspnet-ajax/tilelist/Img/Icons/icon_listview.png" BackColor="#82c92f">
                         <Title Text="ListView"></Title>
                    </telerik:RadIconTile>
                </telerik:TileGroup>
            </Groups>
 
        </telerik:RadTileList>
        <script type="text/javascript">
            function OnClientTileClicked(tileList, args) {
                var tile = args.get_tile();
                var url = args.get_oldValue();
 
                //confirm navigation if url has been specified
                if (tile.get_name() == "OrgChart") {
                    window.location = 'http://demos.telerik.com/aspnet-ajax/orgchart/examples/overview/defaultcs.aspx';
                }
                if (tile.get_name() == "Editor") {
                    window.location = 'http://demos.telerik.com/aspnet-ajax/imageeditor/examples/overview/defaultcs.aspx';
                }
                if (tile.get_name() == "ListView") {
                    window.location = 'http://demos.telerik.com/aspnet-ajax/listview/examples/overview/defaultcs.aspx';
                }
            }
        </script>
Marin Bratanov
Telerik team
 answered on 19 Jun 2013
1 answer
136 views
Hello,

We have implemented a radconfirm as below,

<asp:UpdatePanel runat="server" ID="pnlObjectX" UpdateMode="Conditional">
      <ContentTemplate>
                         <telerik:RadListView ID="ObjectXList" runat="server"
                              ItemPlaceholderID="ObjectXListContainer" OnSelectedIndexChanged="ObjectXList_SelectedIndexChanged">
                              <LayoutTemplate>
                                  <fieldset style="width: 810px; border: none;">
                                      <asp:PlaceHolder ID="ObjectXListContainer" runat="server"></asp:PlaceHolder>
                                  </fieldset>
                              </LayoutTemplate>
                              <ItemTemplate>
                                  <fieldset style="float: left; width: 250px; padding-left: 20px; border: none;">
                                      <div style="padding: 5px; width: 200px; align-content: center; cursor: pointer;">
                                          <div style="display: none">
                                              <asp:Label runat="server" ID="lblObjectXId" Text='<%# Bind("ObjectXId") %>'></asp:Label>
                                          </div>
                                          <div class="FirmName">
                                              <asp:LinkButton ID="RemoveObjectX" CssClass="selectedButtons noValidation" runat="server" CommandName="Select" OnClientClick="DisplayConfirmationForDeleteObjectX(this); return false;">
                                              <img src="../App_Themes/Associa/images/bullet_minus.png" style="vertical-align: middle;" />
                                              </asp:LinkButton>
                                              <asp:Label runat="server" ID="lblFirstName" Text='<%# Bind("FirstName")%>' Style="margin-left: 5px; vertical-align: middle;"></asp:Label><asp:Label runat="server" ID="lblLastName" Text='<%# Bind("LastName")%>' Style="margin-left: 5px; vertical-align: middle;"></asp:Label>
                                          </div>
                                          <div class="FirmAddress">
                                              <asp:Label runat="server" ID="lblEmailAddress" Text='<%# Bind("EmailAddress")%>' Style="margin-left: 40px;"></asp:Label>
                                          </div>
                                      </div>
                                  </fieldset>
                              </ItemTemplate>
                              <EmptyDataTemplate>
                                  <div style="color: #999999; font-size: 14px; font-weight: bold; padding: 0 40%">No associated ObjectXs</div>
                              </EmptyDataTemplate>
                          </telerik:RadListView>
</ContentTemplate>
  </asp:UpdatePanel>


functionDisplayConfirmationForDeleteObjectX(button) {
    window.$ = $telerik.$;
    function CallBack(arg) {
        if (arg) {
            eval(button.href);
        }
        else {
            return false;
        }
    }
    radconfirm("Do you want to delete this Xyz?", CallBack, 450, 180, null, "Delete Xyz");
 
}

This works fine with IE, but it gives problem in Firefox. While debugging script i found that after following code block it get stopped and not going ahead in firefox.

function onclick(event) {
$find('confirm1371571295920').close(true);
}
Marin Bratanov
Telerik team
 answered on 19 Jun 2013
4 answers
173 views
i have a grid that i can trigger the edit form through grideditcommandcolumn. how do i add another column and make it insert and trigger the insert form as well. thank you for your help. i tried the below code but it didn't work. thank for your help

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" PageSize="20"
                    AllowPaging="true" MasterTableView-HierarchyLoadMode="ServerBind" >
                    <PagerStyle Mode="NumericPages" />
<Columns>
                            <telerik:GridBoundColumn SortExpression="Amount" HeaderText="Amount" HeaderButtonType="TextButton" DataField="Amount" />
                            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="LinkButton" EditText="Edit" />
                             <telerik:GridEditCommandColumn UniqueName="InsertCommandColumn" ButtonType="LinkButton" EditText="Insert" />
                        </Columns>
                        <EditFormSettings EditFormType="Template">
                            <FormTemplate>
                                     <telerik:RadTextBox ID="txt_Amount_Edit" runat="server" Width="120px"
                                                Value='<%#Eval("Amount")%>' />
                           </FormTemplate>
                        </EditFormSettings>
</telerik:RadGrid>
Duy
Top achievements
Rank 1
 answered on 19 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?