Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
116 views
Trying to use an IF statement to determine which tab was clicked, but I keep receiving a javaScript error, "Object cannot be converted to string"

        strPopUpScript = strPopUpScript & "function ClientTabSelected(sender, args) {" & vbCrLf  
        strPopUpScript = strPopUpScript & "  var tab = args.get_tab();" & vbCrLf  
        strPopUpScript = strPopUpScript & "//  if (tab.get_text() == 'New User') {" & vbCrLf  
        strPopUpScript = strPopUpScript & "//    var oWnd = $find(" & RadWindow1.ClientID & ");" & vbCrLf  
        strPopUpScript = strPopUpScript & "//    oWnd.setUrl('MyPage.aspx');" & vbCrLf  
        strPopUpScript = strPopUpScript & "//    oWnd.show();" & vbCrLf  
        strPopUpScript = strPopUpScript & "//  }" & vbCrLf  
        strPopUpScript = strPopUpScript & "  alert(tab.get_text());" & vbCrLf  
        strPopUpScript = strPopUpScript & "}" & vbCrLf 

With the IF commented out, the name of the tab displays perfectly.  With the IF in play, the system exception pops.  Tried every variation of .toString, String( ), passing tab.get_text() into another variable first, and nothing seems to work.  Any suggestions?

Thanks,

- Brad
ataxia1
Top achievements
Rank 1
 answered on 24 Jul 2008
1 answer
127 views
Hi,

I have implemented Panelbar as the current navigation in a MOSS 2007 site and all seems to load correctly. I am struggling to understand how the width of the control is modified. I am using SharePoint Designer and cannot see any tag attributes, am I missing something?

Code for the control is

<!-- Current Navigation   
--&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;telerik:RadPanelBar   
ID="RadPanelBar1" runat="server" DataSourceID="SiteMapDS"   
Skin="Office2007"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
&lt;PublishingNavigation:PortalSiteMapDataSource ID="SiteMapDS"   
Runat="server"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
SiteMapProvider="CurrentNavSiteMapProvider"   
EnableViewState="true"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
StartFromCurrentNode="true" StartingNodeOffset="0"   
ShowStartingNode="false"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
TrimNonCurrentTypes="Heading"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
&lt;/asp:ContentPlaceHolder&gt; 

Thanks very much

Steve
Tim
Top achievements
Rank 1
 answered on 24 Jul 2008
2 answers
92 views
Hi Telerik,

There is a lit bit problem with the build 2008.1.619 in case of RadTreeViewContextMenu... Here is a sample code:

RadMenuItem rmi1 = new RadMenuItem("1");
rmi1.Value = "1";
RadMenuItem rmi2 = new RadMenuItem("2");
rmi2.Value = "2";
RadMenuItem rmi3 = new RadMenuItem("3");
rmi3.Value = "3";

RadTreeViewContextMenu rtvcm1 = new RadTreeViewContextMenu();
rtvcm1.ID = "rtvcm1";
rtvcm1.Items.Add(rmi1);
rtvcm1.Items.Add(rmi2);

RadTreeViewContextMenu rtvcm2 = new RadTreeViewContextMenu();
rtvcm2.ID = "rtvcm2";
rtvcm2.Items.Add(rmi2);
rtvcm2.Items.Add(rmi3);

RadTreeNode rtn1 = new RadTreeNode("node1", "node1");
rtn1.ContextMenuID = rtvcm1.ID;

RadTreeNode rtn2 = new RadTreeNode("node2", "node2");
rtn2.ContextMenuID = rtvcm2.ID;

RadTreeView rtv1 = new RadTreeView();
rtv1.Nodes.Add(rtn1);
rtv1.Nodes.Add(rtn2);

rtv1.ContextMenus.Add(rtvcm1);
rtv1.ContextMenus.Add(rtvcm2);

Now when you will add this tree view then you will not be seeing menu whose text is "2" because it is added in both the context menus. If you add only menu whose text is "3" in second context menu then all the menu items will be seen.

Can you please rectify this problem...

Thanks and Regards,
Jaimin Kansara
Jaimin
Top achievements
Rank 1
 answered on 24 Jul 2008
2 answers
247 views
Hi guys,

I am stuck with something here. Basically I wanted a delete button for my docks, so I implemented the dock custom command which when user clicks firs the command and deletes the dock. I also needed confirmation on it so I implemented confirmation for client side. The only problem now is that I have to check something else as well before I delete the dock, so I have this database procedure which checks and returns more then 0 if there is something, then I show an error message saying that user needs to delete that thing before they can delete dock, but my custom command doesn't fire the postback although I have got postback enabled. Is there anyway to ajaxify this thing so that user see the error message which I want to show? Here is the code;

here is the code file;
        Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init  
            createDocks()  
        End Sub 
 
 
    Sub createDocks()  
            Try 
                Dim dr As IDataReader = "Calling from the database here" 
                While dr.Read()  
                    Dim aDock As New RadDock()  
                    aDock.DockMode = DockMode.Docked  
                    aDock.UniqueName = Guid.NewGuid().ToString()  
                    aDock.ID = CStr(dr.Item("ID"))  
                    aDock.Title = CStr(dr.Item("Title"))  
                    Dim custCMD As New DockCommand()  
                    custCMD.Name = "deleteCMD" 
                    custCMD.CssClass = "pullImage" 
                    custCMD.Text = "Delete" 
                    custCMD.AutoPostBack = True 
                    custCMD.OnClientCommand = "CustomCommand" 
                    aDock.Commands.Add(custCMD)  
                    AddHandler aDock.Command, AddressOf dock_Command  
                    aDock.DefaultCommands = Dock.DefaultCommands.None  
                    Dim triger As New AsyncPostBackTrigger()  
                    triger.ControlID = aDock.ID  
                    triger.EventName = "DockPositionChanged" 
                    uPanel.Triggers.Add(triger)  
                    rdZone.Controls.Add(aDock)  
                End While 
                dr.Dispose()  
            Catch ex As Exception  
                Dim exp As New exHandle  
                lblmsg.Text = exp.processExp(ex, "", Now)  
            End Try 
        End Sub 
 
 
      Sub dock_Command(ByVal sender As Object, ByVal e As DockCommandEventArgs)  
            If Session("ClassID") Is Nothing Then 
                mainPNL.Visible = False 
                notAllowed.Visible = True 
            Else 
                If e.Command.Name = "deleteCMD" Then 
                    Dim aDock As RadDock = sender  
                    Dim ID_int As Integer = aDock.ID  
                    Dim ClassID As Integer = CInt(Session("ClassID"))  
                      
                    Dim SetsCount As Integer = "Calling from database to check if there is anything" 
                    If (SetsCount > 0) Then 
"NOT SHOWING THIS THING HERE." 
                        lblmsg.Text = "<BR>There are " & SetsCount & " in this section. Please delete them first." 
 
                    Else 
                        'delete from database here and release session  
                        ScriptManager.RegisterStartupScript(uPanel, Me.[GetType](), "RemoveDock", String.Format("function _removeDock() {{" & Chr(13) & "" & Chr(10) & "" & Chr(9) & "Sys.Application.remove_load(_removeDock);" & Chr(13) & "" & Chr(10) & "" & Chr(9) & "$find('{0}').undock();" & Chr(13) & "" & Chr(10) & "" & Chr(9) & "$get('{1}').appendChild($get('{0}'));" & Chr(13) & "" & Chr(10) & "" & Chr(9) & "$find('{0}').doPostBack('DockPositionChanged');" & Chr(13) & "" & Chr(10) & "}};" & Chr(13) & "" & Chr(10) & "Sys.Application.add_load(_removeDock);", (DirectCast(sender, RadDock)).ClientID, uPanel.ClientID), True)  
                    End If 
                End If 
            End If 
        End Sub 

here is the aspx file;
    <asp:ScriptManager id="ScriptManager" runat="server"/>    
         <radT:radformdecorator id="FormDecorator1" runat="server" decoratedcontrols="all" 
            skin="Default">  
        </radT:radformdecorator> 
    
  <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div> 
     <script type="text/javascript">  
        function GetRadWindow()  
        {  
            var oWindow = null;  
            if (window.radWindow) oWindow = window.radWindow;  
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;  
            return oWindow;  
        }        
         
        function returnToParent()  
        {  
            var oWnd = GetRadWindow();  
            oWnd.close();  
        }  
        function CustomCommand(dock, args)  
        {  
            //You can implement your custom logic in this method  
            if (!confirm("Are you sure you want to delete this section?"))  
            {  
                args.set_cancel(true);  
            }  
        }  
        </script>        
            <table width="100%" id="notAllowed" runat="server">  
    <tr> 
    <td>You don't have permission to view this page. Please contact support.<br /> 
    <input id="Button1" onclick="returnToParent(); return false;" type="button"   
                value="Close" class="button" /></td>  
    </tr> 
    </table>    
       <asp:Panel runat="server" ID="mainPNL" Width="500">   
<table cellpadding="0" cellspacing="0" border="0" width="100%">  
<tr> 
<td> 
Select a section and drag it up and down to change its order.  
<asp:Label ID="lblmsg" runat="server" Font-Bold="True"   
                ForeColor="#C00000"></asp:Label> 
</td> 
</tr> 
<tr> 
<td> 
       <radT:raddocklayout runat="server" id="rdLayout" Skin="Sunset">  
            <radT:raddockzone runat="server" id="rdZone" Width="100%" Skin="Sunset">  
            </radT:raddockzone> 
            <div style="display:none">  
                Hidden UpdatePanel, which is used to receive the new dock controls.   
                We will move them with script to the desired initial dock zone.  
                <asp:updatepanel runat="server" id="uPanel">  
                    <triggers> 
             
                    </triggers> 
                </asp:updatepanel> 
            </div> 
        </radT:raddocklayout> 
</td> 
</tr> 
<tr> 
<td><br /> 
<input id="closeBTN" onclick="returnToParent(); return false;" type="button"   
                value="Exit" class="button" /> 
                  &nbsp;&nbsp;  
<%--                <asp:Button ID="exitBTN" runat="server" Text="Exit" Width="130px"   
                    CausesValidation="False" />--%> 
                      
                     &nbsp;&nbsp;<asp:Button ID="resetBTN" runat="server"   
        CausesValidation="False" Text="Reset" Width="130px" /> 
&nbsp;  
                      
                     <asp:Button ID="submitBTN" runat="server" Text="Save & Exit" Width="130px"   
                    CausesValidation="False" /> 
</td> 
</tr> 
</table>        
 
</asp:Panel> 

Thanks
Atiq
Sophy
Telerik team
 answered on 24 Jul 2008
1 answer
233 views
Hi All,

My name is Loi Nguyen.  I have a hierarchy grid with a Master Table and 3 Detail Tables with a column of Drop Down List.  I want to collapse and expand item based on the value selected from a Drop Down List.  For example, If my user select "Yes" he or she in military, then that user can answer the next set of questions.  I am able to collapse and expand through the following javascript code:

var grid = <%= rgDRFormASPPFQuestion.ClientID %>;
var groupColumnImage;
var tableView = grid.DetailTablesCollection[0];   //Problem here
groupColumnImage = tableView.Rows[RowIndex].Control.cells[0].firstChild;

if(groupColumnImage.src)
{
  groupColumnImage.click();
}


The problem I have here is the hard coded of index in the DetailTablesCollection.  I was able to retrieve a correct RowIndex from the Server Side.  How can I retrieve a correct index for DetailTablesCollection? 

I tried to use the following code to get an index for DetailTablesCollection, but the index I have is totally off from the one in Javascript. 

nestedView.DetailTableIndex

For example, the above code give me back index of 0 and javascript show me that I click on item 6 in DetailTablesCollection.

Any input here is greatly appreciate.

Thanks again.
Veli
Telerik team
 answered on 24 Jul 2008
1 answer
390 views
Hi there,

I have 2 questions:

1) I was wondering whether there is a way to place the horizontal scroll bar at the *top* of the RadGrid rather than have it in its default position at the bottom of the grid?

2) I have a radgrid embedded within an Ajax Panel with a panel height and width of 100%.
I have set my RadGrid to a height of 600px however I'd like it to be set to a percentage (say, 95% - meaning, 95% of the panel space) so that regardess of the screen resolution, the height of the grid takes up most of the screen. When I set it to any percentage, the entire grid shrinks and disappears into a thin grey-line. I can only seem to see the grid if the height is set in pixels. Can the height of the grid be set in percentages?

Many thanks,
Danielle

<telerik:radgrid id="ProjectPlanningRadGrid"
AllowFilteringByColumn="True"
AllowSorting="True"
AutoGenerateColumns="False"
DataSourceID="ProjectPlansDataSource"
GridLines="Horizontal"
OnDataBound="ProjectPlanningRadGrid_DataBound"
OnInit="ProjectPlanningRadGrid_Init"
OnItemCommand="ProjectPlanningRadGrid_ItemCommand" OnSortCommand="ProjectPlanningRadGrid_SortCommand"
runat="server"
ShowGroupPanel="True"
ShowFooter="True"
Skin="Office2007"
Height="600px"
OnItemCreated="ProjectPlanningRadGrid_ItemCreated"
GroupHeaderItemStyle-HorizontalAlign="Left" >

<

MasterTableView TableLayout="Fixed" DataSourceID="ProjectPlansDataSource"
CommandItemDisplay="Top" ShowGroupFooter="True" DataKeyNames="ProjectID" Width="350%" >

Dimo
Telerik team
 answered on 24 Jul 2008
1 answer
126 views
How do you upload an attachement with your query?.
Shinu
Top achievements
Rank 2
 answered on 24 Jul 2008
7 answers
185 views

HI!, Hope my TITLE is right... not pretty sure.....Is there a way i could achieve this and have the same functionality with this rather than doing checkboxes="true" because i will be using both radio button and checkbox. the controls depend on the parameter of the parent form in which for example when i call Form A. radiobutton will appear and when i call Form B checkbox will appear. 

I could not implement the example we have here at the site and it only take effect when i enable checkboxes="true". i have successfully bind the labels with the database to the radtreeview but the two control event are not. hope you could help me out with this one.. been trying a lot of ways for days.  :-(

below is a sample of my code hope you guys could understand it. :-)

thanks in advance and more power to telerik.......
    
.ACSX Code

<telerik:RadTreeView ID="_uscRadTrvSelectAuthority" runat="server" skin="Office2007" checkboxes="true" on>
<NodeTemplate >  <asp:RadioButton ID="_uscRBtnSeleAuth" runat="server" Visible="false"/>
<asp:CheckBox ID="_uscCboxSeleAuth" runat="server" Visible="false"/> <asp:Label ID="_uscLblSeleAuth" runat="server"> </asp:Label>
</NodeTemplate>
<CollapseAnimation Type="OutQuint" Duration="100"></CollapseAnimation> <ExpandAnimation Duration="100"></ExpandAnimation>
 </telerik:RadTreeView> 

.CS Code

string pfid = Request.Params["pfid"];
        if (pfid == "Pop1")
        {          ((System.Web.UI.WebControls.CheckBox).Node.FindControl("_uscCBoxSeleAuth")).Visible = true;
        }
       else if (pfid == "Pop2")
       {          ((System.Web.UI.WebControls.RadioButton).Node.FindControl("_uscRBtnSeleAuth")).Visible = true;
        }
        ((System.Web.UI.WebControls.Label)e.Node.FindControl("_uscLblSeleAuth")).Text = e.Node.Text;

Coldapoy
Top achievements
Rank 2
 answered on 24 Jul 2008
2 answers
157 views
How can I check or uncheck the checkbox from node when user click on node?

[]'s,

Henrique
Sergey
Top achievements
Rank 1
 answered on 24 Jul 2008
1 answer
82 views
Hello,

I was wondering if it is possible to display a 'continue' button in the Progress Area. The desired functionality would be that the user clicks 'continue' after the files are uploaded to the server.

The continue button should only become visible or enabled once the upload is complete or an error has occurred.

Thanks,
David
Veselin Vasilev
Telerik team
 answered on 24 Jul 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?