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

I'm currently using the trial version of the controls.

Does the trial version expire and, if so, can the trial be extended?

Thanks.

Matt.
Sebastian
Telerik team
 answered on 25 Feb 2011
5 answers
351 views
Hello,

I'm have a similar setup to this demo: http://demos.telerik.com/aspnet-ajax/tooltip/examples/default/defaultcs.aspx.
Where I have a repeater, radtooltipmanager that loads a Web User Control that contains a RadUpload and a submit button.
The key difference between the demo and my is that I have a RadUpload control on the Web User Control.
I can't get the RadUpload to work. I understand that I have to disable AJAX somehow,
but can't seem to get to work properly.

Please advise.

Thanks,
Quan

 
Dimitar Terziev
Telerik team
 answered on 25 Feb 2011
3 answers
174 views
Hi Team,
            I want to reorder the grid rows  in client side only , Without server side scripting can i do that.
if i drag and drop any number of rows than it should be reorder properly by client side code.

i achieved it by server side code but i want it should be work for client side.

Please reply me as soon as possible......


Thanks
Azam
Pavlina
Telerik team
 answered on 25 Feb 2011
2 answers
164 views
Hello - if I only have 2 or 3 items in my rotator and I use my mouse scroll wheel over the rotator, those few items scroll up and out of view leaving and empty space.

Is there any way to disable the scroll wheel?
Niko
Telerik team
 answered on 25 Feb 2011
1 answer
504 views
I have a RadGrid which uses the folowing settings

<ClientSettings EnablePostBackOnRowClick="True">
    <Selecting EnableDragToSelectRows="False" AllowRowSelect="True" />
</ClientSettings>

The highlighting of the selected  dataItem or row provides the user with a visual cue to the dataItem he wishes to use without requiring screen real estate to be occupied by a dedicated Select button column. I use the ItemCommand and PreRender events of the grid to do the highlighting. The grid also contains an Edit button column and a Delete button column and this method of row selection works when either of the buttons is clicked e.g. if row 4 is currently selected and I click on the Edit button of row 2, then row2 is rendered in edit mode and is also selected.

My problem lies with the Delete button processing. I am trying to use the technique mentioned in Delete row in grid and prompt alert message to show a javascript Confirm dialog box before proceeding with the Delete operation however the ResponseScripts.Add

statement in the grid's ItemCommand function are not working for me - there are no errors but no Confirm dialog either.

.aspx

 

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FDCSTest.aspx.cs" Inherits="FDCSDev.FDCSTest" %>
  
  
  
<!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>
  
  
  
<link href="StyleSheet.css" type="text/css" />
  
</head>
  
<body class="body">
  
  
  
<form id="form1" runat="server">
  
  
  
<!-- Page Content Area -->
  
  
  
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
  
  
  
<AjaxSettings>
  
  
  
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
  
  
  
<UpdatedControls>
  
  
  
<telerik:AjaxUpdatedControl ControlID="gridFlightSchedule" />
  
  
  
</UpdatedControls>
  
  
  
</telerik:AjaxSetting>
  
  
  
<telerik:AjaxSetting AjaxControlID="gridFlightSchedule">
  
  
  
<UpdatedControls>
  
  
  
<telerik:AjaxUpdatedControl ControlID="gridFlightSchedule" />
  
  
  
</UpdatedControls>
  
  
  
</telerik:AjaxSetting>
  
  
  
</AjaxSettings>
  
  
  
</telerik:RadAjaxManager>
  
  
  
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
  
  
  
</telerik:RadScriptManager>
  
  
  
<div style="width: 800px; height: 800px; margin-left: auto; margin-right: auto;">
  
  
  
<asp:Label ID="lblInfo" runat="server" Text="Label"></asp:Label>
  
  
  
<div style="width: 100%; height: 400px;">
  
  
  
<!-- Flight Schedule Grid Area -->
  
  
  
<telerik:RadGrid ID="gridFlightSchedule" runat="server"
  
  
  
AutoGenerateColumns="False" 
  
DataSourceID="FlightScheduleDataSource" GridLines="None" 
  
Height="380px"
  
  
  
AllowSorting="True" 
  
ShowStatusBar="True"
  
  
  
onitemcreated="gridFlightSchedule_ItemCreated"
  
  
  
onitemcommand="gridFlightSchedule_ItemCommand" 
  
onprerender="gridFlightSchedule_PreRender"
  
  
  
>
  
  
  
<ClientSettings EnablePostBackOnRowClick="True">
  
  
  
<Selecting EnableDragToSelectRows="False" AllowRowSelect="true" />
  
  
  
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
  
  
  
<ClientEvents />
  
  
  
</ClientSettings>
  
  
  
<MasterTableView Name="FlightScheduleTableView" DataKeyNames="fltID,carID" DataSourceID="FlightScheduleDataSource"
  
  
  
NoMasterRecordsText="No flights defined." CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add a new Flight"
  
  
  
GridLines="Horizontal" EditMode="InPlace" >
  
  
  
<CommandItemSettings AddNewRecordText="Add a new Flight" ExportToPdfText="Export to Pdf"></CommandItemSettings>
  
  
  
<Columns>
  
  
  
<telerik:GridBoundColumn DataField="fltID" DataType="System.Int32" 
  
HeaderText="fltID" ReadOnly="True" SortExpression="fltID" UniqueName="fltID" Display="false">
  
  
  
<HeaderStyle />
  
  
  
</telerik:GridBoundColumn>
  
  
  
<telerik:GridBoundColumn DataField="carID" DataType="System.Int32" 
  
HeaderText="carID" ReadOnly="True" SortExpression="carID" UniqueName="carID" Display="false">
  
  
  
<HeaderStyle />
  
  
  
</telerik:GridBoundColumn>
  
  
  
<telerik:GridDropDownColumn 
  
HeaderText="Carrier" SortExpression="carDesc" UniqueName="carDesc" ListTextField="carDesc"
  
  
  
ListValueField="carID" DataField="carID" DataSourceID="CarriersDataSource"
  
  
  
DropDownControlType="DropDownList" AllowVirtualScrolling="true" ShowMoreResultsBox="true"
  
  
  
ItemsPerRequest="10" >
  
  
  
<HeaderStyle Width="12em" />
  
  
  
</telerik:GridDropDownColumn>
  
  
  
<telerik:GridBoundColumn DataField="FltNo" HeaderText="Flight No" 
  
SortExpression="FltNo" UniqueName="FltNo" >
  
  
  
<HeaderStyle Width="6em" />
  
  
  
</telerik:GridBoundColumn>
  
  
  
  
<telerik:GridDropDownColumn 
  
HeaderText="Aircraft" SortExpression="atyDescription" UniqueName="atyDescription" ListTextField="atyDescription"
  
  
  
ListValueField="atyID" DataField="atyID" DataSourceID="AircraftDataSource"
  
  
  
DropDownControlType="DropDownList" >
  
  
  
<HeaderStyle Width="12em" />
  
  
  
</telerik:GridDropDownColumn>
  
  
  
<telerik:GridEditCommandColumn>
  
  
  
<HeaderStyle Width="8em" />
  
  
  
</telerik:GridEditCommandColumn>
  
  
  
<telerik:GridTemplateColumn>
  
  
  
<ItemTemplate> </ItemTemplate>
  
  
  
</telerik:GridTemplateColumn>
  
  
  
<telerik:GridButtonColumn UniqueName="DeleteCol" Text="Delete" CommandName="Delete"></telerik:GridButtonColumn
  
</Columns>
  
  
  
</MasterTableView>
  
  
  
</telerik:RadGrid>
  
  
  
</div>
  
  
  
<asp:SqlDataSource ID="FlightScheduleDataSource" runat="server" 
  
ConnectionString="<%$ ConnectionStrings:FDCSWebFltConnectionString %>"
  
  
  
SelectCommand="SELECT fltID, licID, carID, FltNo, StartDate, EndDate, Mon, Tue, Wed, Thu, Fri, Sat, Sun, atyID FROM fdcs_FltSched WHERE (licID = @licID) ORDER BY FltNo">
  
  
  
<SelectParameters>
  
  
  
<asp:SessionParameter Name="licID" SessionField="licID" />
  
  
  
</SelectParameters>
  
  
  
</asp:SqlDataSource>
  
  
  
<asp:SqlDataSource ID="CarriersDataSource" runat="server" 
  
ConnectionString="<%$ ConnectionStrings:FDCSWebFltConnectionString %>" 
  
SelectCommand="SELECT carID, carDesc FROM fdcs_Carriers WHERE (carID IN (SELECT carID FROM fdcs_LicIdCarNumCode WHERE (licID = @licID)))">
  
  
  
<SelectParameters>
  
  
  
<asp:SessionParameter DefaultValue="" Name="licID" SessionField="licID" />
  
  
  
</SelectParameters>
  
  
  
</asp:SqlDataSource>
  
  
  
<asp:SqlDataSource ID="AircraftDataSource" runat="server" 
  
ConnectionString="<%$ ConnectionStrings:FDCSWebFltConnectionString %>" 
  
SelectCommand="SELECT [atyID], [atyCode], [atyDescription] FROM fdcs_Aircraft WHERE (carID IN (SELECT carID FROM fdcs_LicIdCarNumCode WHERE (licID = @licID)))">
  
  
  
<SelectParameters>
  
  
  
<asp:SessionParameter Name="licID" SessionField="licID" />
  
  
  
</SelectParameters>
  
  
  
</asp:SqlDataSource>
  
  
  
</div>
  
  
  
</form>
  
</body>
  
</html>

.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
  
namespace FDCSDev
{
    public partial class FDCSTest : System.Web.UI.Page
    {
  
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["UserLogInName"] == null)
                {
                    Session["UserLogInName"] = "len";
                    Session["UserID"] = "cc3b700d-b6a7-42ac-b1f0-c2de6e3d0fd9";
                    Session["HomeStation"] = "ABB";
                    Session["HandlerCode"] = "ABC";
                    Session["licID"] = 1;
                }
            }
            lblInfo.Text = " ";
        }
  
        protected void gridFlightSchedule_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item.OwnerTableView.Name == "FlightScheduleTableView" && e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem editItem = e.Item as GridEditableItem;
  
                DropDownList ddList = editItem["carDesc"].Controls[0] as DropDownList;
                if (!e.Item.OwnerTableView.IsItemInserted)
                {
                    //item is about to be edited
                    // don't allow the Carrier or Flight No to be changed once the flight has been created
                    ddList.Enabled = false;
  
                    TextBox tb = editItem["FltNo"].Controls[0] as TextBox;
                    tb.Width = 50;
                    tb.Enabled = false;
                }
                else
                {
                    //item is about to be inserted
                    ddList.AutoPostBack = true;
                    ddList.SelectedIndexChanged += new System.EventHandler(this.Carrier_SelectedIndexChanged);
                }
            }
        }
  
        private void Carrier_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            DropDownList ddl = sender as DropDownList;
            string strCarID = ddl.SelectedValue;
        }
  
        protected void gridFlightSchedule_PreRender(object sender, EventArgs e)
        {
            if (Session["SelectedFlightIndex"] != null)
            {
                Int32 selectedIndex = Convert.ToInt32(Session["SelectedFlightIndex"]);
                gridFlightSchedule.MasterTableView.Items[selectedIndex].Selected = true;
            }
  
        }
  
        protected void gridFlightSchedule_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if ((e.CommandName == RadGrid.EditCommandName) || (e.CommandName == RadGrid.DeleteCommandName) || (e.CommandName == "RowClick"))
            {
                GridDataItem dataItem = e.Item as GridDataItem;
                //dataItem.Selected = true;
                Session["SelectedFlightIndex"] = dataItem.ItemIndexHierarchical;
  
                if (e.CommandName == "Delete")
                {
                    e.Canceled = true;
                    string script = String.Format("if (confirm('Do you wish to Delete the flight ?')) clientDeleteFlight({0});", dataItem.ItemIndexHierarchical);
                    RadAjaxManager1.ResponseScripts.Add(script);
                    //ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('Help!!');", true);   
                }
  
            }
        }
  
    }
}

 

Veli
Telerik team
 answered on 25 Feb 2011
3 answers
96 views
Hi,

If I have a RadTreeList populated with some data, how can I determine client-side if the selected item has a child or not?

function ItemSelected(sender, args) {
               var treelist = $find("radTreeList");
               var selectedIndexes = treelist.get_selectedIndexes();
                 
               var row = selectedIndexes[0];
               var item = treelist.getItem(row);
Veli
Telerik team
 answered on 25 Feb 2011
1 answer
569 views
Hi,

Can u pls help how to display (Date & Time in 24hrs) in
Radtextbox using MaskedEditExtender... below are the code i already tried..pls correct it..or give me other solution.
<asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" AcceptAMPM ="False"
 Mask ="99/99/9999 99:99" MaskType="DateTime"   TargetControlID="Rad_entry_date"> </asp:MaskedEditExtender>
                   <asp:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1"
ControlToValidate="Rad_entry_date" Display="Dynamic" EmptyValueMessage="Input Date and Time"
ErrorMessage="Invalid Time" InvalidValueMessage="Invalid Date and Time"
SetFocusOnError="True" ></asp:MaskedEditValidator>

Thanks..
Vinkel
Top achievements
Rank 1
 answered on 25 Feb 2011
1 answer
122 views
Can I sort by the UniqueName?
Veli
Telerik team
 answered on 25 Feb 2011
3 answers
188 views
I have implemented some custom external Editor Dialogs in my apps which are based on your built-in dialogs. I am wondering what the recommendation is for making sure you haven't made any fixes to the built-in dialogs that need to be addressed in my custom ones. When I look at the changes made in various releases, I don't typically see anything speicifically about the editor dialogs, but surely you must make some changes and bug fixes to these.

Also, it looks like the FileManagerDialogParameters.EnableImageEditor property has been deparacted. Is there no way to enable/disable the image editor in the Image Manager dialog w/o modifying the dialog?

Lastly, it would be nice to be able to hide the file insertion functionality (Insert Button and Properties tab) of the Image Manager in codebehind instead of, again, altering the dialog. I am using the dialog to manage some images (ie not insert them into an editor), so the Insert button and Properties tab should not be show. I can, of course, alter the dialog, but this leads to the fragility issue mentioned above.
Rumen
Telerik team
 answered on 25 Feb 2011
3 answers
274 views
I have a pretty simple scenario using manual data operations with rad list view.  I insert an item into my collection in the ItemInserting event, the listview shows the new item but the insertitemtemplate is still showing.  Is my setup wrong?  Do I have to manually hide the thing?

Markup

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test2.aspx.vb" Inherits="Test2" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="rsm"></telerik:RadScriptManager>
    <div>
        <telerik:RadListView ID="rlv" runat="server" DataKeyNames="UserID" ItemPlaceholderID="itemPlaceholder" Height="400px" AllowPaging="true">
            <InsertItemTemplate>
                <tr>
                    <td>
                        <div style="vertical-align: middle; white-space: nowrap;">
                            <asp:LinkButton ID="btnInsert2" runat="server" Text="Insert" CommandName='<%# Telerik.Web.UI.RadListView.PerformInsertCommandName %>'></asp:LinkButton>
                            <asp:LinkButton ID="btnCancel2" runat="server" Text="Cancel" CommandName='<%# Telerik.Web.UI.RadListView.CancelCommandName %>'></asp:LinkButton>                           
                        </div>
                    </td>
                    <td>
                        <div style="vertical-align: middle; white-space: nowrap;">
                            <telerik:RadComboBox id="RadComboBox1" runat="server" autopostback="True" causesvalidation="False" allowcustomtext="True" backcolor="White" emptymessage="Select a Person" enableloadondemand="True" showmoreresultsbox="True" width="150px" dropdownwidth="200px" zindex="9002" enablescreenboundarydetection="False" style="margin-bottom: 0px" datatextfield="UserName" datavaluefield="pkUserID" filter="Contains" onitemsrequested="RCB_ItemsRequested">
                                        <CollapseAnimation Duration="200" Type="OutQuint" />
                                    </telerik:RadComboBox>
                        </div>
                    </td>
                </tr>
            </InsertItemTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <asp:Literal ID="lName" runat="server" Text='<%# Eval("UserName") %>'></asp:Literal>
                    </td>
                </tr>
            </ItemTemplate>
            <LayoutTemplate>
                <asp:LinkButton ID="btnInsert" runat="server" CausesValidation="False" CommandName='<%# Telerik.Web.UI.RadListView.InitInsertCommandName %>' Text="Add User" />
                <table>
                    <tr>
                        <td style="border: ridge 1px lightgray">
                            <strong>Applicable Users</strong>
                            <table>
                                <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
                            </table>
                        </td>
                    </tr>                   
                </table>
            </LayoutTemplate>
        </telerik:RadListView>
    </div>
    </form>
</body>
</html>

Code Behind

Partial Class Test2
    Inherits System.Web.UI.Page
 
    Public Property Users As IList(Of UserInfo)
        Get
            Return If(ViewState("Users"), New List(Of UserInfo))
        End Get
        Set(ByVal value As IList(Of UserInfo))
            ViewState("Users") = value
        End Set
    End Property
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            Me.Users = GetInitialUsers()
        End If
 
        rlv.DataSource = Users
        rlv.DataBind()
 
        Me.ViewState.SetItemDirty("Users", True)
    End Sub
 
    Private Function GetInitialUsers() As IList(Of UserInfo)
        Dim Users As New List(Of UserInfo)
 
        Users.Add(New UserInfo(1, "1"))
        Users.Add(New UserInfo(2, "2"))
        Users.Add(New UserInfo(3, "2"))
        Users.Add(New UserInfo(4, "4"))
 
        Return Users
    End Function
 
    Protected Sub RCB_ItemsRequested(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs)
        Dim ComboBox As Telerik.Web.UI.RadComboBox = sender
 
        Dim itemOffset As Integer = e.NumberOfItems
        Dim NumberOfItems As Integer = 1000000000
        Dim Take As Integer = 20
 
        For i As Integer = 0 To Take
            ComboBox.Items.Add(New Telerik.Web.UI.RadComboBoxItem(i + itemOffset, (i + itemOffset).ToString))
        Next
 
        Dim NumberOfItemsInComboBox As Integer = e.NumberOfItems + ComboBox.Items.Count
 
        If NumberOfItems > 0 Then
            e.Message = [String].Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", NumberOfItemsInComboBox, NumberOfItems)
        Else
            e.Message = "No matches"
        End If
 
        e.EndOfItems = (NumberOfItemsInComboBox >= NumberOfItems)
    End Sub
 
    Protected Sub rlv_ItemInserting(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadListViewCommandEventArgs) Handles rlv.ItemInserting
        Dim ComboBox As Telerik.Web.UI.RadComboBox = e.ListViewItem.FindControl("RadComboBox1")
 
        If Not String.IsNullOrWhiteSpace(ComboBox.SelectedValue) Then
            Dim UserID As Integer = ComboBox.SelectedValue
            Dim UserName As String = ComboBox.Text
 
            Me.Users.Add(New UserInfo(UserID, UserName))
        Else
            e.Canceled = True
        End If
 
    End Sub
 
    <Serializable()>
    Public Class UserInfo
        Private _UserID As Integer
        Private _UserName As String
 
        Public ReadOnly Property UserID As Integer
            Get
                Return _UserID
            End Get
        End Property
 
        Public ReadOnly Property UserName As String
            Get
                Return _UserName
            End Get
        End Property
 
        Public Sub New(ByVal UserID As Integer, ByVal UserName As String)
            _UserID = UserID
            _UserName = UserName
        End Sub
 
    End Class
 
End Class

I attached a couple of screen shots to illustrate my problem as well
Princy
Top achievements
Rank 2
 answered on 25 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?