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

There is a dropdownlist being populated in the OnItemDataBound event.

protected void RadGrid1_OnItemDataBound(object source, GridItemEventArgs e)
        {
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
            GridEditableItem gEditableItem = (GridEditableItem)e.Item;
       
             //hit the framework and get a datatable
  
             DropDownList ddlEffectiveDate = (DropDownList)gEditableItem["efct_period_date"].FindControl("DdlEffectiveDate");
  
                 ddlEffectiveDate.DataSource = dt;
                dlEffectiveDate.DataTextField = "start_date";
                ddlEffectiveDate.DataValueField = "period_id";
                ddlEffectiveDate.DataBind();
                  
                ddlEffectiveDate.Items.Remove(ddlEffectiveDate.Items[0]);
   
  
  
                 


That last line removes the firstitem of the datatable that I've bound the dropdown list to- but the value from the column itself somehow ends up appended into the dropdown list.   I'd like to know what event that happens in.

I want to remove the column value from the dropdownlist Edit Item.   How do I do that?
Jayesh Goyani
Top achievements
Rank 2
 answered on 11 May 2013
7 answers
264 views
I have a very annoying issue: RadcomboBox does not display properly. It looks like the bottom line of control rectangular is missing
and the top line appears to be not 100% straight. This is shown in all IE, firefox and chrome. I attached a screenshot here. This issue makes screen look ugly.

I am using 2013.1.227.40 trial version.

Your help is appreciated.

Kevin
Kevin Sheng
Top achievements
Rank 1
 answered on 10 May 2013
2 answers
237 views
This is what I have:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="btnTest"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="btnTest" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"  
        Skin="Default"
    </telerik:RadAjaxLoadingPanel> 
    <asp:Button runat="server" Text="OK" ID="btnTest" /> 

and my code behind:
protected void Page_Load(object sender, EventArgs e) 
    { 
        if (Page.IsPostBack) 
        { 
            throw new Exception("test"); 
        } 
    } 



When i click the button nothing happens, no alert box, no exception notification nothing...can someone point me in the right direction?

Thanks


Mark
Top achievements
Rank 1
 answered on 10 May 2013
3 answers
186 views

Hello,

I'd like to persist the selected Items on client side. I've found an article that describes the solution for RadGrids: http://www.telerik.com/help/aspnet-ajax/grid-persist-selected-rows-client-sorting-paging-grouping-filtering.html .

I tried to apply this solution for RadTreeList. I've replaced the OnRowCreated, OnRowSelected, OnRowDeselected, OnGridCreated event handlers with OnItemCreated, OnItemSelected, OnItemDeselected, OnTreeListCreated event handlers. When the grid is created the OnItemCreated even handler fires and the connected javascript is invoked. When this script invokes the args.get_item().set_selected(true); method I receive a javascript error message the tells me that the this._owner._selectedItems is null. After debugging the script I found that the _owner is null. I thought when this event handler is fired all properties of the item has been set. It seems that I was wrong.

Could you tell me how I can change the selection of a item when the page is loaded or the node is expanded or the control is paginated?

Daniel
Telerik team
 answered on 10 May 2013
1 answer
180 views
I have radtreeview inside radcombobox.

 <telerik:RadComboBox ID="cbTreeViewSelect" runat="server"  ShowToggleImage="True" Skin="Metro" 
                    Style="vertical-align: middle;" OnClientDropDownOpened="OnClientDropDownOpenedHandler"
                    EmptyMessage="Choose a kit" ExpandAnimation-Type="None" CollapseAnimation-Type="None"
                    Font-Bold="true" AutoPostBack="true" Height="350px" CssClass="NormalText12Combo" OnTextChanged="cbTreeViewSelect_TextChanged">
                    <ItemTemplate>
                    
                        <telerik:RadTreeView runat="server" ID="tvTree" OnClientNodeClicking="nodeClicking"
                            CssClass="NormalText12Combo" Width="100%" Height="340px" OnNodeClick="tv_NodeClick"
                            OnDataBound="tvTree_DataBound" />
                           
                    </ItemTemplate>
                    <Items>
                        <telerik:RadComboBoxItem Text="" />
                    </Items>
                </telerik:RadComboBox> 



and scripts as described below.

function nodeClicking(sender, args) {
        var comboBox = $find("<%=cbTreeViewSelect.ClientID %>");
        
        var node = args.get_node()

        var g = node.get_value();
       
        if (g == "0") {
            args.set_cancel(true);
            node.toggle();
            comboBox.attachDropDown();
            comboBox.expand();
        }
        else {
            comboBox.set_text(node.get_text());

            comboBox.trackChanges();
            comboBox.get_items().getItem(0).set_text(node.get_text());
            comboBox.commitChanges();

            $("#<%=hidValue.ClientID %>").val(node.get_value());

            comboBox.hideDropDown();
        }
        // Call comboBox.attachDropDown if:
        // 1) The RadComboBox is inside an AJAX panel.
        // 2) The RadTreeView has a server-side event handler for the NodeClick event, i.e. it initiates a postback when clicking on a Node.
        // Otherwise the AJAX postback becomes a normal postback regardless of the outer AJAX panel.

        //comboBox.attachDropDown();
    }

    function StopPropagation(e) {
        if (!e) {
            e = window.event;
        }

        e.cancelBubble = true;
    }

    function OnClientDropDownOpenedHandler(sender, eventArgs) {
        var tree = sender.get_items().getItem(0).findControl("tvTree");
        var selectedNode = tree.get_selectedNode();
        if (selectedNode) {
            selectedNode.scrollIntoView();
        }
    }


In IE its working fine but in firefox when i click on hyperlink of top node of treeview it expands the tree but it hides(collapse) dropdown.

i want to keep that treeview and dropdown expanded.

Thanks in advance.
msigman
Top achievements
Rank 2
 answered on 10 May 2013
2 answers
59 views
Hi,
i want to block a specific time slot for whole month.

thanks
Niharika Singh
Niharika
Top achievements
Rank 1
 answered on 10 May 2013
2 answers
122 views
dear support,

I am at the early stage on developing an enterprise software. I really need some idea on how I should start on the master page & what to use so that I am in right track from beginning.

scenarios & requirement:
I will have about 250 menu in the system that i am going to developed and group into 10 sub menu.
I need to have toolbar on top of every screen for easy access of frequent function
I need to have a panelbar on left to display the 10 submenu and all menu item that i need to retrieve from datasource
I need to have a big space for the content page on the right side of panelbar where it will display window for menu item selected.
each menu item will point to a form. this form will then load into the ajax window.
i need to be able to open multiple window (menu item) at the same time

in order to achieve above for easy maintenance and development, what do you suggest?

greatly appreciate for any inputs.

newbie
moegal
Top achievements
Rank 1
 answered on 10 May 2013
2 answers
260 views
I was able to copy items from one radListBox to another but I could not delete them by double clicking on the item. thanks for your help
Andrew
Top achievements
Rank 1
 answered on 10 May 2013
1 answer
142 views
Hello,

I am having some trouble implementing a few of the controls. So far I've tried the RadEditor as well as the RadDateInput tools, and they both have the same issue: The controls themselves render on the page, but are unresponsive (I can not edit or select any of the formatting options). My first thought was this being an UpdatePanel issue (as there have been many posts about that) however pulling it out of my update panel doesn't fix the problem.

Here is my instantiation of it in the ASP (I'm using a VB code behind FYI)

<telerik:RadEditor ID="txtnotes" Runat="server" Width="800" Height="600">
                        <tools>
                        <telerik:EditorToolGroup Tag="MainToolbar">
                            <telerik:EditorTool Name="FindAndReplace" />
                            <telerik:EditorSeparator />
                            <telerik:EditorSplitButton Name="Undo">
                            </telerik:EditorSplitButton>
                            <telerik:EditorSplitButton Name="Redo">
                            </telerik:EditorSplitButton>
                            <telerik:EditorSeparator />
                            <telerik:EditorTool Name="Cut" />
                            <telerik:EditorTool Name="Copy" />
                            <telerik:EditorTool Name="Paste" ShortCut="CTRL+V" />
                        </telerik:EditorToolGroup>
                        <telerik:EditorToolGroup Tag="Formatting">
                            <telerik:EditorTool Name="Bold" />
                            <telerik:EditorTool Name="Italic" />
                            <telerik:EditorTool Name="Underline" />
                            <telerik:EditorSeparator />
                            <telerik:EditorSplitButton Name="ForeColor">
                            </telerik:EditorSplitButton>
                            <telerik:EditorSplitButton Name="BackColor">
                            </telerik:EditorSplitButton>
                            <telerik:EditorSeparator />
                            <telerik:EditorDropDown Name="FontName">
                            </telerik:EditorDropDown>
                            <telerik:EditorDropDown Name="RealFontSize">
                            </telerik:EditorDropDown>
                        </telerik:EditorToolGroup>
                        </tools>
                        <content>
                        </content>
                        <trackchangessettings canaccepttrackchanges="False" />
                    </telerik:RadEditor>

I'm using ASP.NET 4.0 on the latest version of Chrome.

Any suggestions?
Rumen
Telerik team
 answered on 10 May 2013
1 answer
98 views
Hi,

I have a problem trying to get the contents of a RadEditor located inside a User control through AJAX. The main page has a Radstrip with a multipage and each pageview has attached an instance of the User control with the editor and a button.

When the User control is created from code behind, some default contents are set from the main page to the Editor and it's working properly. But, if we change that text and we call a postback with AJAX, I cannot get the new value.

I am not sure how to proceed to get new values...

thanks.

The User Control:
<telerik:RadEditor ID="RadEditor1" runat="server" Width="100%" BorderStyle="None" EditModes="Design" ContentAreaCssFile="~/css/EditorContentArea.css" ContentAreaMode="iframe">
    <CssFiles>
        <telerik:EditorCssFile Value="~/css/EditorContentArea.css" />
    </CssFiles>
    <Tools>
        <telerik:EditorToolGroup Tag="MainToolbar">
            <telerik:EditorTool Name="AjaxSpellCheck" />
            <telerik:EditorTool Name="FindAndReplace" />
            <telerik:EditorSeparator />
            <telerik:EditorSplitButton Name="Undo">
            </telerik:EditorSplitButton>
            <telerik:EditorSplitButton Name="Redo">
            </telerik:EditorSplitButton>
            <telerik:EditorSeparator />
            <telerik:EditorTool Name="Cut" />
            <telerik:EditorTool Name="Copy" />
            <telerik:EditorTool Name="Paste" ShortCut="CTRL+V" />
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup Tag="Formatting">
            <telerik:EditorTool Name="Bold" />
            <telerik:EditorTool Name="Italic" />
            <telerik:EditorTool Name="Underline" />
            <telerik:EditorSeparator />
            <telerik:EditorSplitButton Name="ForeColor">
            </telerik:EditorSplitButton>
            <telerik:EditorSplitButton Name="BackColor">
            </telerik:EditorSplitButton>
            <telerik:EditorSeparator />
            <telerik:EditorDropDown Name="FontName">
            </telerik:EditorDropDown>
            <telerik:EditorDropDown Name="RealFontSize">
            </telerik:EditorDropDown>
        </telerik:EditorToolGroup>
    </Tools>
    <Content>
</Content>
</telerik:RadEditor>
<div style="float:left;">
<telerik:RadSpell ID="RadSpell1" runat="server" ControlToCheck="RadEditor1" ButtonType="PushButton" AllowAddCustom="true" CssClass="floatL" />  
<telerik:RadButton ID="RadButton1" runat="server" Text="Save" Height="22px" />
</div>

User Control Code behind:
Imports Telerik.Web.UI
 
Public Delegate Sub RadButton1_Click(sender As Object, e As System.EventArgs)
 
Public Class productAttributesEditor
    Inherits System.Web.UI.UserControl
    Public Event SaveClick As RadButton1_Click
 
    Public singleLang As String
 
    Public Property RadEditor() As RadEditor
        Get
            Return RadEditor1
        End Get
        Set(value As RadEditor)
            RadEditor1 = value
        End Set
    End Property
 
    Public Property SpellSingleLanguage() As String
        Get
            Return singleLang
        End Get
 
        Set(value As String)
            singleLang = 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
            RadEditor1.Modules.Clear()
            RadEditor1.Languages.Clear()
            RadEditor1.SpellCheckSettings.AllowAddCustom = True
            RadEditor1.SpellCheckSettings.SpellCheckProvider = SpellCheckProvider.PhoneticProvider
 
            If String.IsNullOrEmpty(singleLang) Then
                Using ctx As New MyLovelyFood_DynamicStocksEntities()
                    Dim langs = From a In ctx.aux_languageList Where a.Published = True And a.SpellEnabled = True Select a.LanguageCulture, a.Name, a.PrimaryLang Order By PrimaryLang
                    For Each row In langs
                        RadEditor1.Languages.Add(New SpellCheckerLanguage(row.LanguageCulture, row.Name))
                    Next
                End Using
            Else
                RadEditor1.SpellCheckSettings.DictionaryLanguage = singleLang
            End If
        End If
    End Sub
 
    Protected Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
        RaiseEvent SaveClick(Me, e)
    End Sub
End Class

Default page:
    ' Prepare text editor
' For each Tab, create a new Editor...
    Private Sub RadTabStripIngredients_TabDataBound(sender As Object, e As RadTabStripEventArgs) Handles RadTabStripIngredients.TabDataBound
        Dim pageView As New RadPageView()
        pageView.ID = e.Tab.Value
        RadMultiPageIngredients.PageViews.Add(pageView)
    End Sub
 
    Private Sub RadMultiPageIngredients_PageViewCreated(sender As Object, e As RadMultiPageEventArgs) Handles RadMultiPageIngredients.PageViewCreated
        editorControl = LoadControl("~/common/AttributesEditor.ascx")
        editorControl.ID = e.PageView.ID & "_userControl"
 
        Using ctx As New DynamicStocksEntities()
            Dim langCulture = From a In ctx.aux_languageList Where a.Id = e.PageView.ID Select a.LanguageCulture
            editorControl.SpellSingleLanguage = langCulture.FirstOrDefault
        End Using
 
        e.PageView.Controls.Add(editorControl)
        AddHandler editorControl.SaveClick, AddressOf SaveEditor
    End Sub
 
    Private Sub SaveEditor(ByVal sender As Object, ByVal e As EventArgs)
        Dim editorObj As productAttributesEditor = TryCast(sender, Object)
        Dim content As String = TryCast(editorObj.RadEditor, RadEditor).Text
        MsgBox(content) ' >>>> ERROR, WE JUST RECEIVE THE INITIAL VALUE INSTEAD OF THE MODIFIED VERSION
        If Not String.IsNullOrEmpty(Trim(content)) Then
' DO SOMETHING
        End If
    End Sub
Rumen
Telerik team
 answered on 10 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?