Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
87 views
I am using a grid with an popup ascx control for editing/inserting records. The grid displays sets of records (controled by a dropdown list)  When inserting a new record I need to be able to pass to the edit ascx control the ID from the dropdown list so it can be inserted in to the new record.
Mark
Top achievements
Rank 1
 asked on 08 Feb 2012
1 answer
94 views
Hi,

I would like to know, how we can extract the properties of a grid from the javascript radgrid object 
for example i need to know in the client side whether "selecting-allowrowselect" of the grid is being rendered as true or false,

<

clientsettings selecting-allowrowselect="true">.

 

 

//Assigns the Global Grid object on grid created

 

 

 

 

 

 

function OnGridCreated(sender, eventArgs) {

 

 

 

grid = sender;

}

 

so how to access the above property [clientsettings selecting-allowrowselect] in the "grid" object?

Regards,
CSW Support

 

Tsvetoslav
Telerik team
 answered on 08 Feb 2012
1 answer
113 views
Hi all,

I am attempting to create a Rad grid (version 2010.3.1215.40 in Visual Studio 2010 ) which returns a list of contacts. Each contact may have a number of 'profiles' representing how we know a person. For example, We may have a contact called Joe blogs, he could have two profiles, one which links him to Company A and one which links him to Company B (ie a contractor/consultant). A user needs to be able to select the profile id from the list of contacts, however we wish to only display the nested detail table if there is more then 1 profile. If there is only 1 profile then the user should just see that in the main grid.

So far I have the grid set up to display the full list of contacts and then they have the nested grid of profiles, however a user can currently expand a row even if it has 1 or 0 profiles. Any sugestions on how to not display the nested grid where the profile count is less then 2?

Many Thanks

<telerik:RadGrid ID="rgContactSearchResults" runat="server" Height="448px">
    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true" AllowKeyboardNavigation="true">
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <MasterTableView DataKeyNames="ContactID" AutoGenerateColumns="true" TableLayout="Fixed">
        <DetailTables>
            <telerik:GridTableView DataKeyNames="ContactID" AutoGenerateColumns="true" DataMember="ContactID">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="ContactID" MasterKeyField="ContactID" />
                </ParentTableRelation>
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
</telerik:RadGrid>
David
Top achievements
Rank 1
 answered on 08 Feb 2012
1 answer
61 views
Hi,

I have a simple hierarchical grid with a master table and a single detail table.  The desired behavior is when the user expands the master table row and clicks on a row in the detail table a js function is called etc.  All of this works fine except for the rowIndex is off by one.  The javascript I have is below...please note it is not the most efficient right now, I have it to this trying to figure out what is wrong.   In the 4th row of the script I originally had var row = DetailTable.get_dataItems()[dataItem.rowIndex]; but for the first row it was returning 1, second 2, etc. like it was 1 based.  I added a -1 to pull back the previous row and this works but not sure if that is the best approach.  Any thoughts on how I could better extract the 'UserID value from the detail table row the user double clicked on?

Thanks in advance,

K


function RowSelected(sender, eventArgs) {
 
     if (eventArgs.get_tableView().get_name() == "UserDetail") {
         var dataItem = $get(eventArgs.get_id());
         var DetailTable = eventArgs.get_tableView();
         var row = DetailTable.get_dataItems()[dataItem.rowIndex-1];  //I had to add -1 in order to return the correct row
         var cell = DetailTable.getCellByColumnUniqueName(row, "UserID");
         var IDu = cell.innerHTML
         $find("<%=RadAjaxPanel.ClientID%>").ajaxRequest("GoToDetails|" + IDu);
               return false;
     }
 }
Tsvetoslav
Telerik team
 answered on 08 Feb 2012
1 answer
49 views
Hello,

I have updated in Visual Studio the Telerik Libraries. After them i can't start my Websites. I get an Error in this File at compile time:
Telerik.Web.UI.WebResource_2.axd?_TSM_HiddenField...
in this line:
},_buildNode:function(i,h){var g=this._getEntityByName(i.Name),j=this,k={name:i.Name,type:i.EntityType,entity:g,child:h.apply(j,[g.NavigationProperty])};

I get a runtime error in Microsoft JScript: For the property "Name" can not be retrieved value: The object is null or undefined.

What can I do?

Best regards
Reiner
Plamen
Telerik team
 answered on 08 Feb 2012
1 answer
166 views
Is it possible to add and remove radtreeview to the radpanelbaritem dynamically from client side using javascript. I wanted to have a radpanel to which when the user expands a radpanelbaritem, a treeview is dynamically added to that from client side using javascript. Simillarly the panelbaritem which is being collapsed can go and remove all its children from client side using javascript. 
In short i was looking at a solution to add/remove item templates dynamically from client side using javascript.
Kate
Telerik team
 answered on 08 Feb 2012
1 answer
115 views
Hi,

I have an application, which have only one page and master page and all the screens are ascx controls and gets loaded dynamically with the use of LoadUserControl method.

The issues are :
1) Javascript does not works at all even that lies there in the master page. (The URL is : http://localhost:portnumber/abc/object) (As I have used the routing here)
2) Rad Window does not calls back the Javasccript button on one of its control. (Search control gets opened up in the Rad window and javascript exists there, does not get fired. However the inline alert works fine on the get button)
3) On the Tree list when I calls up the database program to bind the data, the data comes up properly but does not get bind properly some time. Like if the data return the count as 50 it will not display all 50 records sometimes, reason I understand could be that when ever the child of the existing records want to bind itself to the tree, the tree  get refreshed or rebind itself and thats why AJAX stops it to how all the records.

Main problems behind all these issues seems to be either the CSS and Themes or the AJAX update panel.
Please find the attached code for further clarrification.

Please help as it is very urgent and also suggest if I have missed something in Loading Control lifecycle at my own.

Thanks in advance!

Looking forward to buy more products from telerik, once we got succeedded in this project.
Tsvetina
Telerik team
 answered on 08 Feb 2012
3 answers
110 views
According to
http://demos.telerik.com/aspnet-ajax/treeview/examples/programming/loadondemandmodes/defaultcs.aspx
I'm using Page Method

But I have a problem, for somes node I need set AllowEdit = False.

I try use this solution
http://www.telerik.com/community/forums/aspnet-ajax/treeview/allowedit-ignored-in-radtreeview.aspx

but this does not load ParentNodes..

How I can set this??

regards,

this is my code (i do all by code)


public UpdatePanel CreateTreeViewObject(Page pg)
        {

            UpdatePanel updatePanel = new UpdatePanel {ID = "upTreeView", UpdateMode = UpdatePanelUpdateMode.Always};          
          

            HtmlGenericControl workspaceDiv = new HtmlGenericControl("DIV") { ID = "WSWorkspace" };
            
            HtmlGenericControl wsTreeview = new HtmlGenericControl("DIV") { ID = "WsTreeView" };

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

            RadTreeNode parentNode =
                new RadTreeNode(_resources.GetString("Workspace", new CultureInfo(_culture)))
                {
                    Expanded = true,
                    AllowEdit = false,
                    AllowDrag = false,
                    AllowDrop = false,
                    ContextMenuID = "MainContextMenu",
                    Value = "0"
                };

            radTreeView.Nodes.Add(parentNode);

            LoadRootNodes(parentNode, TreeNodeExpandMode.WebService);
         
            System.Web.HttpContext.Current.Session["tvWorkspace"] = radTreeView;
            radTreeView.AllowNodeEditing = true;
            radTreeView.MultipleSelect = false;
            radTreeView.CheckBoxes = true;
            
            
            radTreeView.EnableDragAndDrop = true;
            radTreeView.EnableDragAndDropBetweenNodes = true;

            radTreeView.ContextMenuItemClick += RadTree_Contextmenutitem;
            radTreeView.NodeDrop += RadTreeView1_NodeDrop;
            radTreeView.NodeCheck += RadTreeView_NodeCheck;
            radTreeView.NodeEdit += RadTreeView1_NodeEdit;

            //radTreeView.OnClientNodeDataBound = "OnClientNodeDataBoundHandler";

            //radTreeView.NodeTemplate = new MyTemplateNode();
            
            radTreeView.ContextMenus.Add(new TreeViewContextMenus().CreateWsContextMenu());
            radTreeView.ContextMenus.Add(new TreeViewContextMenus().CreateFolderContextMenu());
            radTreeView.ContextMenus.Add(new TreeViewContextMenus().CreateDocumentContextMenu());
            radTreeView.ContextMenus.Add(new TreeViewContextMenus().CommonActionMenu());


            radTreeView.WebServiceSettings.Path = pg.ID;
            radTreeView.WebServiceSettings.Method = "GetNodes";
           

            wsTreeview.Controls.Add(radTreeView);
            workspaceDiv.Controls.Add(wsTreeview);

            updatePanel.ContentTemplateContainer.Controls.Add(workspaceDiv);

            return updatePanel;

        }



        private static void LoadRootNodes(RadTreeNode parentNode, TreeNodeExpandMode expandMode)
        {
            
            List<smFolder> folderLst = new smOrganization().GetParentNodes(App.CurrentUserId());

            foreach (smFolder folder in folderLst)
            {
                RadTreeNode node = new RadTreeNode
                                       {
                                           Text = folder.FolderName,
                                           Value = folder.FolderId.ToString(),
                                           ImageUrl = "~/UI/Images/folder.png",
                                           ExpandMode = expandMode
                                       };
                node.Attributes["Type"] = "F";

                parentNode.Nodes.Add(node);
            }
        }


        [WebMethod]
        public static RadTreeNodeData[] GetNodes(RadTreeNodeData node)
        {
           
            List<smWorkspace> childList = new smOrganization().GetChildNodes(Convert.ToInt32(node.Value));

            List<RadTreeNodeData> result = new List<RadTreeNodeData>();

            foreach (smWorkspace nodeChild in childList)
            {

                RadTreeNodeData childNode = new RadTreeNodeData();

                if (nodeChild.File != null)
                {
                    childNode.Text = nodeChild.File.FileName;
                    childNode.Value = nodeChild.File.FileId.ToString();
                    childNode.ImageUrl = "~/UI/Images/folder.png";
                    childNode.ContextMenuID = "DocumentContextMenu";
                    childNode.Attributes["Type"] = "D";
                    childNode.Attributes["path"] = nodeChild.File.FileFullPath;
                    childNode.Attributes["documnetStatus"] = nodeChild.File.DocumentStatusId.ToString();
                    childNode.Attributes["securityLevel"] = nodeChild.File.SecurityLevelId.ToString();
                    childNode.Attributes["AllowEdit"] = false;

                    string extension = Components.CommonFunctions.GetExtensionFile(nodeChild.File.FileFullPath);
                    childNode.ImageUrl = CommonFunctions.GetDocumentIcon(extension);
                    
                }
                else if (nodeChild.Folder != null)
                {
                    childNode.Text = nodeChild.Folder.FolderName;
                    childNode.Value = nodeChild.Folder.FolderId.ToString();
                    childNode.ImageUrl = "~/UI/Images/folder.png";
                    childNode.ContextMenuID = "FolderContextMenu";
                    childNode.Attributes["Type"] = "F";
                    
                }

                childNode.ExpandMode = TreeNodeExpandMode.WebService;
                result.Add(childNode);
            }

            return result.ToArray();
        }


Julyhttp://www.telerik.com/community/forums/aspnet-ajax/treeview/allowedit-ignored-in-radtreeview.aspx
Plamen
Telerik team
 answered on 08 Feb 2012
1 answer
66 views
Somewhere along the line, all my telerik tools have disappeared from the toolbox. I am running Visual Studio 2010 Version 10.0.40219.1 SP1Rel and Telerik WebUI VSExtensions 2011.03.1350.0. If I go to the add toolbox and select "Select Items", none of the Telerik.Web namespaces appear. I've tried using the ToolBox Configurator with no luck. I read many of the similar posts on this topic and attempted to follow some of the advice given. So I uninstalled the latest Telerik RadControls for ASP.NET AJAX (Q3 2011 i think) and attempted to reinstall it. Here is where it gets weird. I had earlier cleared out my download folder to save space and when I ran the install on the latest RadControls, it wanted all of my msi files from earlier versions. So the install failed. 

Now I do not see the latest Telerik RadControls in Programs and Features Control Panel, but telerik thinks that everything is up to date. I still cannot get my tools back. I'm currently re-downloading all the earlier versions so I have the msi's on hand. Any idea on what's happening here and what I can do to get everything back in order?

Thanks, Steve
Chavdar Dimitrov
Telerik team
 answered on 08 Feb 2012
1 answer
63 views
I have a RAD Grid that has Grid Client Delete Column which fires OnRowDeleted client event. The Grid also allows row select single only, and has a OnRowSelected event. However my problem is that when the user presses the delete button in the delete column it fires the OnRowDeleted event (which is fine) but then fires the OnRowSelected event which I do not want as the OnRowSelected event goes through to another page.
Is there anyway to stop the OnRowSelected event to fire.

Thanks
Tsvetoslav
Telerik team
 answered on 08 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?