Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
1.2K+ views
Hi

How to use custom filter in telerik radgrid  using C# Code no need svc and Datasource 

Eyup
Telerik team
 answered on 10 Feb 2015
1 answer
144 views
The following problem happens when using IE11. I haven't been able to recreate the issue with Firefox and Chrome. 

1. Use the Editor demo page and the HTML below. 
2. Switch to design mode and right click either table...select table properties.

The version on your demo page currently places the edited table inside the table below it. I'm currently using version 2014.2.724.45...for me it deletes the table when the Table Properties dialog is closed. 

This doesn't happen with all tables...and for the most part editing tables works as expected in IE11. The HTML below is an example of what can cause the problem.

<table style="width: 746px; height: 274px;">
    <tbody>
        <tr>
            <td style="text-align: center; vertical-align: top;">

                <a href="#0" tabindex="-1">
                    <img alt="" style="border-width: 3px; border-style: solid; margin-right: 0px; vertical-align: top;" src="0.jpg" />
                </a>
                <br />
                Number 0<br />
                Title
            </td>

            <td style="text-align: center; vertical-align: top;"><a href="#1" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; margin-right: 0px; vertical-align: top;" src="1.jpg" /></a><br />
                Number 1<br />
                Title </td>
            <td style="text-align: center; vertical-align: top;"><a href="#2" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; margin-right: 0px; vertical-align: top;" src="2.jpg" /></a><br />
                Number 2<br />
               Title</td>
            <td style="text-align: center; vertical-align: top;"><a href="#3" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; margin-right: 0px; vertical-align: top;" src="3.jpg" /></a><br />
                Number 3<br />
                Title</td>
            <td style="text-align: center; vertical-align: top;"><a href="#4" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; margin-right: 0px; vertical-align: top;" src="4.jpg" /></a><br />
                Number 4<br />
                Title</td>
            <td style="text-align: center; vertical-align: top;"><a href="#5" tabindex="-1" target="_self">
                <img alt="" style="border-width: 3px; border-style: solid; width: 125px; height: 175px; margin-left: 0px; vertical-align: top;" src="5.jpg" /></a><br />
                Number 5<br />
        </tr>
    </tbody>
</table>
<hr />
<table style="width: 695px; height: 726px;">
    <tbody>
        <tr>
            <td style="text-align: center; vertical-align: top;"><a href="#10" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; vertical-align: top;" src="10.jpg" /></a>10<br />
                Number 10<br />
                Title 2</td>
            <td style="text-align: center; vertical-align: top;"><a href="#11" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; vertical-align: top;" src="11.jpg" /></a>11<br />
                Number 11<br />
                Title 2</td>
            <td style="text-align: center; vertical-align: top;"><a href="#12" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; vertical-align: top;" src="12.jpg" /></a>12<br />
                Number 12
                <br />
                Title 2</td>
            <td style="text-align: center; vertical-align: top;"><a href="#13" tabindex="-1" target="_self">
                <img alt="" style="border-width: 3px; border-style: solid; vertical-align: top;" src="13.jpg" /></a>13<br />
                 Number 13 <br />
               Title2 </td>
            <td style="text-align: center; vertical-align: top;"><a href="#14" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; vertical-align: top;" src="14.jpg" /></a><br />
                Number 14<br />
                Title 2
                <br />
                Title</td>
            <td style="text-align: center; vertical-align: top;">
                <img alt="" style="border-width: 3px; border-style: solid; width: 125px; height: 176px; vertical-align: top;" src="15.JPG" /><br />
                Number 15<br />
                Title</td>
        </tr>

    </tbody>
</table>

Ianko
Telerik team
 answered on 10 Feb 2015
1 answer
67 views
Hello Folks,

we are having trouble with a specific constellation of the Grid Batch Edit Mode and Read Only Textfields (Gridbound Textcolumns).
Im blocking the Batcheditmode in the OnBatchEditOpening event and with modern browsers everything works as expected.

Though with IE 9 and IE 8 in Compatiblity Mode, we are having issues.

CSS wise, the fields are blocked and readonly, but unfortunatly the user is still able to enter text. Is there any known workaround?
The code is used in a SharePoint Webpart, hence changing the Documentmode is not a viable solution.

We are using the latest 2014 Release: 2014.3.1209.35
Maria Ilieva
Telerik team
 answered on 10 Feb 2015
1 answer
112 views
Hi,

I'm new to  kendo and i was trying to display a treeView using the ASP MVC approach so i followed the exemple you provided :

var employees = from e in db.Employees
                            where (id.HasValue ? e.ReportsTo == id : e.ReportsTo == null)
                            select new
                            {
                                id = e.id,
                                Name = e.FirstName + " " + e.LastName,
                                hasChildren = e.Employees1.Any()
                            };

My question is:  where the Employees1 comes from ? (I guess from the model) but what is the code inside this function ? where's the recursive function to loop on each child ? Can you provide the model and see what is inside ? 

Thanks
Daniel
Telerik team
 answered on 10 Feb 2015
1 answer
129 views
Hi Team,

I want to create a grid where second column is split to 3 rows. could you please give me the layout aspx how to create.

grid view is attached here. The grid is linked to a db

thanks
Sabitri Mohanty


Pavlina
Telerik team
 answered on 10 Feb 2015
1 answer
88 views
I have an OpenAccessLinqDataSource that pulls from some FK linked tables. The FK value is nullable (UInt32?) and while sorting works, I'm having some difficulties filtering.

Here's my LinqDataSource
<telerik:OpenAccessLinqDataSource ID="OA_Promos" Runat="server" ContextTypeName="Flow.ST2_Data" EntityTypeName="" OrderBy="ID desc" ResourceSetName="Promos" Select="new (ID, identifier, descriptor, lastUpdated, notes, startDate, endDate, startTime, endTime, priority, Promo_art.Art, Promo_art.width, Promo_art.height, Promo_art.fileName, Promo_topic.SpotID)" Where="Deleted == @Deleted" >
    <WhereParameters>
        <asp:Parameter DefaultValue="0" Name="Deleted" Type="Int16" />
    </WhereParameters>
</telerik:OpenAccessLinqDataSource>

The Promo_topic.SpotID is the column I'm trying to filter on using the following:
<telerik:GridBoundColumn DataField="Promo_topic.SpotID" AllowFiltering="true" SortExpression="SpotID" CurrentFilterFunction="EqualTo" FilterControlAltText="Filter SpotID Column" AutoPostBackOnFilter="true" ShowFilterIcon="False" UniqueName="SpotID" HeaderText="Spot ID" DataType="System.UInt32"></telerik:GridBoundColumn>

but I get 0 results returned when I filter on a valid Promo_topic.SpotID


I tried custom filtering:
<telerik:GridBoundColumn DataField="Promo_topic.SpotID" AllowFiltering="true" SortExpression="SpotID" CurrentFilterFunction="Custom" FilterControlAltText="Filter SpotID Column" AutoPostBackOnFilter="true" ShowFilterIcon="False" UniqueName="SpotID" HeaderText="Spot ID" DataType="System.UInt32"></telerik:GridBoundColumn>

with the following ItemCommand event:
protected void ItemCommandFired(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.FilterCommandName)
    {
        Pair filterPair = (Pair)e.CommandArgument;
        if (filterPair.First.ToString() == "Custom")
        {
            string colName = filterPair.Second.ToString();
            TextBox tbPattern = (e.Item as GridFilteringItem)[colName].Controls[0] as TextBox;
            e.Canceled = true;
            grid_promos.MasterTableView.FilterExpression = string.Format("(Promo_topic.SpotID.Equals({0})) AND (Promo_topic.SpotID != null)", tbPattern.Text);
            grid_promos.Rebind();
        }
    }
}

but then get the error "Methods on type 'UInt32?' are not accessible"

Before I switch the entire DataLinqSource to reference a custom object, is there something I'm doing wrong?

Thanks.
Marin
Telerik team
 answered on 10 Feb 2015
1 answer
249 views
Can you use RadEditor to upload a pdf, like an image,  and then have the pdf display on the screen and not a link?



Ianko
Telerik team
 answered on 10 Feb 2015
3 answers
219 views
Hi,

When adding content using pasteHtml method, it's adding <br> tag before the text in chrome browser due to which an extra line is appearing. This issue can also be reproduced using existing tool e.g. "Insert Time". The issue will be gone when you switch between HTML view and Design view. Check this screen cast: http://screencast.com/t/liOx9ryeIp1 

Any work-around to fix this issue?

I'm using "ASP.NET AJAX Q2 2014" (2014.2.724.40) version.

Also I'm disabling ConvertToXhtml, ConvertCharactersToEntities, ConvertFontToSpan, and RemoveScripts filters. And NewLineMode = EditorNewLineModes.Div.

Thanks,
Anil

Marin Bratanov
Telerik team
 answered on 10 Feb 2015
2 answers
131 views
Hi,
I've got my drop down lists working with border coloured validation using JQuery.  Now that I am trying to do the same thing with RadComboBoxes I can't seem to get the relevant css classes.  Below is how I am doing this to the drop down lists.  How do I do the same with ComboBoxes?

Regards

Jon

var $ = $telerik.$;
var dropDown = dropDownTree.get_element();
if (eventArgs.IsValid === false) {
    $(dropDown).find(".rddtInner").addClass("RadDropDownTreeFieldErrorHighlight");
} else {
    $(dropDown).find(".rddtInner").removeClass("RadDropDownTreeFieldErrorHighlight");
}
Jon
Top achievements
Rank 1
 answered on 10 Feb 2015
3 answers
378 views
I have a rad grid that populates and pages fine however when I try to filter based on controls in the filtertemplate the page postsback, but no filter is applied.
When debuging, the filterexpression is added to the mastertableview but the column has no filter applied. Using telerik version 2014.3.1209.45
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Layout/WebPortal.master" CodeBehind="CustomerNotes.aspx.vb" Inherits="Office.CustomerNotes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PageContentPlaceHolder" runat="server">

    <telerik:RadGrid runat="server" ID="grdNotes"  Width="1024" AllowSorting="true" DataSourceID="sdsNotes" AutoGenerateEditColumn="true" AutoGenerateColumns="false" AllowFilteringByColumn="true" 
                    ShowStatusBar="true" RegisterWithScriptManager="true" EnableLinqExpressions="false">
                    <MasterTableView DataKeyNames="ID" AllowSorting="true" AllowPaging="true" PageSize="30" TableLayout="Fixed" EditMode="InPlace" AllowAutomaticInserts="true" AllowFilteringByColumn="true">
                        <Columns>
                            <telerik:GridBoundColumn DataField="CustomerName" HeaderText="Customer Name" ReadOnly="true" AllowFiltering="true" AllowSorting="true" UniqueName="colCustomer">
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="rcbCustomerName" runat="server" AppendDataBoundItems="true" DataSourceID="sdsCustomer" AutoPostBack="true" 
                                        DataTextField="Name" DataValueField="Name" OnClientSelectedIndexChanged="CustomerIndexChanged"
                                        SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("colCustomer").CurrentFilterValue%>'>
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All" />
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="rsbCustomer" runat="server">
                                        <script type="text/javascript">
                                            function CustomerIndexChanged(sender, args) {
                                                var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
                                                tableView.filter("colCustomer", args.get_item().get_value(), Telerik.Web.UI.GridFilterFunction.EqualTo);
                                            }
                                        </script>
                                    </telerik:RadScriptBlock>
                                </FilterTemplate>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Note" HeaderText="Note" AllowSorting="true" AllowFiltering="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="NoteType" HeaderText="Note Type"  AllowSorting="true" AllowFiltering="true" UniqueName="colNoteType" >
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="rcbNoteType" runat="server" AppendDataBoundItems="true" DataSourceID="sdsNoteType" DataTextField="Type" 
                                         DataValueField="Id" OnClientSelectedIndexChanged="NoteTypeIndexChanged" AutoPostBack="true"
                                         SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("colNoteType").CurrentFilterValue%>'>
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All"  />
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="rsbNoteType" runat="server">
                                        <script type="text/javascript">
                                            function NoteTypeIndexChanged(sender, args) {
                                                var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
                                                tableView.filter("colNoteType", args.get_item().get_value(), Telerik.Web.UI.GridFilterFunction.EqualTo);
                                            }
                                        </script>
                                    </telerik:RadScriptBlock>

                                </FilterTemplate>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Name" HeaderText="Creator" ReadOnly="true" AllowSorting="true" AllowFiltering="true" UniqueName="colCreator">
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="rcbCreator" runat="server" AppendDataBoundItems="true" DataSourceID="sdsCreator" DataTextField="Creator"
                                         DataValueField="Creator" AutoPostBack="true" OnClientSelectedIndexChanged="CreatorIndexChanged"
                                        SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("colCreator").CurrentFilterValue%>'>
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All" />
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="rsbCreator" runat="server">
                                        <script type="text/javascript">
                                            function CreatorIndexChanged(sender, args) {
                                                var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
                                                tableView.filter("colCreator", args.get_item().get_value(), Telerik.Web.UI.GridFilterFunction.EqualTo);
                                            }
                                        </script>
                                    </telerik:RadScriptBlock>

                                </FilterTemplate>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="CreationDate" HeaderText="Creation Date" ReadOnly="true" DataType="System.DateTime" DataFormatString="{0:d}" AllowSorting="true" AllowFiltering="false"></telerik:GridBoundColumn>
                        </Columns>

                    </MasterTableView>
                </telerik:RadGrid>
    <asp:SqlDataSource runat="server" ID="sdsCreator" SelectCommand="SELECT DISTINCT c.id as ID,c.Name AS Creator FROM cis.CustomerToDoList ctl INNER JOIN cis.Creators c ON c.ID = ctl.CreatorID INNER JOIN cis.Creators c2 ON c2.ID = ctl.AssigneeID INNER JOIN cis.CustomerList cl ON cl.CustomerNo = ctl.CustomerNo WHERE Complete=0 AND ctl.DateDeleted IS NULL ORDER BY c.Name"  />
    <asp:SqlDataSource runat="server" ID="sdsNoteType" SelectCommand="Select id,type from cis.customernotetype order by type"/>
    <asp:SqlDataSource runat="server" id="sdsCustomer" SelectCommand="SELECT DISTINCT cl.CustomerNo,cl.Name FROM cis.CustomerToDoList ctl INNER JOIN cis.Creators c ON c.ID = ctl.CreatorID INNER JOIN cis.Creators c2 ON c2.ID = ctl.AssigneeID INNER JOIN cis.CustomerList cl ON cl.CustomerNo = ctl.CustomerNo WHERE Complete=0 AND ctl.DateDeleted IS NULL ORDER BY name" />
    <asp:SqlDataSource runat="server" ID="sdsNotes" SelectCommand="SELECT cn.id AS ID,cn.Note,cnt.Type AS NoteType,c.Name,cn.CreationDate,cl.Name AS CustomerName FROM cis.CustomerNotes cn INNER JOIN cis.customernotetype cnt ON cn.notetype = cnt.id INNER JOIN cis.CustomerList cl ON cl.CustomerNo = cn.CustomerNo INNER JOIN cis.Creators c ON c.ID = cn.CreatorID WHERE cl.Inactive=0"/>
</asp:Content>


Angel Petrov
Telerik team
 answered on 10 Feb 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?