Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
97 views
Hi 

There are few input fields and required field validators and I tried to display the error message inside the control which is not completely possible due to browser related issues. So I thought of alerting the error messages on validation failed. But how can I get the error messages in javascript so that I can display them in an alert box? Is this a possible requirement?

Thanks
Ivy
Shinu
Top achievements
Rank 2
 answered on 08 Nov 2013
4 answers
187 views
I'm just getting started with the Window control. I've placed a RadWindowManager on my form and created a window inside of it:

<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow ID="CVC" runat="server" Animation="Slide"
                Behavior="Resize, Close, Move, Reload" Behaviors="Resize, Close, Move, Reload"
                EnableShadow="True" Height="450px" NavigateUrl="/what_is_cvc.html"
                style="display:none;" Title="Security Code" Width="340px"
                KeepInScreenBounds="True" OffsetElementID="aCvc" VisibleStatusbar="False"
                VisibleTitlebar="True" ShowContentDuringLoad="True" Skin="Windows7">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

I'm opening the window when a link is clicked:
<a id="aCvc" href="#" onclick='radopen(null, "CVC");' >What is this? </a>

When I run it, it works, but the shadow is applied after the Window is shown. When I had a Top and Left offset defined, these were also applied after the Window was shown causing it to jump to a new position. How can I get the properties to apply before the Window is visible?
Marin Bratanov
Telerik team
 answered on 08 Nov 2013
6 answers
556 views
In my site we allow users to create html emails.  We create HTML templates that users edit using the RadEditor.  Afterwards they download the edited HTML and send the email using their own system.  The problem I'm having is with the Image Manager.  A user will upload an image and insert into the HTML but when they download the HTML the image no longer works.  Looking at the HTML that was generated, the image path is relative which is why it doesn't work.  My question is, is there a way to use a URL instead of a relative file path?

Thanks!
Ianko
Telerik team
 answered on 08 Nov 2013
3 answers
121 views
I have a RadAutoCompleteTextbox that loads a list of descriptions that a user is able to start typing and choose from, but i want to be able to do the following, as soon as  user chooses one of the available descriptions it loads the amount text box for it. How can i accomplish that?

I have the folllwing code for the autocomplete box, which works fine

private void grid_ItemCreated(object sender, GridItemEventArgs e)
    {

        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem editableItem = e.Item as GridEditableItem;
            TableCell cell = editableItem["Description"];
            if (cell.Controls.Count > 0 && cell.Controls[0] is RadAutoCompleteBox)
            {
                ((RadAutoCompleteBox)(cell.Controls[0])).TextSettings.SelectionMode = RadAutoCompleteSelectionMode.Single;
                ((RadAutoCompleteBox)(cell.Controls[0])).AllowCustomEntry = false;
                ((RadAutoCompleteBox)(cell.Controls[0])).DataSource = GetTableForAuto();
            }
        }

    }

What event is called when a user chooses a selection from the autocompletebox, and how would i be able to add the text for a different textbox?
Princy
Top achievements
Rank 2
 answered on 08 Nov 2013
1 answer
277 views
Hi,

I have successfully created a project with RadScheduler where I use a custom Appointment class (AllocationViewDataItem) and a custom Resource class (ExtendedResource). This project uses postbacks and a DataSource set in by calling a provider in Page_Load using the required parameters and setting the retrieved list of AllocationViewDataItems (custom appointments) as the DataSource of the scheduler.

var dataSource = DataManager.GetData(WebPart.ViewType, WebPart.DataFiltering, WebPart.ShowAllocationInLabel, selectedDate, numberOfWeeks, selectedRole);
 
Scheduler.DataSource = dataSource;

The custom appointments (AllocationViewDataItems) contain a string property called Resource that contains the key of the resource they are related to.

public class AllocationViewDataItem
    {
        public int Id { get; set; }
 
        public string Resource { get; set; }  //<------ This Property
        public DateTime Start { get; set; }
        public DateTime End { get; set; }
        public Color Color { get; set; }
         
        public string CustomText { get; set; }
 
        ...
    }

The resources and appointments are connected by setting the ForeignKeyField on the ResourceType:
var rType = new ResourceType("User") { ForeignKeyField = "Resource" };
Scheduler.ResourceTypes.Add(rType);
Scheduler.GroupBy = "User";

The scheduler uses the custom appointment class by defining these properties:

<telerik:RadScheduler runat="server"
    ID="Scheduler"
    DataStartField="Start"
    DataEndField="End"
    DataSubjectField="CustomText"
    DataKeyField="Id"
    ...
    >


 This works perfectly and the resources and allocations are shown as they should.

Now, I'd like to change the project so that the data is retrieved using web services because they constant postbacks are not too pretty. I have created a branch of the project that contains a web service that calls the same DataManager and returns a list of AllocationViewDataItems (just like the GetData method in the old Page_Load that was set as DataSource). However, the appointments are no longer matched with resources based on the ForeignKeyField of the ResourceType. No appointments are shown and when I hook into the OnClientAppointmentDataBound event I can see that the appointments are databound, but their collection of Resources is empty. Below is a dummy example of the web service methods (which does not work either):

[WebMethod]
public IEnumerable<AllocationViewDataItem> GetAppointments(ExtendedSchedulerInfo schedulerInfo)
{     
    return new List<AllocationViewDataItem>
               {
                   new AllocationViewDataItem
                       {
                           Id = 1,
                           Start = DateTime.Now,
                           End = DateTime.Now.AddHours(1),
                           CustomText = "Subject",
                           Resource = "test",
                           Color = Color.Red
                       }
               };
}
 
[WebMethod]
public IEnumerable<ResourceData> GetResources(ExtendedSchedulerInfo schedulerInfo)
{
    var res = new List<ResourceData>
               {
                   new ResourceData
                       {
                           Key = "test",
                           Type = "User",
                           Text = "Test"                                 
                       }
               };
    res[0].Attributes.Add("TestAttribute", "testvalue");
    return res;
}

The Scheduler defines the use of the web service and the AllocationViewDataItems as such:

<telerik:RadScheduler runat="server"
    ID="Scheduler"
    DataStartField="Start"
    DataEndField="End"
    DataSubjectField="CustomText"
    DataKeyField="Id"
    ...
    >
<WebServiceSettings Path="/_layouts/TestProject/ProjectAllocationDataService.asmx" ResourcePopulationMode="ServerSide" />
</telerik:RadScheduler>

The custom appointments are simply not connected to the resources so they are not shown. If I use AppointmentData instead and assigns a specific ResourceData object to the Resources property it works, but would mean that I would have to redo a quite a bit of code so I would prefer not to.

Is it not possible to use the ForeignKeyField to combine a custom Appointment class to resources when using Web Services to retrieve data?

Another issue is that I can't successfully use the Attributes property of the ResourceData class. When I add an item to the Attributes collection in the web service method it is not transfered to the Resource class created behind the scenes. I have checked this by adding an item to the Attributes collection in the web service method "GetResources" and then inspecting the Resource class retrieved in the OnResourceHeaderCreated event (here the Attribute collection is empty). See the two attached images. This is an issue as I need to transfer a custom URL property to the resource to make it clickable. 
The attributes are successfully transfered from AppointmentData to the Appointment (adding attribute to AppointmentData object in web service method and retrieving the attribute value in OnClientAppointmentDataBound).

I hope you can help me with either of the two issues.

/Michael
Boyan Dimitrov
Telerik team
 answered on 08 Nov 2013
1 answer
144 views
the default view,  such as
  • id       name 
  • 1          tom
  • 2          jack

but when I user the custom sort,the radgrid view become follows:

  • id       name 
  • 1          tom            system.data.datarowview     system.data.datarowview
  • 2          jack           system.data.datarowview       system.data.datarowview
when I sort one time,the view will add two columns,who can help me?
the source code:
protected void Page_Init(object sender, EventArgs e)
      {
              GridBoundColumn idColumn = new GridBoundColumn();
              idColumn.DataField = "Id";
              idColumn.Display = true;
              idColumn.SortExpression = "Id";
              idColumn.UniqueName = "Id";
              idColumn.HeaderText = "Id";
              RadGrid1.MasterTableView.Columns.Add(idColumn);
          
              GridBoundColumn realNameColumn = new GridBoundColumn();
              realNameColumn.DataField = "RealName";
              realNameColumn.Display = true;
              realNameColumn.HeaderText = "name";
              realNameColumn.UniqueName = "RealName";
              realNameColumn.SortExpression = "RealName";
              RadGrid1.MasterTableView.Columns.Add(realNameColumn);
 
      }
 
protected void Page_Load(object sender, EventArgs e)
      {
              IDAL.IBaseRepository<Model.HS_Docter> doctors = new DAl.BaseRepository<Model.HS_Docter>();
              RadGrid1.DataSource = doctors.GetDataTable("select * from Hs_doctor");  
      }
 
protected void RadGrid1_SortCommand(object sender, GridSortCommandEventArgs e)
      {
 
 
          IDAL.IBaseRepository<Model.HS_Docter> doctors = new DAl.BaseRepository<Model.HS_Docter>();
          switch (e.OldSortOrder)
          {
               
              case GridSortOrder.Ascending:
               
                  e.Item.OwnerTableView.DataSource = doctors.GetDataTable("select * from hs_doctor").Select("", e.CommandArgument.ToString() + " asc");
                  break;
              case GridSortOrder.Descending:
                  e.Item.OwnerTableView.DataSource = doctors.GetDataTable("select * from  hs_doctor" ).Select("", e.CommandArgument.ToString() + " desc"); ;
                
              break;
          }
         
          
 
         
      }

Princy
Top achievements
Rank 2
 answered on 08 Nov 2013
1 answer
103 views
Hello,

I would like to change an image src to the image that i click on in radrotator.

<img id="propImg" runat="server" src="" />
 
<telerik:RadRotator ID="thumbRotator" runat="server" BackColor="Transparent" OnItemClick="viewImage"  EnableRandomOrder="true" BorderStyle="NotSet" BorderWidth="0" BorderColor="Transparent"
PauseOnMouseOver="true" RotatorType="CoverFlowButtons" Width="430" Height="180" ItemHeight="190px" ItemWidth="200px" FrameDuration="1"  ScrollDirection="Left, Right" Skin="MetroTouch">
                    <ItemTemplate>
                        <asp:Image ID="myImage" Width="190px" Height="180px" runat="server" ImageUrl='<%# Container.DataItem %>' AlternateText='<%# VirtualPathUtility.GetFileName(Container.DataItem.ToString()) %>' />
                    </ItemTemplate>
                 </telerik:RadRotator>


Would appreciate some help!

Thanks!
Slav
Telerik team
 answered on 08 Nov 2013
4 answers
336 views
Hi,

I am trying the new version 2013 Q1 (2013.1.220) and have found that Menu does not show items on mouse hover with IE 10. It only shows when clicking (just like when setting ClickToOpen="true") .You can check the demo on Telerik site here.

Another problem is the class .rmExpandDown (and .rmExpandTop...) is by default set to backgroundnone repeat scroll 0 center transparent, which causes the arrow does not show even the menu item has sub items.

.RadMenu_Metro .rmRootLink .rmExpandTop, .RadMenu_Metro .rmRootLink .rmExpandDown
{
    backgroundnone repeat scroll 0 center transparent;
}

Kate
Telerik team
 answered on 08 Nov 2013
1 answer
65 views

 

Hi,
When I try to save formatted text from MS Word I’m getting paragraph tags are combined with class elements (Highlighted below). Please guide me to resolve the issue.

 

'<?xml:namespace prefix = "pclass="MsoListParagraph"style="margin" /><pclass="MsoListParagraph"style="margin:0in0in0pt0.5in;text-indent:-0.25in;mso-list:l0level1lfo1;"><?xml:namespace prefix = "spanstyle="font-size" /><spanstyle="font-size:16px;color:#1f497d;">

<P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><FONT color=#1f497d><FONT size=3>capabilities that serves as the tool for&nbsp;budgeting all o <BR><BR>Current December nbsp;</FONT></FONT></spanstyle="font-size:16px;color:#1f497d;">

</pclass="MsoListParagraph"style="margin:0in0in0pt0.5in;text-indent:-0.25in;mso-list:l0level1lfo1;"></P>'

Ianko
Telerik team
 answered on 08 Nov 2013
9 answers
234 views
Hello Community,

i use the Telerik radasyncupload control like this:

Web.Config
<appSettings>
  <add key="Telerik.AsyncUpload.TemporaryFolder" value="~/App_Data/RadUploadTemp" />
</appSettings>

asp.net
<telerik:RadAsyncUpload ID="rauIconUpload" runat="server" ChunkSize="0" Localization-Cancel="Löschen" Localization-Remove="Entfernen" Localization-Select="Auswählen"
  Culture="de-DE" Skin="MetroTouch" TargetFolder="img/icons" MaxFileInputsCount="1">
</telerik:RadAsyncUpload>
<telerik:RadButton ID="rbtnIconUpload" runat="server" Text="Speichern" Skin="MetroTouch"></telerik:RadButton>

vb.net
Private Sub rbtnIconUpload_Click(sender As Object, e As EventArgs) Handles rbtnIconUpload.Click
 
    If rtxtIconBezeichnung.Text = String.Empty Or rtxtIconBezeichnung.Text = Nothing Or CHKValidation(rtxtIconBezeichnung.Text) = False Then
        rnfUngueltigeEingabe.Visible = True
    Else
        Try
            For Each f As UploadedFile In rauIconUpload.UploadedFiles
                Dim img As New System.Drawing.Bitmap(f.InputStream)
                Dim h As Integer = img.Height
                Dim w As Integer = img.Width
                img.Dispose()
 
                Dim fileName As String = f.GetName()
                IconPfad = "~/img/icons/" & fileName
 
                If w = 16 And h = 16 Then
                    IconSize = "16x16"
                ElseIf w = 32 And h = 32 Then
                    IconSize = "32x32"
                Else
                    rnfIconNichtErzeugt.Visible = True
                    Exit For
                End If
 
                IconErzeugt = Datenzugriff.CRTNeuesIcon(rtxtIconBezeichnung.Text, IconPfad, rcbIconGruppe.SelectedValue, IconSize)
                If IconErzeugt = True Then
                    rnfIconErzeugt.Visible = True
                    Page.ClientScript.RegisterClientScriptBlock([GetType](), "CloseScript", "redirectParentPage('IconVerwaltung.aspx')", True)
                Else
                    rnfIconNichtErzeugt.Visible = True
                End If
            Next
        Catch ex As Exception
            rnfIconNichtErzeugt.Visible = True
        End Try
    End If
End Sub

If i try to use InputStream i get a filenotfoundexeption. I added a Screanshot of this error.

So, what i'm doing wrong?

Thank you for reading.
Daniel
Top achievements
Rank 1
 answered on 08 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?