Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
78 views
Hello All,

I am new to Telerik and I have a some what of a general (desing) question that has been bothering me for a while.

Master/Content page. . . or...
Single Page with IFrame

I am trying to find a design that will have a Treview (serving as a menu) on the left hand side and content on the right hand side. Very similar to how 'SmarterMail' (http://www.smartertools.com/smartermail/mail-server-software.aspx) does it. I have done this in the past using both Master/Content pages as well as Single Page with an IFrame to load other pages.

I find the (Single Page with an IFrame to load other pages) simpler however some browsers don't like the IFrame and I have a love hate relationship with Master/Content pages.

Do you have any suggestions or other design guidelines for doing this?

Thanks
Shawn
Top achievements
Rank 1
 answered on 05 Jul 2012
1 answer
133 views
I've used a SQL CTE to build a table that represents my hierarchy and now I'm trying to loop through those records to find the parent node, create a new node object and then append that new node object as a child of the parent node I found.

I've got a radtreeview with a parent node with a value of 0.  I've tried accomplishing this two ways - neither works.

The following compiles without error, but doesn't add the newly created CurrentNode to the node I found in objMyTreeView.  
objMyTreeView.FindNodeByValue("0").Nodes.Add(CurrentNode);

The following will find the parent node, but when I add the CurrentNode to it - I'm adding it to the ParentNode object - not the actual parent node in objMyTreeView.  
RadTreeNode ParentNode = objMyTreeView.FindNodeByValue("0");
ParentNode.Nodes.Add(CurrentNode);

This seems like it should be simple - find the node with the value of the current node's parent, then add my current node as a child of the found node.  Any advice offered would be appreciated.  I must be overlooking something obvious.

~ Greg



Plamen
Telerik team
 answered on 05 Jul 2012
2 answers
77 views
I am getting a very strange error when i try to run the below code on IPAD. 

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <script type="text/javascript">
        window.onerror = WindowError;


        //error handler for showing error on the main page in the bottom of the page
        function WindowError(errorMsg, url, linenumber) {
            alert(errorMsg);
            $("#errorDiv").show("Slow");
            $("#errorMsgDiv").html(errorMsg);
        }
    </script>
</head>
<body>
    <form id="frmSrchClient" runat="server" enableviewstate="false">
    <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true">
    </telerik:RadScriptManager>
    <telerik:RadSplitter ID="RadSplitter1" Runat="server" SplitBarsSize="">
        <telerik:RadPane Scrolling="None" ID="treeViewPane" runat="server">
            <telerik:RadSplitter SplitBarsSize="3" ID="ContentSplitter"
                BorderSize="0" PanesBorderSize="0" runat="server" Height="100%" Width="100%">
                <telerik:RadPane Scrolling="Both" ID="NavigationPane" runat="server" Width="200"
                    MinWidth="90" Height="100%">
                        <telerik:RadPanelBar ID="NavigationPanelBar" Width="100%" Height="100%"
                            Style="overflow: hidden" EnableEmbeddedSkins="false" Skin="Metro" runat="server"
                            AccessKey="A" ExpandMode="MultipleExpandedItems">
                            <ExpandAnimation Duration="0" />
                            <CollapseAnimation Duration="0" />
                            <Items>
                                <telerik:RadPanelItem Text="First" Height="21" TabIndex="1" Expanded="true">
                                    <Items>
                                        <telerik:RadPanelItem>
                                            <ItemTemplate>
                                                Text
                                            </ItemTemplate>
                                        </telerik:RadPanelItem>
                                    </Items>
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="Second" Height="21" TabIndex="2" Expanded="true">
                                    <Items>
                                        <telerik:RadPanelItem>
                                            <ItemTemplate>
                                                    Text1
                                            </ItemTemplate>
                                        </telerik:RadPanelItem>
                                    </Items>
                                </telerik:RadPanelItem>
                            </Items>
                        </telerik:RadPanelBar>
                </telerik:RadPane>
            </telerik:RadSplitter>
        </telerik:RadPane>
    </telerik:RadSplitter>
    </form>
</body>
</html>

In the above code if you click on "Text1" you will see that error. This error comes only when i try to run this on IPAD for all other OS's it is working fine. Can you please let me know where I am going wrong. The error only comes when i include the RadPanelBar within the RadSplitter. If if run it alone this error does not come. Can you please let me know the reason behind this I am unable to debug this issue.
Kate
Telerik team
 answered on 05 Jul 2012
1 answer
93 views
Hi,

I'm trying to Dynamically generate the RadContextMenu based on the contents of the Cell in RadGrid on which the user clicks. The menu items are stored in the SQL Sever database. Below is my client side code :

function RowContextMenu(sender, eventArgs) {
                var evt = eventArgs.get_domEvent();
  
                if (evt.target.tagName == "INPUT" || evt.target.tagName == "A") {
                    return;
                }
  
                var index = eventArgs.get_itemIndexHierarchical();
                var row = sender.get_masterTableView().get_dataItems()[index];
  
                var current_status = sender.get_masterTableView().getCellByColumnUniqueName(row, "Current_Status").innerHTML;
                var process_status = sender.get_masterTableView().getCellByColumnUniqueName(row, sender.get_masterTableView().get_columns()[evt.target.cellIndex].get_uniqueName()).innerHTML;
                var process_area = //write code to get the column header of the selected cell
  
                document.getElementById("radGridClickedRowIndex").value = index;
                sender.get_masterTableView().selectItem(row.get_element(), true);
  
                var menu = $find("<%=RadMenu1.ClientID %>");
                menu.show(evt);
  
                evt.cancelBubble = true;
                evt.returnValue = false;
  
                if (evt.stopPropagation) {
                    evt.stopPropagation();
                    evt.preventDefault();
                }
            }

Now i want to pass the values current_Status, process_status and process_area to SQL server and get the list of actions to populate in the context menu.

Below are some snippets of the ASPX code:
<asp:SqlDataSource ID="ActionsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MetadataCS %>"
    ProviderName="<%$ ConnectionStrings:MetadataCS.ProviderName %>" SelectCommand="SELECT [Action] FROM [FileStatusActions] WHERE (([Process_Area] = @Process_Area) AND ([Current_Status] = @Current_Status) AND ([Process_Status] = @Process_Status))">
    <SelectParameters>
        <asp:Parameter Name="Process_Area" Type="String" />
        <asp:Parameter Name="Current_Status" Type="String" />
        <asp:Parameter Name="Process_Status" Type="String" />
    </SelectParameters>
</asp:SqlDataSource>
<telerik:RadContextMenu ID="RadMenu1" runat="server" OnItemClick="RadMenu1_ItemClick" OnClientShowing="showContextMenu"
    DataSourceID="ActionsDataSource" DataTextField="Action" DataValueField="Action" AppendDataBoundItems="true"
    EnableRoundedCorners="true" EnableShadows="true">
    <Items>
        <telerik:RadMenuItem Text="Dynamic Menu" />
    </Items>
</telerik:RadContextMenu>

Please help me achieve the desired functionality using either client side/server side code ? I am also willing to use XML files to load menu instead of database if feasible/possible.

Thanks,
Nishant
Tsvetina
Telerik team
 answered on 05 Jul 2012
9 answers
158 views
Hi

I am using a Telerik Rad Grid with Drag and drop functionality for rows. but when I select multiple rows and drag out of the grid, it shows a large empty box dragging additionally to the selected rows.

Anybody came across this issue before? Any solution to overcome this issue would be very helpful.

Thanks
Malinda
Tsvetina
Telerik team
 answered on 05 Jul 2012
2 answers
142 views
I was wondering is someone could give me hand converting this GridView code to work with the RadGrid control.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Button ID="Button1" runat="server" Text="Get Values" OnClick="Button1_Click" />
        <asp:GridView ID="GridView1" runat="server">
        </asp:GridView>
    </div>
    </form>
</body>
</html>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
  
public partial class _Default : System.Web.UI.Page
{
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        TemplateField templateField = new TemplateField();
        GridView1.Columns.Add(templateField);
        templateField.ItemTemplate = new MyCheckBoxTemplate();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GridView1.DataSource = new string[] { "a", "b", "c" };
            GridView1.DataBind();
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow row in GridView1.Rows)
        {
            bool isChecked = ((CheckBox)row.FindControl("CheckBox1")).Checked;
            Response.Write("RowIndex " + row.RowIndex + ": " + isChecked + "<br />");
        }
    }  
}
  
public class MyCheckBoxTemplate : ITemplate
{
    void ITemplate.InstantiateIn(Control parent)
    {
        CheckBox cb = new CheckBox();
        cb.ID = "CheckBox1";
        parent.Controls.Add(cb);
    }
}
Sizo
Top achievements
Rank 1
 answered on 05 Jul 2012
1 answer
104 views
 *sigh* It's embarrassing enough that I discover I was putting the PageSize on the wrong element but there does not seem to be a way of deleteing this post.
Tsvetoslav
Telerik team
 answered on 05 Jul 2012
5 answers
173 views
I am attempting to use the RadSocialShare control to allow users of my web site to tell others about the link. I have used the following code:

<telerik:RadSocialShare ID="RadSocialShare1" runat="server" CssClass="emailwrapper" Skin="Sitefinity" EnableEmbeddedSkins="true" >
<MainButtons>
<telerik:RadSocialButton SocialNetType="SendEmail" ToolTip="Email" CustomIconUrl="Images2/product/emailtofriend.png"/>
</MainButtons>
</telerik:RadSocialShare>

I am getting the following message when I attempt to send an email:

"Ooops!:( An error has occurred!"

I have got a section in my web.config for

  <system.net>
    <mailSettings>
      <smtp from="customerservices@mywebaddress.com" deliveryMethod="Network">
        <network host="myisprelayserver.net" port="25" defaultCredentials="true" />
      </smtp>
    </mailSettings>
  </system.net>

These settings work when I send mail in code using SmtpClient.Send() in another part of my application

Does anyone have any ideas why I might be getting this error?
Zbysek
Top achievements
Rank 1
 answered on 05 Jul 2012
3 answers
94 views
I'm working with a RadSlider, is it possible to have the maximum value as a LONG instead of an INT?
Slav
Telerik team
 answered on 05 Jul 2012
1 answer
104 views
Hello,

I have a button outside of the Grid which should close any opened insert and edit forms. For insert forms this works without any problem:

if (m_grid.MasterTableView.IsItemInserted)
{
    GridEditFormInsertItem insertItem = (GridEditFormInsertItem)m_grid.MasterTableView.GetInsertItem();
    insertItem.FireCommandEvent("PerformInsert", String.Empty);
}

But for the edit item it doesn't work correctly:

if (m_grid.EditItems.Count > 0)
{
     m_grid.EditItems[0].FireCommandEvent("Update", String.Empty);
}

The GridSaveCommand event is called, but when I try to access my EditForm, it doesn't get found when updating (control will be null). When inserting, it works perfectly. What am I doing wrong when updating?

MyControl control = (MyControl )e.Item.FindControl("MyControl");

Thanks!
Shinu
Top achievements
Rank 2
 answered on 05 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?