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

Hi
I'm creating a composite control (say name MyTextBox) which will contains child controls as RadMasked TextBox or Asp.Net TextBox and Button . And then I placed this control in a Demp Page called Defaul.aspx. And I would like to access the text entered in the  MytextBox through javascript as

 

 

document.getElementById(

 

'<%=MyTextBox1.ClientID %>').value.
which is not working because When a compiste control renders, child controls will be wrapped by SPAN element by-default. So How can I access 'value' property from javascript.

 

Maria Ilieva
Telerik team
 answered on 13 Apr 2011
1 answer
54 views
At the moment I am implementing my own behaviour whereby a user clicks on a recurring appointment, and can then choose from a context menu to "Delete all Future Appointments".

This works by parsing the existing Recurrence Rule associated with the appointment, setting the Range.RecursUntil property of the rule to a date/time, and then saving this.

This works, but if you are setting the date/time to part-way through a day, e.g. 14.30 - this is not reflected in the Advanced Form when the user comes to manually edit the Recurrence again.

This is because on the Advanced Form, the "End By" only has a date picker - it doesn't have a time picker as well.

Is there a time-picker available for the "End By" date available?  Or will I have to set the Range.RecursUntil to a "midnight" value all the time? If you are dealing with appointments that recur hourly, then this might cause issues for a few people.

Thanks in advance for your help.
Nikolay Tsenkov
Telerik team
 answered on 13 Apr 2011
3 answers
167 views
Hi All,

The example of  ToolTip  / RadToolTip for RadCalendar  can display the appointment details in the tooltip. And it displays only one appointment for the day that has appointments.  Now I'm working on a RadCalendar with RadToolTip and I need the ToolTip to display all events of that day. 

I passed Start as parameter, my code is:
 
    Private Function IsDayRegisteredForTooltip(ByVal [date] As DateTime) As DateTime 
 
        Dim connectionString As String = ConfigurationManager.ConnectionStrings("eCalendarConnectionString").ConnectionString 
        Dim con As New SqlConnection(connectionString) 
 
        Dim cmd As New SqlCommand("SELECT   Start FROM tblActivities WHERE convert( varchar(10), Start, 101 ) = convert( varchar(10), @Start, 101 )", con) 
        cmd.Parameters.Add(New SqlParameter("@Start", [date])) 
       
        Using con 
 
            con.Open() 
            Dim result As Object = cmd.ExecuteScalar() 
            Return result 
 
        End Using 
 
    End Function 
 
    Protected Sub RadCalendar1_DayRender(ByVal sender As Object, ByVal e As Telerik.Web.UI.Calendar.DayRenderEventArgs) 
 
        Dim returnedStartDate As DateTime = IsDayRegisteredForTooltip(e.Day.[Date]) 
        Dim cell As TableCell = e.Cell 
                 
        cell.Attributes.Add("onmouseover", "ShowToolTip(this);") 
        cell.Attributes.Add("id", "Calendar1_" + e.Day.Date.ToString()) 
          
        cell.Attributes.Add("startDate", returnedStartDate.ToString()) 
         
    End Sub 

Then I got error "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."
I don't know how to do with this. Please help. Thanks !

Svetlina Anati
Telerik team
 answered on 13 Apr 2011
3 answers
153 views
Hi all,

Just wondering if there is a way to add some custom data (in this case an ID) against a RibbonBarMenuItem?

Basically what I am doing is creating the menu from items in a database table - what I want to be able to do is grab the ID in the MenuItemClick event and then execute the correct code accordingly. 

Obviously I could do a lookup on the text itself but this is not ideal and there could potentially be items with the same text so not really an option. I guess I could inherit from the RibbonBarMenuItem and create a custom control with an ID field - would this be the correct solution? or am I missing something obvious?

Any help would be appreciated.

Regards
Kevin       
Nikolay Tsenkov
Telerik team
 answered on 13 Apr 2011
5 answers
283 views
Hey everyone,

I was trying to use the RadRotator as a slideshow device.  It was going good, but I have a lot of trouble making the images line up 1 per "screen" if you will.  If I let it run as a "slideshow" without any buttons showing from the control for awhile, the images gradually get offset by 1-2 px which slowly builds up until 20-30px offset is appearing in each picture.  That is, i see 80% of 1 pic, 20 % of the next (or previous).  It appears as if there is a slight offset, maybe a double-> int loss of precision that is affecting layout.... has anyone encountered this before?   I find if I have the tool buttons visible, this error does not occur, but then the user has to click to move the images, which seems counter-productive to a "slide-show".  My sample is below... note that I have tweaked the width/height of my Rotator, the Item width/height and the actual width/height of the table that the rotator template uses and the offset issue always seems to occurr.

Any input is appreciated.

Thx,
Rob



Sample of my rotator:

    <telerik:RadRotator ID="SlideshowRotator" runat="server"
                FrameDuration="3000" Skin="Web20" RotatorType="SlideShowButtons"
                Width="520" Height="358" ItemWidth="480" ItemHeight="358"
                ScrollDirection="Left,Right">
                        <ItemTemplate>
                        <table style="width:480px; height:356px; margin-bottom:2px;">
                                 <tr><td valign="middle" align="center"><img src='<%# DataBinder.Eval(Container.DataItem, "ImageUrl") %>' alt='<%# DataBinder.Eval(Container.DataItem, "Title")%>'
                                    style='width:<%# DataBinder.Eval(Container.DataItem, "SlideshowWidth") %>px; height:<%# DataBinder.Eval(Container.DataItem, "SlideshowHeight") %>px;' /></td></tr>
                        </table>
                        </ItemTemplate>
                    </telerik:RadRotator>
Marin Bratanov
Telerik team
 answered on 13 Apr 2011
2 answers
126 views
How can make RadTicker to stop ticking ?  I have hooked it to the timer I already have which is for 15 mins. I want RadTicker to start every 15 mins and stop after 5 mins. How can I do that ?

Please help,
Smiely
Niko
Telerik team
 answered on 13 Apr 2011
1 answer
89 views
Hi, 
    I am having a problem in either editing or inserting data into any controls in the RadWindow. Sometimes it will not allow me to do it at all and sometimes if I hold down the left mouse button while the cursor is hovered over the control and type at the same time I can then edit or insert data. In my codesnippet you can see I am dynamically loading a usercontrol to the PopupPage.aspx but in testing I added the server controls directly to the PopupPage.aspx, thinking that maybe it was the usercontrol causing the issue. But still the same issue persisted, can someone please help me?

Codesnippet:

Default.aspx:
  <asp:ImageButton ID="imgAdd" runat="server" OnClientClick="return ShowRadWindowInsertForm('Edit')"  Visible="true" ToolTip="Add User" ImageUrl="~/Common/Images/add.png" />
<telerik:RadGrid ID="radGrid1" runat="server" AllowPaging="True" AllowSorting="True"
    GridLines="None" AutoGenerateColumns="false" OnNeedDataSource="radGrid1_NeedDataSource" OnPageIndexChanged=" radGrid1_PageIndexChanged" OnSortCommand=" radGrid1_SortCommand" OnItemCommand=" radGrid1_ItemCommand" OnItemDataBound=" radGrid1_ItemDataBound">
    <MasterTableView DataKeyNames="Id">
        <RowIndicatorColumn Visible="False">
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn Resizable="False" Visible="False">
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
        <EditFormSettings>
            <PopUpSettings ScrollBars="None" />
        </EditFormSettings>
        <Columns>
            <telerik:GridTemplateColumn SortExpression="FirstName" HeaderText="Full Name" HeaderButtonType="TextButton"
                UniqueName="FullName">
                <ItemTemplate>
                    <%# Eval("FirstName") + " " + Eval("MiddleInitial") + " " + Eval("LastName") + " " + Eval("Suffix")%>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn SortExpression="BirthDate" HeaderText="Birth Date" HeaderButtonType="TextButton"
                HeaderStyle-Width="75px" DataField="BirthDate" UniqueName="BirthDate" DataFormatString="{0:MM/dd/yyyy}">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn HeaderText="User Information" ItemStyle-Width="60px" ItemStyle-HorizontalAlign="Left">
                <ItemTemplate>
                    (H): <%# Custom.Converters.ToString(Custom.Converters.ToString(Eval("HomePhone")).PhoneFormat(Custom.PhoneFormat.DASHES))%><br />
                    (C): <%# Custom.Converters.ToString(Custom.Converters.ToString(Eval("CellPhone")).PhoneFormat(Custom.PhoneFormat.DASHES))%><br />
                    Email: <%# Eval("Email")%>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn SortExpression="AddDate" HeaderText="Date Added" HeaderButtonType="TextButton"
                HeaderStyle-Width="75px" DataField="AddDate" UniqueName="AddDate" DataFormatString="{0:MM/dd/yyyy}">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn HeaderText="Action" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <asp:ImageButton ID="imgEdit" runat="server" ImageUrl="~/Common/Images/pencil.png" CausesValidation="false"
                         />   
                    <asp:ImageButton ID="ibDelete" runat="server" CommandName="Delete" ImageUrl="~/Common/Images/cross.png"
                        CommandArgument='<%#Eval("Id") %>' CausesValidation="false" OnClientClick="return confirm('Are you sure that you want to delete user?');" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
  
<telerik:RadWindowManager ID="radWinMng1" runat="server" EnableShadow="true" >
    <Windows>
        <telerik:RadWindow ID="PopupDialog" Behaviors="Close" runat="server" Title="Editing Record" 
            ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" />
    </Windows>
</telerik:RadWindowManager>
  
Default.aspx.cs:
 protected void radGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            //Is it a GridDataItem
            if (e.Item is GridDataItem)
            {
  
                ImageButton editLink = (ImageButton)e.Item.FindControl("imgEdit");
                editLink.OnClientClick = String.Format("return ShowRadWindowEditForm ('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][" Id"], "Edit");
            }
        }
  
  
Common.js:
function ShowRadWindowEditForm (id, clt ) {
    window.radopen("PopupPage.aspx?id=" + id + "&clt=" + clt , clt + "PopupDialog");
    return false;
}
  
function ShowRadWindowInsertForm(clt) {
    window.radopen("PopupPage.aspx?id=0&clt=" + clt, clt + "PopupDialog");
    return false;
}
  
  
PopupPage.aspx:
<form id="form1" runat="server">
      <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
     <asp:PlaceHolder ID="plControl" runat="server" />
    </form>
PopupPage.aspx.cs:
 protected override void OnInit(EventArgs e)
        {
            //PopupPage.aspx?id=1&clt=AcctAdditionalAuthorizedUserEdit
            LoadUserControl(Request.QueryString["clt"]);
            base.OnInit(e);
        }
  
 protected void Page_Load(object sender, EventArgs e)
        {
            switch (Request.QueryString["clt"])
            {
                case "Edit":
                    Edit ThisCtrl = (Edit)plControl.Controls[0];
                    ThisCtrl.UserId = Common.Converters.ToInt32(Request.QueryString["id"]);
                    break;
            }
        }
  
  
private void LoadUserControl(string controlName)
        {
            string Vpath = string.Format("Controls/{0}.ascx", controlName);
            if (File.Exists(Server.MapPath(Vpath)))
            {
                plControl.Controls.Add(LoadControl(Vpath));
            }
        }
  
Edit.ascx:
<fieldset>
    <legend>Edit Data</legend>
    <table style="width: 100%"
        <tr>
            <td style="width:300px; vertical-align: top;">
                <div>
                    <div class="EditFormLeft REQ">
                        First Name:</div>
                    <div class="EditFormRight">
                        <asp:TextBox ID="txtFirstName" runat="server" TabIndex="6"></asp:TextBox>
                    </div>
                    <div class="Clear">
                    </div>
                    <div class="EditFormLeft">
                        Middle Initial:</div>
                    <div class="EditFormRight">
                        <asp:TextBox ID="txtMiddle" runat="server" Width="20" MaxLength="1" TabIndex="7"></asp:TextBox>
                    </div>
                    <div class="Clear">
                    </div>
                    <div class="EditFormLeft REQ">
                        Last Name:</div>
                    <div class="EditFormRight">
                        <asp:TextBox ID="txtLastName" runat="server" TabIndex="8"></asp:TextBox>
                         <input type="text" name="last-name" id="lastName" />
                    </div>
                    <div class="Clear">
                    </div>
                    <div class="EditFormLeft">
                        Suffix:</div>
                    <div class="EditFormRight">
                        <asp:DropDownList ID="ddlNameSuffix" runat="server" TabIndex="9">
                            <asp:ListItem Text="Select..." Value="-1"></asp:ListItem>
                            <asp:ListItem Text="Junior" Value="Junior"></asp:ListItem>
                            <asp:ListItem Text="Senior." Value="Senior"></asp:ListItem>
                            <asp:ListItem Text="II" Value="II"></asp:ListItem>
                            <asp:ListItem Text="III" Value="III"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                    <div class="Clear">
                    </div>
                    <div class="EditFormLeft REQ">
                        Birth Date:</div>
                    <div class="EditFormRight">
                        <telerik:RadMaskedTextBox ID="txtBdate" runat="server" Mask="##/##/####" DisplayMask="##/##/####" Width="75px"
                            LabelCssClass="" TextWithLiterals="//" TabIndex="13">
                        </telerik:RadMaskedTextBox>
                    </div>
                </div>
            </td>
            <td style="width: 300px; vertical-align: top;">
                <div class="Clear">
                </div>
                <div class="EditFormLeft REQ">
                    Home Phone:</div>
                <div class="EditFormRight">
                    <telerik:RadMaskedTextBox ID="txtHomePhone" runat="server" SkinID="PhoneBox" TabIndex="11">
                    </telerik:RadMaskedTextBox>
                </div>
                <div class="Clear">
                </div>
                <div class="EditFormLeft REQ">
                    Cell Phone:</div>
                <div class="EditFormRight">
                    <telerik:RadMaskedTextBox ID="txtCellPhone" runat="server" SkinID="PhoneBox" TabIndex="12">
                    </telerik:RadMaskedTextBox>
                </div>
                <div class="Clear">
                </div>
                <div class="EditFormLeft REQ">
                    E-mail Address:</div>
                <div class="EditFormRight">
                    <asp:TextBox ID="txtEmail" runat="server" Width="235" TabIndex="1"></asp:TextBox>
                </div>
                <div class="Clear">
            </td>
        </tr>
    </table>
</fieldset>
  
Edit.ascx.cs:
 public int UserId { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadData(); 
            }
        }
   
        private void LoadData()
        {
            if (UserId  > 0)
            {
                using (DataClass DC = new DataClass())
                {
                    UserObjectData User = Custom.User.GetUsersById(UserId );
                    txtFirstName.Text = User.FirstName;
                    txtBdate.Text = ArxUtilities.ObjectConverters.ToStringFromDate(User.BirthDate);
                    txtCellPhone.Text = User.CellPhone;
                    txtEmail.Text = User.Email;
                    txtHomePhone.Text = User.HomePhone;
                    txtLastName.Text = User.LastName;
                    txtMiddle.Text = AcctAuthUser.MiddleInitial;
                    ddlNameSuffix.SelectedValue = User.Suffix;
                }
            }
            else
            {
                txtFirstName.Text = string.Empty;
                txtBdate.Text = string.Empty;
                txtCellPhone.Text = string.Empty;
                txtEmail.Text = string.Empty;
                txtHomePhone.Text = string.Empty;
                txtLastName.Text = string.Empty;
                txtMiddle.Text = string.Empty;
                ddlNameSuffix.SelectedIndex = 0;
            }
        }
Marin Bratanov
Telerik team
 answered on 13 Apr 2011
8 answers
304 views
Hi,

I have download Telerik.Web.UI_2011_1_315_Trial.msi and install but I am working on .net 2.0 and this is for .net 3.5 and 4.0 . Is there any new version for .net 2.0 in which you have solved memory leak issue?

Thanks ,
Hemant

Marin Bratanov
Telerik team
 answered on 13 Apr 2011
1 answer
63 views
Hello,

I want to add ToolTips  for each Tag in a TagCloud (showing various Information about the current Tag... this information should load using ajax).

I already tried some strategies (client and server side) but had no success.

Does somebody has any advice?
Pero
Telerik team
 answered on 13 Apr 2011
3 answers
249 views
hello

        I have image column in database and i need to retrive the value from image url data from db to my auto generated column in rad grid

please reply'

Thanks in advance
Tsvetina
Telerik team
 answered on 13 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?