Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
107 views
I've got this as my code for the ComboBox opened client-side event...
function DropdownOpened(sender, e)
{
    var treeView = sender.get_items().getItem(0).findControl("RadTreeView1");
    treeView.get_element().focus();
    var node = treeView.get_selectedNode();
    if (node)
    {
        while (node.get_parent() && node.get_parent() instanceof Telerik.Web.UI.RadTreeNode)
        {
            node.set_expanded(true);
            node = node.get_parent();
        }
        treeView.get_selectedNode().scrollIntoView();
    }
}

The code works but the scrollIntoView call doesn't have any impact.

FWIW, I've tried wrapping the scrollIntoView call in a timeout call but to no avail.

Am I doing it wrong or are my expectations too high?

Shinu
Top achievements
Rank 2
 answered on 24 Apr 2013
1 answer
70 views
Hi,

Just starting to use the scheduler and have tried to create a test program based on the 'overview' demo.  This has a RadCalendar and a RadScheduler and it looks to be working correctly to start with but my problem is that when I click on a date in the calendar the scheduler is not refreshing to pick up the change.  I have checked my code and other than changing the data source for the scheduler to read from an object list I cannot see what I have changed yet it doesn't work.  I have checked that the OnCalendar1DateSelected event is being called when I click on the calendar and this is calling the set_selectedDate method of the scheduler but the scheduler itself stays on the original date.  Any suggestions most welcome as I have been looking at this for a while now and cannot see why my test is different from the sample.
Plamen
Telerik team
 answered on 24 Apr 2013
1 answer
174 views
Hi,

Just starting to use the scheduler and have tried to create a test program based on the 'overview' demo.  This has a RadCalendar and a RadScheduler and it looks to be working correctly to start with but my problem is that when I click on a date in the calendar the scheduler is not refreshing to pick up the change.  I have checked my code and other than changing the data source for the scheduler to read from an objcet list I cannot see what I have changed yet it doesn't work.  I have checked that the OnCalendar1DateSelected event is being called when I click on the calendar and this is calling the set_selectedDate method of the scheduler but the scheduler itself stays on the original date.  Any suggestions most welcome as I have been looking at this for a while now and cannot see why my test is different from the sample.
Plamen
Telerik team
 answered on 24 Apr 2013
1 answer
123 views
Hi
     How can I limit the number of characters to type inside filtertextbox. Please provide a solution from server-side.

thanks in advance
Allen
Shinu
Top achievements
Rank 2
 answered on 24 Apr 2013
0 answers
45 views
Hi,

I am using AutoComplete filter text for a template column in RadGrid. I am saving the custom Filter for future use. when I am saving for a single token it is  saving the filterexpression as    <FilterExpression>iif(ClientName == null, "", ClientName).ToString() = "ACLU") </FilterExpression>  but when I am trying to save with multiple tokens in AutoCompleteFilter the grid is filtering but on saing the current filter the filter expression becomes   <FilterExpression> </FilterExpression> which leades loading all the grid that . 
Please suggest .

Srimanta
Top achievements
Rank 1
 asked on 24 Apr 2013
6 answers
1.5K+ views
Hi,

Is there any way to check the length of filename before uploading process? If the length is greater than 80 characters then cancel upload.
Currently the only way to cancel upload is OnClientFilesSelected event but I can not get filename from event argument.

Any help please?

Thanks,
Charlie

Plamen
Telerik team
 answered on 24 Apr 2013
1 answer
164 views
Hi,

I am currently developing RadGrid control in the web form (aspx) and also develop usercontrol (asxc) which has RadTreeView and two buttons (Add and Cancel).

How can I add new items to the RadGridView in the web form when I checked some boxes of the treeview and then clicked "Add" button in the usercontrol? 

I have source code below.

.ASPX 

<telerik:RadGrid ID="rgRequestLocations" runat="server" CellSpacing="0" GridLines="None" AutoGenerateColumns="False"
                                  OnNeedDataSource="rgRequestLocations_NeedDataSource" OnPreRender="rgRequestLocations_PreRender" OnItemInserted="rgRequestLocations_ItemInserted">
                                  <MasterTableView InsertItemDisplay="Top" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add Locations to Request">
                                      <NoRecordsTemplate>
                                          <table>
                                              <tr>
                                                  <td>
                                                      <asp:Label ID="lblNoRecords" runat="server" Style="color: red; font-weight: bold" TabIndex="14">You have not added any locations to the request.</asp:Label></td>
                                              </tr>
                                          </table>
                                      </NoRecordsTemplate>
                                      <Columns>
                                          <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
                                          </telerik:GridEditCommandColumn>
                                          <telerik:GridBoundColumn SortExpression="location_pk" HeaderText="Location ID" HeaderButtonType="TextButton"
                                              DataField="location_pk" Visible="false">
                                          </telerik:GridBoundColumn>
                                          <telerik:GridBoundColumn HeaderText="Location Name" HeaderButtonType="TextButton"
                                              DataField="location_name">
                                          </telerik:GridBoundColumn>
                                          <telerik:GridEditCommandColumn ButtonType="PushButton" UniqueName="modify" EditText="Modify">
                                          </telerik:GridEditCommandColumn>
                                          <telerik:GridButtonColumn ButtonType="PushButton" CommandName="Delete" Text="Remove Location" UniqueName="removelocation">
                                          </telerik:GridButtonColumn>
                                      </Columns>
                                      <EditFormSettings EditFormType="WebUserControl" UserControlName="~/Registration/Controls/PO_Registration.ascx">
                                          <EditColumn UniqueName="EditCommandColumn1">
                                          </EditColumn>
                                      </EditFormSettings>
                                  </MasterTableView>
 
                              </telerik:RadGrid>

In the Code-Behind of ASPX

protected void rgRequestLocations_ItemInserted(object sender, GridInsertedEventArgs e)
{
    UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
    //insert a new values
 
    Hashtable newVlaues = new Hashtable();
    newVlaues["Grid"] = (userControl.FindControl("rtvlocation") as RadTreeView).GetAllNodes();
 
}


ASCX
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PO_Registration.ascx.cs" Inherits="Registration_Controls_PO_Registration" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<div style="padding: 10px">
    <telerik:RadDropDownList ID="ddlAdministrations" runat="server" AutoPostBack="true"
        OnSelectedIndexChanged="ddlAdministrations_SelectedIndexChanged">
    </telerik:RadDropDownList>
</div>
<div id="displayTreeViewAdmin" runat="server" visible="false" style="padding: 10px">
    <div>
        <telerik:RadTreeView ID="rtvLocations" runat="server" CheckBoxes="True"
            CausesValidation="False" TriStateCheckBoxes="False" DataFieldID="location_pk"
            DataFieldParentID="parent_fk" DataTextField="location_name" DataValueField="location_pk" />
    </div>
    <div style="padding: 10px">
        <telerik:RadButton ID="btnAddLocations" runat="server" Text="Request Checked Locations" CommandName="Add" Visible='<%# !(DataItem is Telerik.Web.UI.GridInsertionObject) %>' OnClick="btnAddLocations_Click"></telerik:RadButton>
        <telerik:RadButton ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click"></telerik:RadButton>
    </div>
 
</div>

In the code-behind of Ascx

private object _dataItem = null;
 
    public object DataItem
    {
        get
        {
            return this._dataItem;
        }
        set
        {
            this._dataItem = value;
        }
    }
 
#region Control Methods
    override protected void OnInit(EventArgs e)
    {
        InitializeComponent();
        base.OnInit(e);
    }
 
    private void InitializeComponent()
    {
        btnAddLocations.Visible = true;
        PopulateAdminstrations();
    }
    #endregion
 
 
 
#region Button Events
    protected void btnAddLocations_Click(object sender, EventArgs e)
    {
        /*loop through tree, create datatable with appropriate columns, and bind the datatable to radgrid*/
        //create new properties
        const string locationid = "location_id";
        const string locationname = "location_name";
 
        //initizlize new object of datatable level 1
        DataTable dt = new DataTable();
 
        dt.Clear();
 
        //create a new colum for table level 1
        DataColumn dcol = new DataColumn(locationid, typeof(System.Int32));
        dt.Columns.Add(dcol);
 
        dcol = new DataColumn(locationname, typeof(System.String));
        dt.Columns.Add(dcol);
 
        foreach (RadTreeNode row in rtvLocations.GetAllNodes())
        {
            if (row.Checkable)
            {
                if (row.Checked)
                {
                    //Create a new row
                    DataRow drow = dt.NewRow();
                    drow[locationid] = row.Value;
                    drow[locationname] = row.Text;
                    //add row to the datatable
                    dt.Rows.Add(drow);
                }
            }
        }
 
        Session["RequestAdded"] = dt;
 
         
 
    }
 
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        /*Close radgrid edit form*/
    }
    #endregion


Your help is very appericated very well.

Thanks,
Chi Ming 
Kostadin
Telerik team
 answered on 24 Apr 2013
1 answer
116 views
Hi,

I have a list of countries and regions in an xml file and I want to bind Combobox to that xml file. Is it possible to set XmlDataSource to RadComboBox  ?
Kate
Telerik team
 answered on 24 Apr 2013
1 answer
84 views

Hi,

I have converted my solution from vs 2005 to vs2010 using the vs 2010 wizard. when i build the application it was built successfully, however i am getting warning "done with some errors" on the bottom of the page. Which is actually not generating the data in my page.
Before converting the code in view source was -->
Filter by Status:&nbsp;<select name="ctl00$contentContent$ddlStatusFilter" onchange="javascript:setTimeout('window[\'ctl00_contentContent_RadAjaxManager1\'].AsyncRequest(\'ctl00$contentContent$ddlStatusFilter\',\'\')', 0)"  
After converting the code using wizard the same code in view source is visible as-->

            Filter by Status:&nbsp;<select name="ctl00$contentContent$ddlStatusFilter" onchange="javascript:setTimeout(&#39;window['contentContent_RadAjaxManager1'].AsyncRequest(\&#39;ctl00$contentContent$ddlStatusFilter\&#39;,\&#39;\&#39;)&#39;, 0)" id="contentContent_ddlStatusFilter" tabindex="10" style="width:119px;">

If you observe all the " ' " are converted into " &#39; " becuase of this i am getting the error  
Webpage error details

Message: Expected ')'
Line: 119
Char: 21
Code: 0
Please suggest how to resolve this issue. 

Slav
Telerik team
 answered on 24 Apr 2013
2 answers
125 views
Hi,

I can change the ImageUrl after transferring an item from left to right.
BUT if I transfer it to left and then to the right side again. The ImageUrl cannot be change.

Here's the demo:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="Test.WebForm1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
 
<head runat="server">
    <title></title>
    <script type="text/javascript">
        var containerPrefix = '';
        var trvElementsID = containerPrefix + 'trvElements';
        var trvQueriesID = containerPrefix + 'trvQueries';
        var trvOrdersID = containerPrefix + 'trvOrders';
        var trvRangesID = containerPrefix + 'trvRanges';
        var lsbOrderItemTargetID = containerPrefix + 'lsbOrderItemTarget';
        var hidQueriesChangedID = containerPrefix + 'hidQueriesChanged';
        var hidOrdersChangedID = containerPrefix + 'hidOrdersChanged';
        var hidRangesChangedID = containerPrefix + 'hidRangesChanged';
         
        function ToggleSort(sender, args) {
            //    debugger;
            var imgAsc = 'ascending.png';
            var imgDesc = 'descending.png';
            var listboxTarget = $find(lsbOrderItemTargetID);
 
            if (listboxTarget) {
                var selectedItem = listboxTarget.get_selectedItem();
 
                if (selectedItem) {
                    listboxTarget.trackChanges();
                    //imageUrl
                    var oldImgUrl = selectedItem.get_imageUrl();
                    var arrUrl = oldImgUrl.split("/");
 
                    //value
                    var oldValue = selectedItem.get_value();
                    var arrValue = oldValue.split(".");
 
                    if (arrValue[0] == 'asc') {
                        arrValue[0] = 'desc';
                        arrUrl[arrUrl.length - 1] = imgDesc;
                    } else {
                        arrValue[0] = 'asc';
                        arrUrl[arrUrl.length - 1] = imgAsc;
                    }
 
                    var newImgUrl = arrUrl.join("/");
                    var newValue = arrValue.join(".");
                     
                    selectedItem.set_value(newValue);
                    selectedItem.set_imageUrl(newImgUrl);
                    listboxTarget.commitChanges();
                }
                else {
                    alert('no item selected');
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" ScriptMode="Release" EnableScriptLocalization="true" EnableScriptGlobalization="true"
        CombineScripts="false" runat="server" EnablePartialRendering="true" />
 
        <div>
        <telerik:RadListBox ID="lsbOrderItemSource" SelectionMode="Multiple" AllowTransfer="true" AllowReorder="false" TransferToID="lsbOrderItemTarget"
            PersistClientChanges="true" Skin="Outlook" runat="server" Height="500px" Width="30%" >
                <Items>
                    <telerik:RadListBoxItem Text="test1" ImageUrl="Images/ascending.png"/>
                    <telerik:RadListBoxItem Text="test2" ImageUrl="Images/ascending.png"/>
                    <telerik:RadListBoxItem Text="test3" ImageUrl="Images/ascending.png"/>
                    <telerik:RadListBoxItem Text="test4" ImageUrl="Images/ascending.png"/>
                </Items>
            </telerik:RadListBox>
 
        <telerik:RadButton runat="server" ID="teleriktoggle" Text="ASC/DESC" OnClientClicked="ToggleSort" AutoPostBack="false"></telerik:RadButton>
        <telerik:RadListBox ID="lsbOrderItemTarget" SelectionMode="Multiple"
            AllowReorder="true" Skin="Outlook" runat="server" Height="500px" Width="30%" PersistClientChanges="true"/>
        </div>
    </div>
    </form>
</body>
</html>


Thanks in advance for your help.
Christian.
Nencho
Telerik team
 answered on 24 Apr 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?