Telerik Forums
UI for ASP.NET AJAX Forum
14 answers
325 views
Dear Telerik Team,

I am using a RadGrid and loading Item values on page load. When i click on Row I need to fire OnClientRowSelected event which is working well in IE but causing problem in MozillaFirefox by showing undefined. Where i need to load RadEditor with some values.

Thanks Inadvance

Regards
----------
Pandu
Veli
Telerik team
 answered on 20 Aug 2010
1 answer
129 views
I have read and implemented the information from this post: Retain expanded/selected state in hierarchy on rebind, and it works well as long as I do not use column filtering.  When I filter the parent grid columns, the incorrect data items are expanded.  The index is the same, but the in data in the row is different and the child of that row should no longer be expanded.

From what I can tell, the recommended method of retaining the expanded state is based off of storing DataSetIndex of the row in a hash table.  When you filter a parent column, the original parent row can change to a different index in the grid or even disappear.  I would like to know the recommended practice for this scenario.  Should I simply closed all expanded child grids or could I possibly use something other than an index (such as a primary key of the data row) to identify  which rows should be expanded?

If I should simply kill all the child grids, what is the best way to do this? 

Thanks,
Jim
Mira
Telerik team
 answered on 20 Aug 2010
1 answer
138 views
Hello, i show RadWindow from parent form:

<telerik:RadTreeView ID="tvFile" runat="server">
            OnClientContextMenuItemClicking="onClientContextMenuItemClicking">
    <ContextMenus>
        <telerik:RadTreeViewContextMenu ID="MainContextMenu" runat="server">
            <Items>
                 <telerik:RadMenuItem Value="Rights" Text="Rights"/>
           </Items>
       </telerik:RadTreeViewContextMenu>
    </ContextMenus>
    </telerik:RadTreeView>
    <telerik:RadWindowManager ID="winManager" ShowContentDuringLoad="false" VisibleStatusbar="false"
        ReloadOnShow="false" runat="server" Skin="Sunset" EnableShadow="true">
        <Windows>
            <telerik:RadWindow ID="RadWindow2" Modal="true" onClientClose="OnClientClose"
            NavigateUrl="UserRights.aspx" runat="server" Behaviors="Close">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
 
<script type="text/javascript">
    function OnClientClose(oWnd, args)
    {
        var arg = args.get_argument();
        if (arg)
         {} 
    }
    function openWin(path) {
        var oWnd = radopen("UserRights.aspx?file="+path, "RadWindow2");
    }
  
 
    function onClientContextMenuItemClicking(sender, args)
    {
        var menuItem = args.get_menuItem();
        var treeNode = args.get_node();
        var nodeValue = treeNode.get_value();
        menuItem.get_menu().hide();
        switch (menuItem.get_value())
        {
            case "Rights":
                openWin(nodeValue);
                break;
        }
    }
</script>



At UserRights.aspx I need RadScriptManager for RadListBox like this:

<form id="form1" runat="server">
       <telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>
        <asp:Button runat="server" ID="ds" Text="fd" />
        <telerik:RadListBox runat="server" ID="dcs"></telerik:RadListBox>
</form>

But when RadWindow opens at my firebug I got js error:

this._form is null

When I haven't got RadScriptManager all is OK. But I need it for RadListBox and UpdatePanel features.
Georgi Tunev
Telerik team
 answered on 20 Aug 2010
1 answer
117 views
After I implemented code for tooltip click show the ajax my code for ajax button click is stop woring please see the code below

Thanks

////////////
///aspx code
////////////
 
 <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <asp:DataList ID="thumbRotatoralt" runat="server" OnItemDataBound="ParentList" OnItemCommand="AddToBasket_ItemCommand" EnableViewState="true">
                <ItemTemplate>
<asp:Button ID="btnCart" runat="server" CssClass="pbuttonssmal" Text="Add to Basket"
                                        CommandName="AddItemToBasket" onfocus="Hilite(this)" onblur="Hilite(this, false)" />
 
            </ItemTemplate>
            </asp:DataList>
        </ContentTemplate>
    </asp:UpdatePanel>
 
    <telerik:RadToolTip ID="RadToolTip2" runat="server" Width="100px" ShowEvent="OnClick"
        TargetControlID="link2" IsClientID="true" HideEvent="LeaveToolTip" Position="Center" EnableShadow="true"
        Animation="Resize" ShowDelay="0" RelativeTo="Element" Text="Right-click on the picture above to show the RadToolTip." />
 
        <telerik:RadToolTipManager runat="server" ID="RadToolManager1" EnableShadow="true"
            ShowEvent="OnClick"
            OnClientShow="OnClientShow"
            Skin="Default"
            ShowDelay="200"
            AutoCloseDelay="5000"
            Width="300px"
            Position="MiddleRight"
            RelativeTo="Element">
        </telerik:RadToolTipManager>
 
 
 
<script type="text/javascript">
 
    var lastActiveToolTip = null;
    function OnClientShow(sender, args) {
        lastActiveToolTip = sender;
    }
 
   function beforeunload() {
        var activeTooltip = Telerik.Web.UI.RadToolTip.getCurrent();
        if (!activeTooltip) activeTooltip = lastActiveToolTip;
        if (activeTooltip) {
            var targetElement = activeTooltip.get_targetControl();
            activeTooltip._registerMouseHandlers(targetElement, false);
        }
    };
 
    if (Sys.Browser.agent == Sys.Browser.InternetExplorer) {
        window.attachEvent('onbeforeunload', beforeunload);
    }
    </script>

////////////
///my code behind
////////////
 
protected void AddToBasket_ItemCommand(Object sender, DataListCommandEventArgs e)
    {
 
        //my click event code to save changes to database
    }
 
 
 
    protected void ParentList(object sender, DataListItemEventArgs e)
    {
        DataListItem item = e.Item;
 
        if ((item.ItemType == ListItemType.Item) ||
            (item.ItemType == ListItemType.AlternatingItem))
 
        Button btnCart = (Button)item.FindControl("btnCart");
 
        btnCart.ToolTip = "Item(s) added to basket";
        
        RadToolManager1.TargetControls.Add(btnCart.ClientID, true);
        }
    }
Svetlina Anati
Telerik team
 answered on 20 Aug 2010
12 answers
1.0K+ views
Hello,

I have a problem with updating/reloading my treeview.
I have a TreeView that is popultated from a StoreProcedure. I then have some buttons that give a popup where you can enter some information that will update the DB that the StoreProcedure use to populate the TreeView.

When I call a WebService to update the DB everything works fine, it updates the database and everyone is happy, the problem is that after this I want to close my popup and reload/refhresh the TreeView, I have tried some diffrent tactics with window.close(), window.opener.location.reload() and similar and I don't get it to work. I can get the popup to close, but if I also do the reload then i just open up again and also it still doesn't refresh the treeview AND i get a question from IE about that I need to retry geting information.

I read somewhere that you could use window.open('', '_self', ''); to get rid of that message and the funny part is that I use that in another project and there it works but not here. I'll post some of my code but I don't think that helps so much I need to understand how to refresh my TreeView and if there is any smart way todo it.

function cancel_click() {
    window.open('', '_self', '');
    if (window.opener && !window.opener.closed) {
        window.opener.location.reload();
    }
    window.close();
}

That is my javascript for when someone either press the closebutton on the popup or after the WebService have succefully updated the database, it should in theory close the window and refresh the parent. I guess that there is some way to refresh the treeview also.
Please remeber that I want todo this from a popup window, and I need access to the treeview or in someway reload it.

EDIT: Forgot to mention that if I reload the page (just press F5) I still don't get the TreeView updated, but when I close the application and start it again then it refreshes as it should and I can see the post that I have added.

EDIT2: I have also tested having the window.close() before the reload, but this doesn't do any diffrence for me atm. the biggest problem I have is that when I do the reload it opens up my popup again (should only open when you press a button) and the TreeView doesn't get any new data.

Henrik Tegman
Top achievements
Rank 1
 answered on 20 Aug 2010
2 answers
92 views
Hi to all!

 In my website i am using more than one Ajaxupdate vpanel following err comes at run time.

My environment is ASP.Net,VS2008,Framewrk3.5,C#.Net as coding tool

 "System.InvalidOperationException: Only one instance of a ScriptManager can be added to the page."

Anyone plz help me to solve this pa!

Regards,.

Srinivas.

Srinivasa prabhu
Top achievements
Rank 2
 answered on 20 Aug 2010
2 answers
98 views
Pretty simple:

In a asp.net repeater I have an anchor tag which gets a unique id from a databind:
<a id="<%# ((Item)Container.DataItem).List.ListId %>" onclick="javascript:PositionToolTip(this)">...

In a JavaScript method, I want to get the id of the tooltip and set it's target control to the link which clicked it. The code below works; that is until about after 10 or 15 clicks then it starts to show up on incorrect links. No page refreshes are done during this time. Thoughts?

function PositionToolTip(clientId) 
{
    var radToolTip = $find("<%= ModalToolTip.ClientID %>");
    radToolTip.set_targetControlID(clientId.id);
    radToolTip.show();
 }
mc2000
Top achievements
Rank 1
 answered on 20 Aug 2010
5 answers
191 views
Hi,
Is there a way to add an image to the RadEditor? I see an image icon but I can`t really add one.
I have an application where I need to add an image or even a newsletter as a graphic (.pub file) pud I can`t find a way of doing it.

Thanks
Rumen
Telerik team
 answered on 20 Aug 2010
1 answer
146 views
Hey!
I would like to have various messages posted on my site stored in a listview.
Users can post comments on those posts. Initially comments would not be displayed, but if a user clicks on a post, the listview item would expand so it would show comments also. Is this possible, or should I use another control?
Dimo
Telerik team
 answered on 20 Aug 2010
1 answer
186 views
Hello. I can't find RadWindowManager at Window, which open by another RadWindowManager.

Ok. Main.aspx
<telerik:RadWindowManager ID="winManager" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" runat="server" Skin="Sunset" EnableShadow="true">
        <Windows>
            <telerik:RadWindow ID="RadWindow2" Width="600" Height="490" Modal="true" OnClientClose="OnClientClose"
            NavigateUrl="UserRights.aspx" runat="server" Behaviors="Close">
            </telerik:RadWindow>
        </Windows>
 
</telerik:RadWindowManager>
Main Page. At USerRights.aspx I need open another popup, and get data for USerRights page. So I've got at
USerRights

<telerik:RadWindowManager ID="winManager2" ShowContentDuringLoad="false" VisibleStatusbar="false"
        ReloadOnShow="true" runat="server" Skin="Sunset" EnableShadow="true">
            <Windows>
                <telerik:RadWindow ID="RadWindow1" Behaviors="Close" OnClientClose="OnClientClose"
                    NavigateUrl="ChooseUsersGroups.aspx" runat="server" Height="500" Width="500">
                </telerik:RadWindow>
            </Windows>
</telerik:RadWindowManager>
<button title="Add" id="btAdd" onclick="openSearchWindow(); return false;">Add</button>

First windows opens well, but when I try open second window from the first with js:

function openSearchWindow()
{
               var parentRadWindowManager = GetRadWindowManager();
               var oWnd2 = parentRadWindowManager.open("ChooseUsersGroups.aspx", "RadWindow1");
               window.setTimeout(function () {
                   oWnd2.setActive(true);
               }, 0);
}
GetRadWindowManager() returns undefined. If i try find WindowManager from parentpage(as in your sample) all is ok. Why I can't get WindowManager at secondpage?

Thanks.


Georgi Tunev
Telerik team
 answered on 20 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?