Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
84 views
Is there a way I can use Autocomplete and the AutoCompleteSeparator to allow me to find items that contain all the values entered?

For example, I want to use the space as an AutoCompleteSeparator and if someone searches "human liver", I want it to match entries like "human liver cells" and "liver cells (human)", but not "liver cells (mouse)".

Is this possible?
Nencho
Telerik team
 answered on 25 Mar 2014
1 answer
68 views
Hi,
   My Grid has Two groupby Columns I'm able to Hide The The row . .(   $('#divDeliverySlotManager tbody .k-grouping-row:contains("DayValue")').hide();)

   and I'm unable to hide Column. please Find the Screen Capture (highlighted Column) .

   Thanks!!
Angel Petrov
Telerik team
 answered on 25 Mar 2014
3 answers
143 views
Currently I can load data into a Grid when a specific value is chosen from a ComboBox. When the page first loads it displays an empty grid though. I am trying to figure out how to have ALL values loaded onto the Grid when the user first visits the page. 

This demo provides an example of what I am trying to do but I can't quite get it to work:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridcomboajax/defaultcs.aspx?product=combobox



Here is my current code:

<%@ Page Title="Report" Language="C#" MasterPageFile="~/MasterPages/Site.Master" AutoEventWireup="true" CodeBehind="Report.aspx.cs" Inherits="Report" Theme="Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
 
 
    <table>
        <tr>
            <td><label>User: </Label></td>
            <td>
                <telerik:RadComboBox ID="EmailRCB" runat="server" AutoPostBack="True" DataSourceID="dllDataSource"
                    DataTextField="email" DataValueField="email" Width="250px"
                    AppendDataBoundItems="true">
                    <Items>
                        <telerik:RadComboBoxItem Text="- Select User -" Value="0" Selected="true"></telerik:RadComboBoxItem>
                    </Items>
                </telerik:RadComboBox>
            </td>
        </tr>
    </table><br />
 
 
    <!-- grid -->
        <telerik:RadGrid ID="OrdersGrid" AllowPaging="true" DataSourceID="gridSource" runat="server"
            GridLines="None" AllowSorting="true" ShowFooter="true" PageSize = "1000" Width="1500" >
                    <PagerStyle AlwaysVisible="true" ShowPagerText="true" Position="TopAndBottom" />
        <MasterTableView DataSourceID="gridSource" AllowMultiColumnSorting="false">
            <NestedViewTemplate>
                <asp:Panel runat="server" ID="InnerContainer" Visible="true" ViewStateMode="Enabled">
                    <telerik:RadTabStrip runat="server" ID="tsMain" MultiPageID="mpMain" SelectedIndex="0">
                        <Tabs>
                            <telerik:RadTab runat="server" Text="Details" PageViewID="pvMain"  />
                        </Tabs>
                    </telerik:RadTabStrip>
                    <telerik:RadMultiPage runat="server" ID="mpMain" SelectedIndex="0" RenderSelectedPageOnly="false">
                        <telerik:RadPageView runat="server" ID="pvMain">
                            <asp:Label ID="lblNUM" Font-Bold="true" Font-Italic="true" Text='<%# Eval("NUMBER") %>' Visible="false" runat="server"></asp:Label>
                            <!-- inner/nested grid -->
                            <telerik:RadGrid runat="server" ID="grdOrders" DataSourceID="grdReportDataSource2" ShowFooter="false" AllowSorting="false" Width="700" EnableLinqExpressions="false">
                                <MasterTableView ShowHeader="true" AutoGenerateColumns="true" AllowPaging="False">
                                </MasterTableView>
                            </telerik:RadGrid>
                            <!-- datasource for inner/nested grid -->
                            <asp:SqlDataSource ID="grdReportDataSource2" runat="server"
                            ConnectionString="<%$ ConnectionStrings:intranetConnectionString %>"
                            SelectCommand="dbo.sp_AuditClientReportNested2" SelectCommandType="StoredProcedure" >
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="lblNUM" PropertyName="Text" Type="String" Name="NUM"></asp:ControlParameter>
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </telerik:RadPageView>
                    </telerik:RadMultiPage>
                </asp:Panel>
            </NestedViewTemplate>
        </MasterTableView>
        <ClientSettings AllowDragToGroup="false">
        </ClientSettings>
        </telerik:RadGrid>
 
    </div>
 
 
    <!-- datasource for RadComboBox -->
    <asp:SqlDataSource ID="dllDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:intranetConnectionString %>"
        SelectCommand="SELECT DISTINCT EMAIL FROM Table1"></asp:SqlDataSource>
    <!-- datasource for outer/header grid -->
    <asp:SqlDataSource ID="gridSource" runat="server" ConnectionString="<%$ ConnectionStrings:intranetConnectionString %>"
        SelectCommand=" SELECT DISTINCT NUM AS 'Number', EMAIL AS 'Email', BATCHID AS 'Batch ID', NAME AS 'Name', COMPANY AS 'Company', RTRIM(FIRSTNAME) + ' ' + RTRIM(LASTNAME) AS 'Contact Name', DateAdded AS 'Date'
                        FROM Table1
                        WHERE EMAIL = @email
                        ORDER BY NUM">
        <SelectParameters>
            <asp:ControlParameter Name="email" PropertyName="SelectedValue" ControlID="EmailRCB">
            </asp:ControlParameter>
        </SelectParameters>
    </asp:SqlDataSource>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="EmailRCB">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="OrdersGrid" LoadingPanelID="AjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="EmailRCB"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
 
 
 
 
</asp:Content>

Princy
Top achievements
Rank 2
 answered on 25 Mar 2014
2 answers
546 views
Hi -

I often call functions to generate content in my grids and lists.  When I do I always use the DataBinder.Eval() function to get specific fields from the data item and then I send those to my code behind function.  Is there a way to just send the entire data item?

For example below is what I put in my HTML and then the signature of the function in my code behind that takes that data and then generates what I'd like.  If possible I would like to just call CustomerListActions(DataItem As ObjectType).  Thanks!

Ken

HTML CODE
<telerik:GridTemplateColumn><br><%# CustomerListActions(DataBinder.Eval(Container.DataItem, "ID"), DataBinder.Eval(Container.DataItem, "IsDeleted"), DataBinder.Eval(Container.DataItem, "CompanyName"))%><br></telerik:GridTemplateColumn><br>

Function Signature in Code Behind
Public Function CustomerListActions(lngID As Long, intIsDeleted As Integer, strCompanyName As StringAs String<br>End Function
Ken
Top achievements
Rank 1
 answered on 25 Mar 2014
0 answers
93 views
Hi!

    I have a telerik grid, which have columns - Name, Address, Employer.
    Employer is binded by an ID. I want these columns to be Sortable. Address and Name works fine. But for Employer, it is not sorting by Employer(or text), but
    rather it is sorting by the ID.


 @(Html.Telerik().Grid<Customer>(Model)
            .Name("CustomerGrid")
            .ClientEvents(e => e.OnRowDataBound("Grid_onRowDataBound"))
            .Columns(columns =>
            {
                
                columns.Bound(customer => customer.Address).Title("Address");
                columns.Bound(customer => customer.Name).Title("Name");
                columns.Bound(customer => ID).Title("Employer");
            })
            .Pageable(p => p.PageSize(10))
            .Filterable(filtering => filtering.Enabled(false))
            .Sortable(s => s.SortMode(GridSortMode.SingleColumn)))
 


Eg-      Name     Address       Employer
    
           Abc         west street    IBM [id 2] 
           Xyz         111 street      GE [id 3]
           Pqr         north street     Microsoft [id 1]
     


After sorting by Employer i.e by employer name column it  should be--

         Name       Address       Employer
    
         Xyz          111 street     GE [id 3]
         Abc         west street    IBM [id 2] 
         Pqr          north street   Microsoft [id 1]
         
         
abc
Top achievements
Rank 1
 asked on 25 Mar 2014
0 answers
118 views
Is it possible to do multiple reports on tabs in a single Telerik report? I want to create an Excel type report book where each report is associated with a tab. This means that if i click on a tab it opens a report associated with the specific tab. I thought I can do this using report book. So far no luck. This is what i have so far :

reportbook myReportBook = new Reportbook();
reportbook.reports.add(testreport1);
reportbook.reports.add(testreport2);
reportbook.reports(0).documentMapText = "Testing Report1";
reportbook.reports(1).documentMapText = " Testing Report2";

Reportviewer.Reportsource = reportbook;

I can see the report books on the side panel of the page. Is it possible to have it at the bottom as tabs. Just like in Excel. If it is possible how would you do it ?

Thanks
St
Top achievements
Rank 1
 asked on 24 Mar 2014
6 answers
659 views
Hi,
I've submitted a support ticket for this (twice), but never heard back from Telerik.  So I thought I'd turn to the forums.

I'm using an older version of Telerik (2010.2.826.40).  Our company is in the process of updating to a newer version but will not be ready by the time I need to release.

I'm using RadGrid and following several articles I've found online, I have successfully managed to put a page into Edit Mode (I'm using InPlace).  I am able to validate input and display error messages.Basically everything is working, or was until I tried to conquer capturing the OnKeyPress event from an editable field.  Specifically I want to catch the Tab Key Event (Tabbing from edit field to edit field is working fine).I want to catch the tab key in the last field of the last row so I can programmatically go to the next page.

When in edit mode, the last field is a dropdownlist.  I've set up the OnKeyPress event to be caught on the client side, but the client side is never catching the event.  Is it because I'm in edit mode?
 I set this on the server side when initializing the grid:  RadGridControl.ClientSettings.ClientEvents.OnKeyPress = "Grid_OnKeyPress";
 
I have the following function on the client side:
         function Grid_OnKeyPress(sender, args)
         {
             alert("Key Code: " + args.get_keyCode());
             debugger;
             // looking for tab key 
             if (args.keyCode == 9) 
             {
                 debugger;
             }
             return;
         } 

In the past I've successfully caught the onkeypress event from GridFilteringItem, but I was not in edit mode.  Would anyone able to provide me with an example of catching the onkeypress event in edit mode?  I've tried setting the attribute (Attributes.Add) various ways and am still not capturing the keypress event.
         1) Row level:  In ItemDataBound set GridDataItem Attributes.Add
         2) Item Grid Cell:  In ItemCreated & ItemDataBound GridDataItem[unique name].Attributes.Add
         3) The editable dropdownlist:  GridEditableItem.FindControl(dropdownlist) 
         4) The entire grid: .ClientSettings.ClientEvents.OnKeyPress = "Grid_OnKeyPress"

When using Attributes.Add on the server side I used code like this:

  gdi.Attributes.Add("onkeypress",
                           "fireCatchTabKeyCommand('" + discountSearchResultsGrid.RadGridControl.ClientID.ToString(CultureInfo.CurrentCulture) + "', '" + discountSearchResultsGrid.RadGridControl.CurrentPageIndex + "', '" + discountSearchResultsGrid.RadGridControl.MasterTableView.PagingManager.IsLastPage + "', this, event)");


Thanks.
Kim
Top achievements
Rank 1
 answered on 24 Mar 2014
2 answers
63 views
Implemented the Radmenu and have the styling as I wanted it and now want to implement the HighlightPath feature.  It works but it leaves the selected menu item white.  What do I need to add to my css to change the selected menu option?  I would like to change the font color green.

/*Main menu top level */
DIV.RadMenu_ASI .rmRootGroup
{
    Background: linear-gradient(to bottom, #290448 0%,#140224 44%,#040008 100%) !important ;
    background: #1e0335; /* Old browsers */
    background: -moz-linear-gradient(top, #290448 0%, #140224 44%, #040008 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#290448), color-stop(44%,#140224), color-stop(100%,#040008)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, #290448 0%,#140224 44%,#040008 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, #290448 0%,#140224 44%,#040008 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top, #290448 0%,#140224 44%,#040008 100%); /* IE10+ */
    background: linear-gradient(to bottom, #290448 0%,#140224 44%,#040008 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#290448', endColorstr='#040008',GradientType=0 ); /* IE6-9 */
}
 
DIV.RadMenu_ASI .rmRootGroup .rmLink
{
    FONT-SIZE: 12px;
    font-family: Crete Round !important;
    COLOR: #FFFFFF !important;
    LINE-HEIGHT: 50px !important;
    BACKGROUND-IMAGE: none;
}
 
DIV.RadMenu_ASI .rmRootGroup .rmText
{
    BACKGROUND-IMAGE: none;
    padding-left: 30px !important;
    padding-right: 30px !important;
}
 
DIV.RadMenu_ASI .rmRootGroup .rmLink:hover
{
    BACKGROUND-IMAGE: none;
    background-color: #6d9c1f !important;
}
 
/* color of the head menu item as viewing submenu */
DIV.RadMenu_ASI .rmRootGroup .rmExpanded
{
    BACKGROUND-IMAGE: none;
    background-color: #6d9c1f !important;
}
 
/* Sub grouping Styles */
DIV.RadMenu_ASI .rmGroup
{
    line-height: 20px !important;
    padding: 0px !important;
}
 
DIV.RadMenu_ASI .rmGroup .rmLink
{
    FONT-SIZE: 12px;
    font-family: Crete Round !important;
    COLOR: #FFFFFF !important;
    BACKGROUND-IMAGE: none;
    background-color: #6d9c1f !important;
}
 
 
DIV.RadMenu_ASI .rmGroup .rmLink:hover
{
    BACKGROUND-IMAGE: none;
    background-color: #87AE47 !important;
    width: 90%;
    text-decoration: none;
}
 
DIV.RadMenu_ASI .rmSeparator .rmText
{
    padding-bottom: 0px !important;
    padding-top: 0px !important;
    margin-bottom: 0px !important;
    margin-top: 0px !important;
}
Kurt Kluth
Top achievements
Rank 1
 answered on 24 Mar 2014
1 answer
100 views
I can't run the sample code projects as I'm getting the following error when trying to connect to the demo mdf files. 

Database 'Northwind' cannot be upgraded because its non-release version (539) is not supported by this version of SQL Server. You cannot open a database that is incompatible with this version of sqlservr.exe. You must re-create the database.
Could not open new database 'Northwind'. CREATE DATABASE is aborted. (.Net SqlClient Data Provider)

We are using SQL 2012 express and server pro

Any ideas? I would assume telerik would have put out database examples more recent than 14 years!
Danail Vasilev
Telerik team
 answered on 24 Mar 2014
3 answers
448 views

I'm trying to implement a cascading type behvaior between RadComboBoxes so that a second ComboBox gets populated when a user checks items in the first ComboBox. I've wired up a handler on the OnTextChanged event because I wanted my logic to execute after a users has finished checking the desired items not after each item is checked. I'm setting the initial checked items in the first ComboBox during Page Load based on an existing record in the Database. What I'm noticing is that the OnTextChanged event is firing during the first Post Back to the page regardless of which control initiated the Post Back. I've mocked up a sample page to recreate the behavior.

aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test2.aspx.cs" Inherits="Test2" %>
 
<!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 style="background-color: #c3cce5">
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadComboBox ID="RadDropDownList" runat="server"
        MaxHeight="300px" Width="200px" DropDownAutoWidth="Enabled" OnTextChanged="RadDropDownList_TextChanged"
        EmptyMessage="--Choose--" CheckBoxes="true" AutoPostBack="true" >
        <Items>
            <telerik:RadComboBoxItem Value="test1" Text="Test1" />
            <telerik:RadComboBoxItem Value="test2" Text="Test2" />
            <telerik:RadComboBoxItem Value="test3" Text="Test3" />
            <telerik:RadComboBoxItem Value="test4" Text="Test4" />
            <telerik:RadComboBoxItem Value="test5" Text="Test5" />
        </Items>
    </telerik:RadComboBox>
    <asp:Button ID="UpdateButton" runat="server"
        Text="Update" OnClick="UpdateButton_Click" />
    </form>
</body>
</html>

aspc.cs:
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;
 
public partial class Test2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack)
        {
            System.Diagnostics.Debug.WriteLine("Page Load PostBack");
        }
        else
        {
            System.Diagnostics.Debug.WriteLine("Page Load No PostBack");
            //Select a value
            if (RadDropDownList.FindItemByText("Test3") != null)
            {
                RadDropDownList.FindItemByText("Test3").Checked = true;
            }
        }
    }
 
    protected void RadDropDownList_TextChanged(object sender, EventArgs e)
    {
        System.Diagnostics.Debug.WriteLine("RadDropDownList_TextChanged");
    }
 
    protected void UpdateButton_Click(object sender, EventArgs e)
    {
        System.Diagnostics.Debug.WriteLine("UpdateRuleButton_Click");
    }
}


When I run the page, I see the following output:
    Page Load No PostBack

When I click on the Update Button (i.e. I haven't changed anything in the ComboBox), I see the following output:
    Page Load PostBack
    RadDropDownList_TextChanged
    UpdateRuleButton_Click

Notice that the RadDropDownList_TextChanged method is getting called even though the postback was initated from the Update Button. Why/how is the RadDropDownList_TextChanged getting executed? Is it due to the fact of me setting the value during Initial Page Load?

If I click the Button again, I get the expected behavior:
    Page Load PostBack
    UpdateRuleButton_Click

If I comment out the checking of the Item during Page Load of the ComboBox, then I don't experience the weird Behavior. Wondering if this is a bug or working as designed.



Aneliya Petkova
Telerik team
 answered on 24 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?