Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
197 views
Hello,
I want to show commnad button in a grid accroding to object's Active boolean field. When it is true, it should show "Deactivate" text, when it is false "Activate" text. What is the best practice to do this behaviour with radgrid.

Thank you.
umit celik
Top achievements
Rank 1
 answered on 23 Nov 2009
1 answer
166 views
I have an asp.net page that has a Treeview control.  The Treeviwe control consists of "Controller" nodes and "Reader" nodes.  The reader nodes are children to the Controller nodes.  So fully expanded, my control should look somethign like this:

++ Root Node
    -- Controller Node
        -- Reader Node
        -- Reader Node
    -- Controller Node

This Treeview control is built entirely from the page's code-behind.  I have several context menus based on the type of node.  The problem is that when I right-click, the context menu wil only display on the "root node".  I cannot get a context menu to display on any other node.

I have alternately set the EnableContextMenu on the nodes without any effect.  I have included a simplified version of the source code that creates the nodes.

So, any help would be greatly appreciated.  Here's the code:

            try 
            {  
                tvStatus.Nodes.Clear();  
 
                RadTreeNode Root = new RadTreeNode(Resources.Globals.MenuCommandStatus);  
                Root.EnableContextMenu = false; // I DON'T want a context menu on the root node  
 
                                // controller menu  
                RadTreeViewContextMenu mnuController = new RadTreeViewContextMenu();  
                mnuController.ID = "mnuController" + DateTime.UtcNow.ToString();  
                mnuController.SkinID = "WebBlue";  
 
                RadMenuItem miControllerInit = new RadMenuItem(Resources.Globals.MenuInitialize);  
                miControllerInit.SkinID = "WebBlue";  
 
                RadMenuItem miSyncController = new RadMenuItem(Resources.Globals.MenuSyncControllerTimeMsg);  
                miSyncController.SkinID = "WebBlue";  
 
                mnuController.Items.Add(miControllerInit);  
                mnuController.Items.Add(miSyncController);  
 
                // Reader menu  
                RadTreeViewContextMenu mnuReader = new RadTreeViewContextMenu();  
                mnuReader.ID = "mnuReader" + DateTime.UtcNow.ToString();  
                mnuReader.SkinID = "WebBlue";  
 
                RadMenuItem miGrantAccess = new RadMenuItem(Resources.Globals.MenuGrantAccess);  
                miGrantAccess.SkinID = "WebBlue";  
 
                RadMenuItem miLockReader = new RadMenuItem(Resources.Globals.MenuLockReader);  
                miLockReader.SkinID = "WebBlue";  
 
                RadMenuItem miUnlockReader = new RadMenuItem(Resources.Globals.MenuUnlockReader);  
                miUnlockReader.SkinID = "WebBlue";  
 
                RadMenuItem miBeepReader = new RadMenuItem(Resources.Globals.MenuBeepReader);  
                miBeepReader.SkinID = "WebBlue";  
 
                RadMenuItem miStopAlarm = new RadMenuItem("Turn Off Alarm");  
                miStopAlarm.SkinID = "WebBlue";  
 
                mnuReader.Items.Add(miStopAlarm);  
                mnuReader.Items.Add(miGrantAccess);  
                mnuReader.Items.Add(miLockReader);  
                mnuReader.Items.Add(miUnlockReader);  
                mnuReader.Items.Add(miBeepReader);  
 
 
                // controller menu  
                RadTreeViewContextMenu mnuController = new RadTreeViewContextMenu();  
                mnuController.ID = "mnuController" + DateTime.UtcNow.ToString();  
                mnuController.SkinID = "WebBlue";  
 
                RadMenuItem miControllerInit = new RadMenuItem(Resources.Globals.MenuInitialize);  
                miControllerInit.SkinID = "WebBlue";  
 
                RadMenuItem miSyncController = new RadMenuItem(Resources.Globals.MenuSyncControllerTimeMsg);  
                miSyncController.SkinID = "WebBlue";  
 
                mnuController.Items.Add(miControllerInit);  
                mnuController.Items.Add(miSyncController);  
 
                // Reader menu  
                RadTreeViewContextMenu mnuReader = new RadTreeViewContextMenu();  
                mnuReader.ID = "mnuReader" + DateTime.UtcNow.ToString();  
                mnuReader.SkinID = "WebBlue";  
 
                RadMenuItem miGrantAccess = new RadMenuItem(Resources.Globals.MenuGrantAccess);  
                miGrantAccess.SkinID = "WebBlue";  
 
                RadMenuItem miLockReader = new RadMenuItem(Resources.Globals.MenuLockReader);  
                miLockReader.SkinID = "WebBlue";  
 
                RadMenuItem miUnlockReader = new RadMenuItem(Resources.Globals.MenuUnlockReader);  
                miUnlockReader.SkinID = "WebBlue";  
 
                RadMenuItem miBeepReader = new RadMenuItem(Resources.Globals.MenuBeepReader);  
                miBeepReader.SkinID = "WebBlue";  
 
                RadMenuItem miStopAlarm = new RadMenuItem("Turn Off Alarm");  
                miStopAlarm.SkinID = "WebBlue";  
 
                mnuReader.Items.Add(miStopAlarm);  
                mnuReader.Items.Add(miGrantAccess);  
                mnuReader.Items.Add(miLockReader);  
                mnuReader.Items.Add(miUnlockReader);  
                mnuReader.Items.Add(miBeepReader);  
 
                // add menus to treeview control                  
                tvStatus.ContextMenus.Add(mnuController);  
                tvStatus.ContextMenus.Add(mnuReader);  
 
 
        // get data and populate controller nodes  
                EncAccess.AccessWS.Controller[] lstControllers = ws.Controller_GetAll(false);  
 
                string ImageUrl = string.Empty;  
                string ControllerName = string.Empty;  
 
                foreach (EncAccess.AccessWS.Controller controller in lstControllers)  
                {  
                    // get status of Controller  
                    bool bOnline = IsControllerOnline(controller);  
                      
                    if (bOnline == true)  
                    {  
                        ControllerName = controller.HostName + " (Online)";  
                        ImageUrl = "Images/flag_green.png";  
                    }  
                    else 
                    {  
                        ControllerName = controller.HostName + " (Offline)";  
                        ImageUrl = "Images/flag_yellow.png";  
                    }  
 
                    // create node for controller  
                    RadTreeNode ndController = new RadTreeNode(Resources.Globals.MenuController + " - " + ControllerName);  
                    ndController.Value = controller.ControllerID.ToString();  
                    ndController.ContextMenuID = "mnuController";  
                    ndController.EnableContextMenu = true;  
                    ndController.ImageUrl = ImageUrl;  
 
                    // get all the readers for this controller  
                    EncAccess.AccessWS.Reader[] lstReaders = ws.Reader_GetByControllerID(controller.ControllerID, false);  
 
                    RadTreeNode ndReaderRoot = new RadTreeNode(Resources.Globals.MenuReaders);  
 
                    foreach (EncAccess.AccessWS.Reader rdr in lstReaders)  
                    {  
                        EncAccess.AccessWS.ReaderStatusEnumeration status = ws.Reader_GetReaderStatus(rdr.ReaderID);  
 
                        string ReaderName = rdr.ReaderName;  
 
                        switch (status)  
                        {  
                            case EncAccess.AccessWS.ReaderStatusEnumeration.IN_ALARM:  
                                ReaderName += " (Status = ALARM)";  
                                ImageUrl = "Images/flag_red.png";  
                                break;  
                            case EncAccess.AccessWS.ReaderStatusEnumeration.FORCED_DOOR_OPEN:  
                                ReaderName += " (Status = Forced Door Open)";  
                                ImageUrl = "Images/flag_yellow.png";  
                                break;  
                            case EncAccess.AccessWS.ReaderStatusEnumeration.DOOR_OPEN:  
                                ReaderName += " (Status = Door Open)";  
                                ImageUrl = "Images/doorgroup.jpg";  
                                break;  
                            case EncAccess.AccessWS.ReaderStatusEnumeration.DOOR_CLOSED:  
                                ReaderName += " (Status = Door Closed)";  
                                ImageUrl = "Images/flag_green.png";  
                                break;  
                        }  
 
                        RadTreeNode ndReader = new RadTreeNode(ReaderName);  
 
                        ndReader.Value = rdr.ReaderID.ToString();  
                        ndReader.ContextMenuID = "mnuReader";  
                        ndReader.ImageUrl = ImageUrl;  
 
                        ndReaderRoot.Nodes.Add(ndReader);  
                    }  
 
                    ndController.Nodes.Add(ndReaderRoot);  
 
                    Root.Nodes.Add(ndController);  
                }  
 
                Root.Expanded = true;  
                tvStatus.Nodes.Add(Root);  
            }  
            catch (Exception ex)  
            {  
                throw ex;  
            }  
        }  
 


Roland
Top achievements
Rank 1
 answered on 23 Nov 2009
1 answer
120 views
Hi,
       When I look at the live demos solution that comes with the Telerik Rad Grid, there are icons for delete, filter, refresh, sort, and add column. However when I create my grid I can see the filter icons in design mode, but they are not there in runtime.

How can I get these icons to display without having to add an icon for each individual column as this is not done in the demo

Regards

Robert

Schlurk
Top achievements
Rank 2
 answered on 23 Nov 2009
4 answers
298 views
Ah, this used to be sooooooooooo easy ... place a RadAjaxManager in the control then use the SetFocus() method to move the focus around the web user controls as needed.

Now that only one RadAjaxManager can exist per .aspx page, this has become rather a nightmare. For me at least. And I've searched and searched and none of the solutions mentioned have worked for me.

I'm hopeful though. :)

  • Scenario: I've a default.aspx page. Kinda like a master page I suppose, but it is not a "Master Page". When I call this default.aspx page, I pass in a menuId value via the query string. Based on that menuId value, I load a particular web user control ascx into a placeholder on that .aspx. The .aspx page contains the RadScriptManager and the RadAjaxManager.
  • Constraint: I have to be able to set the focus at will via the C# code behind, from within any given loaded web user control, after any page load, post back, or ajax request. (Oh and please do not refer me to client-side examples; I've seen some here, and just can't manage to do the translation from client-side to code-behind from w/i a web user control; I need a translator :0) )
  • Would Like: a reusable solution as I do not want to have to recreate a chunk of code or javascript on each user control in general principle not to mention (though I am mentioning it aren't I?) to accomplish what used to be an oh so very simple one-liner.

Thanks in advance for any suggestions!

Rebecca Rasmussen
Top achievements
Rank 2
 answered on 23 Nov 2009
1 answer
202 views
Hi,

I have this client side code, and I cant figure out, how can i close menu item from treeview, when I process it on client.
<script type="text/javascript"> 
    function conetxtMenuClicked(sender, args) { 
        var menuItem = args.get_menuItem(); 
         
        var treeNode = args.get_node(); 
        //alert(treeNode.get_value() + menuItem.get_text()); 
 
        if (menuItem.get_value() == 'SetKeyWords') { 
 
            menuItem.close();     
             
             
            args.set_cancel(true); 
            var window = radopen('/app/Pages/Admin/EditKeyWords.aspx?mpage=empty&nodeId=' + treeNode.get_value(), 'WVGA') 
            window.setSize(800, 200); 
 
        } 
 
         
         
    } 
</script> 


And this header of TreeView

<telerik:RadTreeView ID="MainTree" runat="server" EnableViewState="false" OnClientContextMenuItemClicking="conetxtMenuClicked" OnContextMenuItemClick="MainTree_ContextMenuItemClick"> 

I need sometimes open radWindow and sometimes do regular postback. Problem is, when i open radWindow menu is still open.

Any ideas? Thanks!!!
Roland
Top achievements
Rank 1
 answered on 23 Nov 2009
4 answers
222 views
Hi,
I am not having much luck getting input data from a table that is dynamically created within a radpanel and am hoping someone could tell me what I am doing wrong. 

 <! -- Index data -----------> 
           <telerik:RadPanelBar runat="server" ID="RadPanelBar1"   
              ExpandMode="FullExpandedItem" Width="98%" Height="50%" > 
               <Items> 
                    <telerik:RadPanelItem Expanded="True" Text="Index Information"  Selected="true">   
                        <Items> 
                            <telerik:RadPanelItem Value="IndexInformation" > 
                                <ItemTemplate> 
                                    <asp:Table ID="IndexTable" runat="server"  EnableViewState="false" >                  
                                    </asp:Table> 
                                </ItemTemplate> 
                            </telerik:RadPanelItem> 
                        </Items> 
                    </telerik:RadPanelItem> 
                </Items> 
           </telerik:RadPanelBar>       

The table (IndexTable) is created dynamically
                IndexTable.Rows.Clear();  
                //load the custom indexes  
                foreach (int idx in ur.AllIndexes)  
                {  
                    if (rd.IndexMap.ContainsKey(idx))  
                    {  
                        CIndex cIndex = rd.IndexMap[idx];  
 
                        Label lbl = new Label();  
                        lbl.ID = idx.ToString() + "Label";  
                        lbl.Text = cIndex.IndexComponents[1].Label;  
                        lbl.Visible = true;  
                          
                        TableRow tr = new TableRow();  
 
                        // Create column 1    
                        TableCell td1 = new TableCell();  
                        // Create a label control dynamically    
                        Label _label = new Label();  
                        _label.ID = idx.ToString() + "Label";  
                        _label.Text = cIndex.IndexComponents[1].Label;  
                        // Add control to the table cell    
                        td1.Controls.Add(_label);  
 
                        // Create column 2    
                        TableCell td2 = new TableCell();  
                        td2.Visible = true;
                     }  
                     // Add cell to the row  tr.Cel  
                     tr.Cells.Add(td1);  
                     tr.Cells.Add(td2);  
                     // Add row to the table.   
                     IndexTable.Rows.Add(tr);  
                }  
 
 

The table is displayed just fine but I can't retrieve any of the data that I input into cell 2.  I have a "Submit" button that calls javascript to get the data but all I get is the label data, cell 1. 
 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
      <script type="text/javascript">  
          function GetIndexData() {  
              var test = "";  
              var tblIndex = $get('<%= ((Table)RadPanelBar1.FindItemByValue("IndexInformation").FindControl("IndexTable")).ClientID %>');  
            
              var RowsLength = tblIndex.rows.length;  
              for (var i = 0; i < RowsLength; i++) {  
                  var oCells = tblIndex.rows.item(i).cells;  
                  var CellsLength = oCells.length;  
                  for (var j = 0; j < CellsLength; j++) {  
                      alert(oCells.item(j).innerHTML);  
                  }  
              }  
          }  
      </script> 
    </telerik:RadCodeBlock>    

 I know I must be doing something wrong but I don't know what.  Can anyone help me?

Thanks 
cyfirst
Top achievements
Rank 1
 answered on 23 Nov 2009
1 answer
87 views
hi.
i use telerik Q3 2009.but when i use radchart i have 2 problem:
1.my chart is no displayed on site.
2.when i try to work by chartwizard i see this error:
could no found any resource apporpiate for the specified culture or the neutral culture......
please help me to solve this problems.
Schlurk
Top achievements
Rank 2
 answered on 23 Nov 2009
1 answer
234 views
    <telerik:RadWindow ID="winError" runat="server" Skin="Sunset"   
        VisibleOnPageLoad="True" Behaviors="Close" Visible="False" Behavior="Close"   
        VisibleStatusbar="False" VisibleTitlebar="False">  
        <ContentTemplate> 
            <asp:Label ID="lblErrorMessage" runat="server" /> 
        </ContentTemplate> 
    </telerik:RadWindow>   
 
I'm using the code and on server side whenever I got an error I populate lblErrorMessage text and make window visible. I always have an empty window popup also my intellisence tells me that: "Element 'contenttemplate' is not supported". What I'm doing wrong?

Thank you,
Roman.
Roland
Top achievements
Rank 1
 answered on 23 Nov 2009
1 answer
169 views
Hi,

  I'am currently facing problem with dock appearance when i run my application in google chrome.
I have a raddock zone in which there are about 5 docks placed within, when i try to move one of the docks outside the zone,the dock along with contents appear along with scroll bars(This happens with IE6).
But when i try to run my application in google chrome and try to the move the dock outside the zone the bottom border of the dock gets dissapeared,why does this happen.

Need help asap


Thanks in Advance
Pushpa.
Gido Geek
Top achievements
Rank 2
 answered on 23 Nov 2009
1 answer
137 views
Hi,

  Is it possible to apply different skins for different docks without specifying the dock id in the style sheet(like #Raddock1 or so).
I need to just create a custom skin and apply the corresponding style to the dock with skin id.


Thanks in Advance
Pushpa.
Gido Geek
Top achievements
Rank 2
 answered on 23 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?