Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
195 views
I need add custom validation (not repeat node name) when user Edit/Add new node.
I try do it with EDITNODE event, but I can get the new name.
All treView and node are created Dynamically

this is my code:

 Class1.cs
this code is execute in page_init

  RadTreeView radTreeView   = new RadTreeView { ID = "tvWorkspace" };

                    RadTreeNode parentNode = new RadTreeNode(_resources.GetString("Workspace", new CultureInfo(_culture)))
                                                 {Expanded = true};

                    radTreeView.Nodes.Add(parentNode);
                    

                    List<smWorkspace> workspaceFolder = new smOrganization().GetWorkspace(App.CurrentUserId());

                    if (workspaceFolder.Count > 0)
                    {
                        CreateNodes(workspaceFolder,  radTreeView.Nodes[0]);
                    }
                    
                    radTreeView.AllowNodeEditing = true;
                    radTreeView.NodeEdit += RadTreeView1_NodeEdit;

                    radTreeView.ContextMenus.Add(new ContextMenu().CreateContextMenu());
                    radTreeView.ContextMenuItemClick += RadTree_Contextmenutitem;
                    wsTreeview.Controls.Add(radTreeView);
                  
                    workspaceDiv.Controls.Add(wsTreeview);




 protected void RadTreeView1_NodeEdit(object sender, RadTreeNodeEventArgs e)
        {
            RadTreeNode nodeEdited = e.Node;
            string folderId = nodeEdited.Value;
            string Name = nodeEdited.Text;

//here I need add Validation By New name and Value.

}


  private void CreateNodes(List<smWorkspace> workspaces,  RadTreeNode parentnode)
        {
            int folderId = workspaces[0].FolderId;
            RadTreeNode rootParent = new RadTreeNode(workspaces[0].FolderName) {ImageUrl = "~/UI/Images/folder.png"};
            parentnode.Nodes.Add(rootParent);
           

            foreach (smWorkspace folder in workspaces)
            {
                if (folder.FolderId != folderId)
                {
                    folderId = folder.FolderId;
                    rootParent = new RadTreeNode(folder.FolderName) { ImageUrl = "~/UI/Images/folder.png", Value = folderId.ToString() };
                    parentnode.Nodes.Add(rootParent);

                }else
                {
                    RadTreeNode child = new RadTreeNode(folder.File.FileName);
                    string extension = Components.CommonFunctions.GetExtensionFile(folder.File.FileFullPath);
                    child.ImageUrl = CommonFunctions.GetDocumentIcon(extension);
                   
                    rootParent.Nodes.Add(child);
                }
               
            }
           
            
        }

Value node is FolderId in Database.



how and Where I can add Custom Validation?...

I need show like this:





July
Top achievements
Rank 2
 answered on 03 Feb 2012
3 answers
118 views
I have a tab strip with 8 long tabs.  I have them set to "VerticalLeft" orientation, and then I want my MultiPage to appear immediately to the right of the tabs.  I looked at the examples for TabStrip in which this is accomplished, but when I try it in my project the Multipage is always below the TabStrip.  I have no spaces between them, no BR's... is there some property somewhere I need to set so the Mutlipage will appear to the right of the TabStrip and not below it?

These 2 controls are inside a page from another MultiPage control, if that matters.
Bozhidar
Telerik team
 answered on 03 Feb 2012
7 answers
174 views
Hi,

I know there's another thread like this too
http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/radopen-is-not-working-properly-on-ie-9.aspx
But what I encountered is different.
Here's my code for calling the radopen when clicking a button.
ClientScript.RegisterStartupScript(Page.GetType(), ShowRemarks, "ShowRemarksDialog();", true);

Here's the javascript code in my main aspx page.
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
            function ShowRemarksDialog() {
                Sys.Application.add_load(function() {
                window.radopen("UpdateRemarks.aspx?ScreenType=1", "RemarksDialog");
                return false;               
                });
            }              
 
            function refreshGrid() {               
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                }
             
 
            </script>
        </telerik:RadCodeBlock>
in the UpdateRemarks.aspx
I'm using this javascript to refresh my grid.
<script type="text/javascript">
            function CloseAndRebind() {
                GetRadWindow().BrowserWindow.refreshGrid();
                GetRadWindow().close();
            }
 
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
 
                return oWindow;
            }
 
            function CancelEdit() {
                GetRadWindow().close();
            }
        </script>

When the button is clicked, nothing is displayed in IE9.
It is working fine with IE7 though..
Any idea how to solve this???
THanks..
Svetlina Anati
Telerik team
 answered on 03 Feb 2012
1 answer
139 views
Currently our company website uses the old 2006 version of Telerik controls. We are soon gonna upgrade to the newer version and I was wondering if both versions of telerik(the old-version we currently have and the new one) are able to be installed and still work with one another.  I am afraid that certain controls will break on our website when upgrading to the newer version.  Please let me know.  Thank You.



Andrey
Telerik team
 answered on 03 Feb 2012
5 answers
1.0K+ views
I have a grid which lists items in an order. The first column has a GridButtonColumn which a user can click to remove the item from the order.

The data in the grid is loaded using the OnNeedDataSource method, items are bound to the grid and hidden fields are set using OnItemDataBound method, and the event to remove the item uses the OnItemCommand method.

When the user clicks the delete/remove icon in the GridButtonColumn, the page fires the Grid_ItemCommand, but the e.item.DataItem is null, not allowing me to perform my action as I now don't know which item is to be removed from the order?

How do I ensure the DataItem is still available once the user clicks the delete/remove icon?
Jayesh Goyani
Top achievements
Rank 2
 answered on 03 Feb 2012
1 answer
99 views
Hi,

I have a webpage in which javascript functionality was embedded in external js file.
Currently in external js file we have used ordinary confirm and i want to replace this with radconfirm.

I have used radconfirm on button click, where we have return false also with that. and then in javascript callback  we do a post back using 
"__dopostback() fuction.

I dont know how can i use this in external js file.

Current Scenario :
I am able to see radconfirm,but the execution is not stopping when we click on cancel.

Please help me.

Thanks,
A2H
Marin Bratanov
Telerik team
 answered on 03 Feb 2012
3 answers
85 views
Problem in IE 8 and lower.
In page we haw RadGrid and RadToolTipManager. When paging applied,  grid tooltip appears correctly but when filter applied content is empty. This problem only exists in old  IE(7,8) .
Page:
    <telerik:RadGrid ID="objectGrid" runat="server" AutoGenerateColumns="false" GridLines="None" AllowPaging="true" PageSize="25" EnableLinqExpressions="false"
    AllowSorting="true" AllowFilteringByColumn="true" AllowMultiRowSelection="true"
    OnNeedDataSource="LoadData"
    OnItemDataBound="objectGrid_ItemDataBound"
    OnItemCommand="objectGrid_OnItemCommand"
    OnItemCreated="objectGrid_ItemCreated" 
    OnPageIndexChanged="objectGrid_OnPageIndexChanged">
    <ExportSettings  IgnorePaging="true" OpenInNewWindow="true"  HideStructureColumns="true" >
      <Excel Format="Html" />
    </ExportSettings>
    <MasterTableView CommandItemDisplay="Top">
    <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false"/>
     
        <Columns>
            <telerik:GridTemplateColumn  meta:resourcekey="colChecks" UniqueName="colChecks" AllowFiltering="false">
                <ItemTemplate>
                    <table>
                        <tr>
                            <td width="20px">
                                <asp:ImageButton ID="imgActions" runat="server" meta:resourcekey="imgActions" ImageUrl="~/Images/wizzard_16.png" Visible='<%# this.HasAvailableChecks(Eval("Id")) %>' CommandArgument='<%# Eval("Id") %>' />
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
 
    <telerik:RadToolTipManager ID="toolTipManager" runat="server" ShowEvent="OnClick" EnableViewState="true"
     AutoTooltipify="false" OnAjaxUpdate="OnAjaxUpdate" ManualClose="true" Position="BottomRight" 
    RelativeTo="Element" OnClientHide="OnClientClose" Width="300px">
</telerik:RadToolTipManager>

Code:
protected void objectGrid_OnItemCommand(object source, GridCommandEventArgs e)
 {
     if (e.CommandName == "ExportToExcel")
     {
         GridExport();
     }
 
     if (e.CommandName == "Page" || e.CommandName == "ChangePageSize" || e.CommandName == "Filter")
     {
         toolTipManager.TargetControls.Clear();
         BindData();
     }
 }
 
protected void objectGrid_ItemDataBound(object sender, GridItemEventArgs e)
 {
     if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item)
     {
         // Actions
         ImageButton actions = e.Item.FindControl("imgActions") as ImageButton;
         toolTipManager.TargetControls.Add(actions.ClientID, actions.CommandArgument, true);
     }
 }
 
 protected void objectGrid_OnPageIndexChanged(object sender, GridPageChangedEventArgs e)
 {
     toolTipManager.TargetControls.Clear();
 }
Marin Bratanov
Telerik team
 answered on 03 Feb 2012
3 answers
750 views
Article at
http://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlcontainercontrol.innerhtml.aspx
suggests you can set the innerhtml of items

So I have

<telerik:RadDock ID="RadDock3" runat="server" Width="300px" Resizable="True" DockHandle="Grip">
    <ContentTemplate>
    <div>
    <span id="Message" runat="server">Hello World</span>
    </div>
    </ContentTemplate>
</telerik:RadDock>

In my code behind I have

 

 


Dim
myHtml As String = Message.InnerHtml

 


When I try to run it says build errors, but doesn't display any ??

Is getting and setting the innerhtml possible ?

Thanks
Jim






Jim
Top achievements
Rank 1
 answered on 03 Feb 2012
7 answers
113 views
Hi, i've got a image map. That i've got a radtooltipmanager attached to. All works well - i've got an ajaxupdate that fires retrieves some information from the database on area on the imagemap, and displays it in the tooltip.

However, the issue being is that after the ajaxupdate has completed, i have some jquery on the page which seems to stop working.
Previously when i've had issues with ajax requests and cancelling jquery / javascript i've added the control that contains the jquery into the radajaxmanager of the control that's caused the ajax request. I've tried this with adding the radtooltipmanager into the radajaxmanager, and adding the panel tha contains my jquery stuff into the updatedcontrols.

This panel contains the necessary javascript enclosed in a radscriptblock, including a link to the jquery external file. (it doesnt however include the jquery ui which i think this piece of jquery uses.)

Any suggestions ?
Marin Bratanov
Telerik team
 answered on 03 Feb 2012
1 answer
129 views
Hello,

i have to access a multipage that was added dynamically on server-side on the client-side with javascript to make it visible and set the selected index.
For example, a multipage that was added at designtime i access like this:
function selectNews() {
                    var mV = $find("<%= radThumbs.ClientID %>");
                    mV.set_selectedIndex(1);
                }

This works very well. But now i have to access a dynamically added multipage. All my attempts are without luck.
In codebehind i set a unique id to each dynamic added multipage. In html-output that is generated the multipages are stored as div-tags with a id that is equal to that, that i set in codebehind on server-side.

so far i tried different ways to get the control on client side.

Attempt #1:
alert('item.children[i].innerHTML.replace(/\s/g, "")');
var test = $find(item.children[i].innerHTML.replace(/\s/g, ""));
 test.set_selectedIndex(1);
Attempt #2:
alert('item.children[i].innerHTML.replace(/\s/g, "")');
var test = document.getElementById(item.children[i].innerHTML.replace(/\s/g, ""));
test.set_selectedIndex(1);
 
 
In all attempts the alertbox shows the correct id.
But ever i try to set the selected index, a error occurs and tells me, that the element doesn't contain such a method and so on.

Thanks for your assistence...

Thorsten
Kate
Telerik team
 answered on 03 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?