Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
1.5K+ views
How to add first element as "SELECT" in rad combo box?
and i want to bound other database items followed by select
How can i do this plz Help.
Thanks
Swapnil
Top achievements
Rank 1
 answered on 27 Sep 2012
5 answers
102 views
I am trying to d CRUD with Entity Framework Automatically using the article:
http://demos.telerik.com/aspnet-ajax/grid/examples/automaticoperations/efdatabinding/defaultcs.aspx
but it does nothing operation just showing grid,
Design Page:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Demo.aspx.cs" Inherits="Telerik.Demo" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head id="Head1" runat="server">
    <style type="text/css">
        .MyImageButton
        {
            cursor: hand;
        }
        .EditFormHeader td
        {
            font-size: 14px;
            padding: 4px !important;
            color: #0066cc;
        }
    </style>
</head>
<body class="BODY" style="background-color: Black">
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="EntityDataSource1" GridLines="None"
            AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
            AllowAutomaticDeletes="True" AllowSorting="True" Width="750px" OnItemCreated="RadGrid1_ItemCreated"
            CellSpacing="0" Skin="Black">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <ClientSettings>
                <Selecting CellSelectionMode="None"></Selecting>
            </ClientSettings>
            <MasterTableView DataSourceID="EntityDataSource1" AutoGenerateColumns="False" DataKeyNames="ID"
                CommandItemDisplay="Top">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="ID" HeaderText="ID" SortExpression="ID" UniqueName="ID"
                         MaxLength="5">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name"
                        UniqueName="Name">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Address" HeaderText="Address" SortExpression="Address"
                        UniqueName="Address">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DeptID" HeaderText="DeptID" SortExpression="DeptID"
                        UniqueName="DeptID">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" />
                </Columns>
                <EditFormSettings>
                    <EditColumn ButtonType="ImageButton" />
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>
        <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=Entity"
            DefaultContainerName="Entity" EnableDelete="True" EnableFlattening="False" EnableInsert="True"
            EnableUpdate="True" EntitySetName="EMPLOYEEs" EntityTypeFilter="EMPLOYEE">
        </asp:EntityDataSource>
    </div>
    </form>
</body>
</html>
 
Code page:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
 
namespace Telerik
{
    public partial class Demo : System.Web.UI.Page
    {
        Entity ent = new Entity();
        EMPLOYEE emp = new EMPLOYEE();
        protected void Page_Load(object sender, EventArgs e)
        
                RadGrid1.DataSourceID = null;
                BindGrid();
        }
 
        public void BindGrid()
        {
                var query5 = from employee in ent.EMPLOYEEs
                             select new
                             {
                                 ID = employee.ID,
                                 NAME = employee.NAME,
                                 ADDRESS = employee.ADDRESS,
                                 DEPTID = employee.DEPTID
                             };
                RadGrid1.DataSource = query5;
        }
 
        protected void RadGrid1_ItemCreated(object sender, Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                if (!(e.Item is GridEditFormInsertItem))
                {
                    GridEditableItem item = e.Item as GridEditableItem;
                    GridEditManager manager = item.EditManager;
                    GridTextBoxColumnEditor editor = manager.GetColumnEditor("ID") as GridTextBoxColumnEditor;
                    editor.TextBoxControl.Enabled = false;
                }
            }
        }
 
        protected void gv1_NeedDataSource(object sender, Web.UI.GridNeedDataSourceEventArgs e)
        {
            BindGrid();
        }
    }
}

plz help
thanks.
Shinu
Top achievements
Rank 2
 answered on 27 Sep 2012
2 answers
66 views
Hi,



I'm planning to add to buttons were they can open the usercontrol (Edit form), is it possible to do that ?



Thanks,

Ayoob
Lior
Top achievements
Rank 1
 answered on 26 Sep 2012
0 answers
44 views

I have a very simple project set up.  I created it in VS2010...create Telerik Web Application.  I didn't change any of the options in the Telerik wizard.  The site has a default page on the root and one subfolder also with a default page.  

When I navigate to http://hostname everything works fine.  The default page on the root works as expected.  When I navigate to http://hostname/subfolder, the default page loads but I can't get the post back to fire.  If I navigate to http://hostname/subfolder/default.aspx it works.

This behavior does not occur on non-Telerik pages.

This behavior does not occur on the .net dev server; it occurs on IIS.

The default page is set correctly in IIS and I believe the page directive is correct.

Here is the aspx markup:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="TelerikWebForm" %>
 
<!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>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <asp:Button ID="Button1" runat="server" Text="Button" /><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    </div>
    </form>
</body>
</html>


Here is the code behind:

Imports Telerik.Web.UI
 
Partial Class TelerikWebForm
    Inherits System.Web.UI.Page
 
    Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
        Label1.Text = IsPostBack & " : " & Now
    End Sub
End Class


Any ideas?

dino
Top achievements
Rank 1
 asked on 26 Sep 2012
6 answers
546 views
Does telerik have any plans on creating a DataList control similar to telerik Grid?
Muthu
Top achievements
Rank 1
 answered on 26 Sep 2012
4 answers
257 views
Hi All,

How do i get the selected value of a RadMenu using javascript. Also could someone give me a list of few or all the javascript functions that are associated with rad controls. 
Kate
Telerik team
 answered on 26 Sep 2012
2 answers
415 views
Greetings,

I am using the following GridTemplateColumn in a RadGrid...

<telerik:GridTemplateColumn HeaderText="Phone" ItemStyle-Wrap="False">
  <ItemTemplate>
    <asp:Label ID="lblNotifyingIndividualPhoneNumber"
               runat="server"
               Text='<%# string.Format("{0:(###) ###-####}", Convert.ToInt64(Eval("NotifyingIndividualPhone")))%>'>
    </asp:Label>
  </ItemTemplate>
</telerik:GridTemplateColumn>


The problem is when the database field "NotifyingIndividualPhone" is null or empty, it throws an error: "Input string was not in a correct format".  Any ideas how to get around this issue?

Your help is appreciated!
Matt
WAMatt
Top achievements
Rank 2
 answered on 26 Sep 2012
0 answers
75 views
I did customized the radgrid so as to get the grid according to the requirement. But the Calendar Filter and pager button is not getting displayed properly.
Even after customizing, I can see the WebResource CSS in the firebug. I disabled the EmbeddedStyleSheetClass. I like to get some help on this. I will attach the screenshot for the reference. Thanks in advance.
Praveen
Top achievements
Rank 1
 asked on 26 Sep 2012
7 answers
170 views
How do I get the node from the RadToolTipManager_AjaxUpdate?  I have it associated with the the treeview control and it will fire the event but there is no way to know what node value it is.

Thanks
Mark
Aarsh
Top achievements
Rank 1
 answered on 26 Sep 2012
4 answers
148 views
Hi, to simplify my requirement, I would say, I want to display the text of the RadTreeNode in the RadToolTipManager's tool tip

Below is how my code looks currently:

<telerik:RadTreeView ID="MainTree" runat="server" Skin="WebBlue" BackColor="white" EnableDragAndDrop="false" EnableDragAndDropBetweenNodes="false" Height="100%" OnLoad="LoadMainTree" Visible="true" OnContextMenuItemClick="ContextMenuItemClick">
</telerik:RadTreeView>
<telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" OnAjaxUpdate="RadToolTipManager_AjaxUpdate" Skin="Sunset">
</telerik:RadToolTipManager>

RadToolTipManager_AjaxUpdate has following implementation in the code behind:

internal static void RadToolTipManager_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
{
    System.Web.UI.WebControls.Label lblTitle = new System.Web.UI.WebControls.Label();
    lblTitle.Text = "Title";
    lblTitle.Attributes.Add("style", "font-weight: 700");
    System.Web.UI.WebControls.Label lblCaption = new System.Web.UI.WebControls.Label();
    lblCaption.Text = "This is the the hard coded string but I want to print the text of the RadTreeNode, over which I hover my mouse...";
 
    e.UpdatePanel.ContentTemplateContainer.Controls.Add(lblTitle);
    e.UpdatePanel.ContentTemplateContainer.Controls.Add(lblCaption);
}

The LoadTree Event handler ...

private void LoadTree()
        {
                    RadToolTipManager1.ShowDelay = 100;
                    RadToolTipManager1.HideDelay = 100;
                    RadToolTipManager1.AutoCloseDelay = 8000;
                    RadToolTipManager1.TargetControls.Add("MainTree");
        }

Would you please do me a favor by posting codes for the server-side and/or client side, too ? So I can implement the most suitable of those.....

I do not want to go the .ascx way, as demonstrated on the Demo page.

Thanks,
-Aarsh
Aarsh
Top achievements
Rank 1
 answered on 26 Sep 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?