Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
152 views
Hi, i have a RadSlider with a  RadToolTip attached. But i need to format the text that is being sent to the tooltip.

Eg: "1000" to "1,000".


How can i achieve this?


Best Regards,
Vitor Monteiro
Marin Bratanov
Telerik team
 answered on 26 Oct 2011
1 answer
94 views
Hi,

I am binding my radgrid through WCF. when i am trying to hide the column from client side.
Blank space is getting added in to the grid.

I used both hideColumn(0); and set_visible("ID"); Both are not working

Can anyone help me.

Thanks
Veli
Telerik team
 answered on 26 Oct 2011
1 answer
110 views
Setup:  (this is based on one of Telerik's example scenarios)
  • One RadTabStrip with 3 tabs
  • Each tab has a single PageView
  • Each PageView is dynamically loaded with a UserControl
  • Each UserControl contains a RadGrid
  • Each RadGrid contains a "clientselectcolumn" and allows client-side row selection

Scenario:
  • Select a row in grid on Tab1
  • Select Tab2
  • Select Tab1


Problem:
  • If I were performing this operation server-side I would use code similar to the following to find the grid:
    RadGrid rg = RadTabStrip1.SelectedTab.PageView.Controls[0].FindControl("RadGrid1")
  • Client-side, I have been able to obtain the PageView via the onTabSelected event:
    args.get_tab().get_pageView().  Unfortunately, there isn't a "findControl" method so I cannot find "RadGrid1".

Question:
  • How do I find the grid on Tab1 via client-side code?
Terry
Top achievements
Rank 1
 answered on 25 Oct 2011
1 answer
41 views
How can I make a hierarchical grid (grid with header, details information) fully expanded when the page is loaded?
Jayesh Goyani
Top achievements
Rank 2
 answered on 25 Oct 2011
4 answers
205 views
hi my dear friends:
i have two radcombobox on my page and i am controling their focus by jquery...
also i have some code on their OnClientFocus , therefore focus and blur are so important ...
my aspx and jquery code are like this : (without RadComboBox -> OnClientFocus )

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="Darman.WebForm4" %> 
 
<!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 runat="server"
    <title></title
        <script src="../JQuery/jquery-1.4.1.js" language="javascript" type="text/javascript"></script> 
 
    <script type="text/javascript"
        $(function() { 
        $('input[id$=RadComboBox1_Input]').focus(); 
        $('input[id$=RadComboBox1_Input]').select(); 
        $('input[id$=RadComboBox1_Input]').bind('keyup', function(e) { 
                var code = (e.keyCode ? e.keyCode : e.which); 
                if (code == 13) { 
                    $('input[id$=RadComboBox1_Input]').blur(); 
                    $('input[id$=RadComboBox2_Input').focus(); 
                    $('input[id$=RadComboBox2_Input]').select(); 
                } 
            }); 
            $('input[id$=RadComboBox2_Input]').bind('keyup', function(e) { 
                var code = (e.keyCode ? e.keyCode : e.which); 
                if (code == 38) { 
                    $('input[id$=RadComboBox2_Input]').blur(); 
                    $('input[id$=RadComboBox1_Input').focus(); 
                    $('input[id$=RadComboBox1_Input]').select(); 
                } 
            }); 
        }); 
            </script> 
</head> 
<body> 
    <form id="form1" runat="server"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
    <div> 
        <telerik:RadComboBox ID="RadComboBox1" runat="server" Skin="Outlook"
            <Items> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1"  
                    Value="RadComboBoxItem1" /> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2"  
                    Value="RadComboBoxItem2" /> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3"  
                    Value="RadComboBoxItem3" /> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem4"  
                    Value="RadComboBoxItem4" /> 
            </Items> 
        </telerik:RadComboBox> 
        <telerik:RadComboBox ID="RadComboBox2" runat="server" Skin="Office2007"
            <Items> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1"  
                    Value="RadComboBoxItem1" /> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2"  
                    Value="RadComboBoxItem2" /> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3"  
                    Value="RadComboBoxItem3" /> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem4"  
                    Value="RadComboBoxItem4" /> 
            </Items> 
        </telerik:RadComboBox> 
    </div> 
    </form> 
</body> 
</html> 
 

it seems that radcombo box can not foreget it's focus and stick with that , therefore when i play with 2 buttons (enter=13 and upper key=38 as you see in the upper code - Jquery) For Changing Their Focus so RadComboBox OnClientFocus does not fire until i click on my page and Click On the RadComboBox Again...
These Lines do not work:
1-$('input[id$=RadComboBox1_Input]').blur(); 
2-$('input[id$=RadComboBox2_Input]').blur();
how can i take focus off from radcombo box and  destroy it's highlight?
thanks a lot




John
Top achievements
Rank 1
 answered on 25 Oct 2011
4 answers
125 views
I have RadGrid control on my page, when I look at it in design view it shows the pager. When I compile the project I see no pager at the bottom of the grid.

Here is my code for the grid.

<telerik:RadGrid ID="rgResults" runat="server" Skin="WebBlue" AllowPaging="true"
            AllowSorting="true" PageSize="20" ShowFooter="true" GridLines="None"
            AutoGenerateColumns="false" onpageindexchanged="rgResults_PageIndexChanged"
            onpagesizechanged="rgResults_PageSizeChanged" EnableViewState="true"
            onsortcommand="rgResults_SortCommand">
            <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" ShowPagerText="false" />
            <MasterTableView>
                <Columns>
                    <telerik:GridBoundColumn DataField="U_Prefix" HeaderText="Prefix" UniqueName="U_Prefix" SortExpression="U_Prefix"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CardCode" HeaderText="Card Code" UniqueName="CardCode" SortExpression="CardCode"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="U_LastName" HeaderText="Last Name" UniqueName="U_LastName" SortExpression="U_LastName"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="U_FirstName" HeaderText="First Name" UniqueName="U_FirstName" SortExpression="U_FirstName"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Phone1" HeaderText="Phone 1" UniqueName="Phone1" SortExpression="Phone1"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Phone2" HeaderText="Phone 2" UniqueName="Phone2" SortExpression="Phone2"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="E_Mail" HeaderText="Email" UniqueName="E_Mail" SortExpression="E_Mail"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Frozenfor" HeaderText="On Hold" UniqueName="Frozenfor" SortExpression="Forzenfor"></telerik:GridBoundColumn>
                    <telerik:GridHyperLinkColumn DataNavigateUrlFields="CardCode" Text="Edit" DataNavigateUrlFormatString="Customer.aspx?cc={0}"></telerik:GridHyperLinkColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
Blake
Top achievements
Rank 1
 answered on 25 Oct 2011
1 answer
243 views

Folks, Environment VS 2010 with RadControls for ASP.NET AJAX Q2 2011 SP1. I am using below Telerik Demo for Session Time out.

http://demos.telerik.com/aspnet-ajax/notification/examples/sessiontimeout/defaultcs.aspx

This above approach is based on preset timeout value within the .aspx page. But I would prefer to show the Session timout inactivity alert based in value set in my Web Config file (here is 20 minutes).

My webconfig file...
<system.web>
.......
 <sessionState
 mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" 
 sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" 
  cookieless="false" timeout="20" />
.......
 </system.web>

If possible,  will very much appreciate if any sample code is provided for this solution. Thanks a lot. 

GC_0620

Marin Bratanov
Telerik team
 answered on 25 Oct 2011
1 answer
44 views
hi

I am using the latest version of radtreeview i have problem with this skin propery ,i set the skin property to for example "Telerik" it shows the tree in correct form but , from where treeview reads the skin , i have not copy skins any where , or pleasse explain how I should set the skin path of Rad TreeView .this is my tree view below

                   <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableScriptCombine="False" />
                        <telerik:RadTreeView ID="TreePicGroup" runat="server" Skin="Telerik" DataFieldID="ID"
                            DataFieldParentID="ParentID" DataTextField="Title" CheckBoxes="true"
                            OnNodeClick="treeRole_NodeClick" onnodedrop="treeRole_NodeDrop"
                            EnableDragAndDrop="True" >
                        </telerik:RadTreeView>

Thanks
Plamen
Telerik team
 answered on 25 Oct 2011
1 answer
109 views
hi

I am using the latest version of radtreeview i have problem with this skin propery ,i set the skin property to for example "Telerik" it shows the tree in correct form but , from where treeview reads the skin , i have not copy skins any where , or pleasse explain how I should set the skin path of Rad TreeView .this is my tree view below

                   <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableScriptCombine="False" />
                        <telerik:RadTreeView ID="TreePicGroup" runat="server" Skin="Telerik" DataFieldID="ID"
                            DataFieldParentID="ParentID" DataTextField="Title" CheckBoxes="true"
                            OnNodeClick="treeRole_NodeClick" onnodedrop="treeRole_NodeDrop"
                            EnableDragAndDrop="True" >
                        </telerik:RadTreeView>

Thanks
Plamen
Telerik team
 answered on 25 Oct 2011
4 answers
110 views
I've created a usercontrol that allows users to select "interests" using a RadTreeView so that it can expand and display a hierachy.

In the node template I added in a text box for users to type in a free response if they choose certain fields. It's all working beautifually, with one gotcha.  If a user unchecks the box, the text is still display until

1) the refresh the page
2) I databind the tree

Each of those are not overly desirable solutions, 1) being confusing to the user, 2) loses the state of any expanded nodes.

As the textboxes are created dynamically, they don't have ID's that I could reference with a FindControl and clear them when the appropriate check box is unclicked.

Any thoughts?

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Engage20.ascx.cs" Inherits="edu.yale.som.engage.Engage20" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<style type="text/css">
    .rootNode
    {
        font-size: 13px;
        font-weight: bold;
    
     
    div[class='rtTop rtSelected'] div.rtIn,
    div[class='rtMid rtSelected'] div.rtIn,
    div[class='rtBot rtSelected'] div.rtIn
    {
        color: black !important;
        background-color: transparent !important;
        background-image: none !important;
        border-color: transparent !important;
    }
 
</style>
<script type="text/javascript">
 
    function TreeView_OnClientLoad() {
        var $ = $telerik.$;
        $(".rtTemplate").bind("keydown", function (e) {
            if (e.keyCode == 32)
                e.stopPropagation();
        });
 
    }
 
    function OnClientNodeChecked(sender, eventArgs) {
 
        var node = eventArgs.get_node();
        if (node.get_allowEdit() && node.get_checked()) {
            node.select();
        }
}
 
 
 
</script>
<table border="0" width="100%"><tr><td>
 
 
<telerik:RadTreeView ID="EngageTree" runat="server" CheckBoxes="true" DataFieldID="TagID"
    DataFieldParentID="ParentID" DataTextField="Name" DataSourceID="TagDataSource"
    Skin="Vista" OnNodeCheck="OnNodeChecked" DataValueField="TagID" EnableViewState="true" OnClientLoad="TreeView_OnClientLoad" OnClientNodeChecked="OnClientNodeChecked">
    <DataBindings>
        <telerik:RadTreeNodeBinding Depth="0" CheckableField="Checkable" TextField="Name" Expanded="False"
            CssClass="rootNode" CheckedField="Checked" AllowEditField="IncludeTextBox" CategoryField="UserResponse"/>
        <telerik:RadTreeNodeBinding CheckedField="Checked" AllowEditField="IncludeTextBox" CheckableField="Checkable" CategoryField="UserResponse"/>
    </DataBindings>
    <NodeTemplate>
        <%# DataBinder.Eval(Container, "Text") %> <asp:TextBox Text='<%# DataBinder.Eval(Container, "Category") %>' ToolTip='<%# DataBinder.Eval(Container, "Value") %>' runat="server" Visible='<%# DataBinder.Eval(Container, "AllowEdit").ToString() == "True" %>' AutoPostBack="true" OnTextChanged="textBox_OnTextChanged" />
    </NodeTemplate>
</telerik:RadTreeView></td>
<td>
 <asp:Panel ID="EngageTextResponses" runat="server">
 </asp:Panel>
</td>
</tr></table>
 
<asp:SqlDataSource ID="TagDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:edu_yale_som_engage_connectionString %>"
    SelectCommand="SELECT Tags.TagID, Tags.ParentID, Tags.Name, Tags.Description, Tags.Checkable, Tags.IncludeTextBox, Tags.TypeID, Tags.AssociatedAction, Tags.Position, UserTags.PersonID, UserTags.UserResponse, Tags.IncludeTextBox,
 CASE When PersonID IS NULL Then 'false' Else 'true' END As Checked
 FROM Tags LEFT OUTER JOIN (SELECT RecordID, TagID, PersonID, DateStamp, UserResponse
 FROM UserTags AS UserTags_1
   WHERE (PersonID = @PersonID)) AS UserTags ON Tags.TagID = UserTags.TagID
 WHERE (Tags.TypeID = @TypeID) Order By Position ASC, Tags.Name ASC">
 <SelectParameters>
    <asp:ControlParameter ControlID="HiddenFieldPersonID" PropertyName="Value" Name="PersonID" />
    <asp:ControlParameter ControlID="HiddenFieldTypeID" PropertyName="Value" Name="TypeID" />
 </SelectParameters>
 </asp:SqlDataSource>
 
 <asp:HiddenField ID="HiddenFieldPersonID" runat="server" />
 <asp:HiddenField ID="HiddenFieldTypeID" runat="server" />

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data.SqlClient;
 
namespace edu.yale.som.engage
{
    public partial class Engage20 : System.Web.UI.UserControl
    {
 
        public edu.yale.som.sitefinity.shared.Common commonCode = null;
        private String connectionStringName = null;
        SqlConnection dbConn = null;
        public int personID;
 
        private String _TagTypeID = null;
 
        public string TagTypeID
        {
            get
            {
                return ViewState["_TagTypeID"] as String;
            }
            set
            {
                try
                {
                    //check if page is being accessed in the admin
                    if (commonCode.IsPageInAdmin(this))
                    {
                        //check if the users is an admin
                        if (!Page.User.IsInRole("Admins"))
                        {
                            throw new Exception("Unauthorized access attempt!");
                        }
                    }
                    ViewState["_TagTypeID"] = value;
                }
                catch (Exception e)
                {
                    throw new Exception("Error in edu.yale.som.engage.Engage20.SetTagTypeID()" + e.Message);
                }
            }
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
 
            //check to see if property is set.
            if (TagTypeID == null || TagTypeID == string.Empty || TagTypeID == "")
            {
                throw new Exception("Tag Type not set");
            }
            try
            {
                // Retrieve the Person ID for the current user
                personID = commonCode.getPersonID(commonCode.RealmNameStripper(Page.User.Identity.Name, HttpContext.Current), commonCode.getSessionAuthenticationImplementationID(HttpContext.Current));
                //set PersonID and TagTypeID values into the front end controls for the DataSource to use.
                HiddenFieldPersonID.Value = personID.ToString();
                HiddenFieldTypeID.Value = TagTypeID;
                 
            }
            catch (Exception ex)
            {
                throw new Exception("Error in edu.yale.som.engage.Engage20.Page_Load(): " + ex.Message);
            }
             
        }
 
 
        public Engage20()
        {
            try
            {
                // Initalize the common object
                commonCode = new edu.yale.som.sitefinity.shared.Common();
                // Initialize the connection string name for connecting to Engage            
                if (ConfigurationManager.ConnectionStrings["edu_yale_som_engage_connectionString"] == null || ConfigurationManager.ConnectionStrings["edu_yale_som_engage_connectionString"].ToString() == string.Empty)
                {
                    throw new Exception("Invalid database connection string.");
                }
 
                connectionStringName = ConfigurationManager.ConnectionStrings["edu_yale_som_engage_connectionString"].ToString();
 
            }
            catch (Exception ex)
            {
                throw new Exception("Error in edu.yale.som.engage.Engage20 constructor: " + ex.Message);
            }
        }
 
        protected void OnNodeChecked(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
        {
            dbConn = new SqlConnection(connectionStringName);
 
            if (e.Node.Checked)
            {
                try
                {
                    // Open the database connection
 
                    dbConn.Open();
                    string t = e.Node.Value.ToString();
                    string InsQuery = "IF NOT EXISTS (SELECT * FROM UserTags WHERE tagID = " + @t + " AND personID = " + @personID + ") INSERT into UserTags(TagID, PersonID) VALUES(" + @t + "," + @personID + ")";
                    SqlCommand dbCmd = new SqlCommand(InsQuery, dbConn);
                    dbCmd.ExecuteNonQuery();
 
                }
                catch (Exception ex)
                {
                    throw new Exception("Error Inserting User Tags edu.yale.som.engage.Engage20.OnNodeChecked() '" + ex.Message);
                }
                finally
                {
 
                    if (dbConn != null)
                    {
                        dbConn.Close();
                    }
                }
 
            }
            else
            {
                try
                {
                    // Open the database connection
 
                    dbConn.Open();
                    string t = e.Node.Value.ToString();
                    string Query = "DELETE FROM UserTags WHERE tagID = " + @t + " AND personID = " + @personID;
                    SqlCommand dbCmd = new SqlCommand(Query, dbConn);
                    dbCmd.ExecuteNonQuery();
                    /*
                    if (e.Node.AllowEdit){
                        EngageTree.DataBind();
                    }
                    */
                }
                catch (Exception ex)
                {
                    throw new Exception("Error Deleting User Tags edu.yale.som.engage.Engage20.textBox_OnTextChanged() '" + ex.Message);
                }
                finally
                {
 
                    if (dbConn != null)
                    {
                        dbConn.Close();
                    }
                }
 
            }
 
 
        }
 
        protected void textBox_OnTextChanged(object sender, EventArgs e)
        {
            TextBox box = (TextBox)sender;
            string InsQuery = null;
            string t = string.Empty;
 
            try
            {
                // Open the database connection
                dbConn = new SqlConnection(connectionStringName);
                dbConn.Open();
                t = box.ToolTip.ToString();
                InsQuery = "IF EXISTS (SELECT * FROM UserTags WHERE tagID = " + @t + " AND personID =" + @personID + ") UPDATE UserTags SET UserResponse = '" + box.Text + "' WHERE tagID = " + @t + " AND personID =" + @personID + " ELSE INSERT into UserTags(TagID, PersonID, UserResponse) VALUES(" + @t + "," + @personID + ",'" + box.Text + "' )";
                SqlCommand dbCmd = new SqlCommand(InsQuery, dbConn);
                dbCmd.ExecuteNonQuery();
 
            }
            catch (Exception ex)
            {
                throw new Exception("Error Inserting User Tags edu.yale.som.engage.Engage20.OnTextChanged() " + ex.Message);
            }
            finally
            {
 
                if (dbConn != null)
                {
                    dbConn.Close();
                }
            }
        }
    }
}
Plamen
Telerik team
 answered on 25 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?