Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
236 views
I have a RadGrid in asp.net application which is bound to a ObjectDataSource. Everything works great except filtering.

I traced the query on SQL Server Profiler and found out ...where columnName like '%arabic text%' which is not returning any row.

if you change this to...where columnName like N'%arabic text%' it gives you the correct result.

Is there any solution or work around?.


Thanks
Kesava.
Angel Petrov
Telerik team
 answered on 12 Sep 2014
6 answers
208 views
Hi,

I'm fairly new to the radgrid control, have a radgrid up and running, but I am having some trouble with performance as the number of records grows especially with filters. At the moment, I am using ObjectDataSource and Custom paging

<asp:ObjectDataSource runat="server" ID="OrderAdminOrderDataSource" EnablePaging="false" SelectMethod="GetAllOrdersByCountryISO2Code"
    TypeName="Organo.Web.Application.Facades.OrderAdminFacade" DataObjectTypeName="Organo.Web.Domain.Model.Entities.Order">
    <SelectParameters>
        <asp:Parameter Name="countryISO2Code" />
        <asp:Parameter Name="orderStatusFilterLevel"/>
    </SelectParameters>
</asp:ObjectDataSource>

protected void OrderAdminGrid_OnNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
       {
           OrderAdminGrid.VirtualItemCount =
           OrderAdminFacadeInstance.GetSelectRowCount(CountryDropDown.SelectedItem.Text,
           HttpContext.Current.Items["OrderStatusFilterLevel"].ToString());
           var startRow = (ShouldApplySortFilterOrGroup())
               ? 0
               : OrderAdminGrid.CurrentPageIndex*OrderAdminGrid.PageSize;
           var maxRows = (ShouldApplySortFilterOrGroup())
               ? OrderAdminGrid.VirtualItemCount
               : OrderAdminGrid.PageSize;
           OrderAdminGrid.AllowCustomPaging = !ShouldApplySortFilterOrGroup();
           OrderAdminGrid.DataSource =
               OrderAdminFacadeInstance.GetAllOrdersByCountryISO2Code(CountryDropDown.SelectedItem.Text
                   , HttpContext.Current.Items["OrderStatusFilterLevel"].ToString(), startRow,
                  maxRows);
        }

The second parameter to the select clause is just an int that the code bases what order statuses to return by doing a contains on the list returned here's the code:

protected void OrderAdminGrid_OnNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    //var filterexpression = OrderAdminGrid.MasterTableView.FilterExpression;
    OrderAdminGrid.VirtualItemCount =
    OrderAdminFacadeInstance.GetSelectRowCount(CountryDropDown.SelectedItem.Text,
    HttpContext.Current.Items["OrderStatusFilterLevel"].ToString());
    var startRow = (ShouldApplySortFilterOrGroup())
        ? 0
        : OrderAdminGrid.CurrentPageIndex*OrderAdminGrid.PageSize;
    var maxRows = (ShouldApplySortFilterOrGroup())
        ? OrderAdminGrid.VirtualItemCount
        : OrderAdminGrid.PageSize;
    OrderAdminGrid.AllowCustomPaging = !ShouldApplySortFilterOrGroup();
    OrderAdminGrid.DataSource =
        OrderAdminFacadeInstance.GetAllOrdersByCountryISO2Code(CountryDropDown.SelectedItem.Text
            , HttpContext.Current.Items["OrderStatusFilterLevel"].ToString(), startRow,
           maxRows);
 
    //OrderAdminGrid.DataSource = OrderAdminFacadeInstance.GetAllOrdersByCountryISO2Code(CountryDropDown.SelectedItem.Text,
    //    HttpContext.Current.Items["OrderStatusFilterLevel"].ToString());
}

public IQueryable<Order> GetAllOrdersByCountryISO2Code(string countryISO2Code, string orderStatusFilterLevel, int startRow, int pageSize)
{
    var orders = countryISO2Code == "All"
        ? _orderRepository.GetAllFilteredByOrderStatus(GetOrderStatusFilter(Convert.ToInt32(orderStatusFilterLevel)))
            .OrderByDescending(n => n.OrderDate).Skip(startRow).Take(pageSize)
        : _orderRepository.GetAllFilteredByOrderStatus(GetOrderStatusFilter(Convert.ToInt32(orderStatusFilterLevel)), countryISO2Code)
            .OrderByDescending(n => n.OrderDate).Skip(startRow).Take(pageSize);
    return orders;
}
 
public int GetSelectRowCount(string countryISO2Code, string orderStatusFilterLevel)
{
    var orders = countryISO2Code == "All"
        ? _orderRepository.GetAllFilteredByOrderStatus(
            GetOrderStatusFilter(Convert.ToInt32(orderStatusFilterLevel)))
            .OrderByDescending(n => n.OrderDate)
        : _orderRepository.GetAllFilteredByOrderStatus(
            GetOrderStatusFilter(Convert.ToInt32(orderStatusFilterLevel)), countryISO2Code)
            .OrderByDescending(n => n.OrderDate);
    return orders.Count();
}

and finally this method filters out the records based on whether they are in the filter list or not.

public
IQueryable<Order> GetAllFilteredByOrderStatus(List<int?> filter, string countryISO2Code)
{
    int monthlyOrder = Convert.ToInt16(Enums.OrderType.MonthlyOrder);
 
    return
        this.FindAsQuery(
            x =>
                x.OrderType.OrderTypeId != monthlyOrder &&
                x.ShippingAddress.Country.CountryISO2Code == countryISO2Code &&
                filter.Contains(x.OrderStatusId));
 
}


So this all works great until we start getting more and more records. After looking at the sample for 300000 records with linqdatasource, I thought I'd try that or using an entitydatasource. The only problem is I don't know how to pass in the filter of the list of ints for orderstatuses I want to show or how to use the where clause. I'm open to any suggestions that might imporove performance.

Thanks in advance

Dash
Angel Petrov
Telerik team
 answered on 12 Sep 2014
1 answer
104 views
I have multi-select enabled on my grid. I know I can hold CTRL down to de-select it.

How can I do this without using the CTRL key?

In other words, single-click a row to select it and (if selected) a single-click will unselect it.

The other posts here in the forum that discuss this have broken links.

Kind of uncool even if they are old threads.

-Dave
Eyup
Telerik team
 answered on 12 Sep 2014
1 answer
119 views
Is there a way to access the attributes when the input type is set to "Text" because I am getting an error when trying to retrieve an attribute using the sample code "alert(args.get_entry().get_attributes().getAttribute("attr"));"

I am getting a  JavaScript runtime error: Object doesn't support property or method 'get_entry' .... any thoughts would truly be appreciated.

Nencho
Telerik team
 answered on 12 Sep 2014
1 answer
92 views
There's an API typo on the Grid Footers demo page: http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/grouping/group-footers/defaultcs.aspx

The Description says:
set the GroupingSettings.RetainGroupFooterVisibility property to true.

In the API call, 'Footers' is plural, text should read: GroupingSettings.RetainGroupFootersVisibility


I'm embarrassed to admit how long it took me to figure out why my copy/paste of the sample code wouldn't work, and google didn't help much. :) Hopefully it can get corrected, or at least maybe this note will come up and help anyone else who runs into this copy/paste issue.

Cheers!
Eyup
Telerik team
 answered on 12 Sep 2014
2 answers
149 views
Hello

I am trying to visually show how a sales person is performing compared to a forecast. We measure Revenue and Margin, and have 2 different forecasts, for example:

Incentive 1 Revenue Target 100,000 Margin Target 40,0000
Incentive 2 Revenue Target 150,000 Margin Target 60,0000
Actual Revenue 80,000 Actual Margin 35,000 

is it possible to show 2 series (revenue and profit) in the same gauges?

maybe better to have a barchart if not possible with a gauge

thanks for any advice

graham
Graham
Top achievements
Rank 1
 answered on 12 Sep 2014
1 answer
112 views
I would like to use an AutoCompleteBox to display records as the user enters the information however I need to display alternate text if the record is terminated.  There is the potential that a client name will be listed twice and I need some way of displaying them differently in the AutoCompleteBox.

Normal record will display as such:

Client Name - City, State

What I need for a terminated Client to look like the following

Client Name - City, State (Terminated Date)

I am not sure of how to do this and am looking for some assistance.  Is there away to add an IF...Then statement to my DropDownItemTemplate?

Thanks
Nencho
Telerik team
 answered on 12 Sep 2014
1 answer
146 views
Hi,
i am having grid with 4 column and checkbox, after checking and on button click i can get employeeid(datakeyname of mastertableview) but how to get other three column value
<telerik:RadGrid ID="RadGridRMEmployee" runat="server"
         AllowMultiRowSelection="True"
         OnNeedDataSource="RadGridRMEmployee_NeedDataSource"
         onprerender="RadGridRMEmployee_PreRender">
         <ClientSettings Selecting-AllowRowSelect="true" AllowDragToGroup="True" EnablePostBackOnRowClick="true">
             <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="True"></Selecting>
         </ClientSettings>
         <MasterTableView DataKeyNames="EmployeeIDl">
             <Columns>
                 <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
             </Columns>
             <PagerStyle AlwaysVisible="True"></PagerStyle>
         </MasterTableView>
     </telerik:RadGrid>


protected void btnSaveTask_Click(object sender, EventArgs e)
        {
           bool check;
            foreach (GridDataItem item in RadGridRMEmployee.SelectedItems)
            {
                CheckBox chk = (CheckBox)item["ClientSelectColumn"].Controls[0];
                string EmployeeID = item["EmployeeID"].Text;
 
//HOW TO GET THESE 3 VALUES
 
                string EmployeeName = item["EmployeeName"].Text;  
                string EmployeeType = item["EmployeeType"].Text;
                string EmployeeEmail = item["EmployeeEmail"].Text;
}
}
Eyup
Telerik team
 answered on 12 Sep 2014
9 answers
414 views

 

Sharepoint PeopleEditor control is not rendering properly if it is placed within the RadTabStripà RadTab controls (see sample screenshot from this link). We checked it within FireFox fire bug as you can see below the control type is set to hidden. Is there something that we need to set in the attributes of the Rad controls?

 

Rendered in FireFox

<input id="ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01_hiddenSpanData" type="hidden" name="ctl00$PlaceHolderMain$CollaborationTab$pplAssistantName$ctl01$hiddenSpanData"/>

<input id="ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01_OriginalEntities" type="hidden" value="<Entities><Entity Key="DS\francis.a.b.rosos" DisplayText="Rosos, Francis A. B." IsResolved="True" Description="DS\francis.a.b.rosos">

 

When we changed the type attribute value from hidden to text we can see the expected value e.g. Rosos, Francis A. B.

 

<input id="ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01_hiddenSpanData" type="text" name="ctl00$PlaceHolderMain$CollaborationTab$pplAssistantName$ctl01$hiddenSpanData"/>

<input id="ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01_OriginalEntities" type="text" value="<Entities><Entity Key="DS\francis.a.b.rosos" DisplayText="Rosos, Francis A. B." IsResolved="True" Description="DS\francis.a.b.rosos">

 

Html representation

<wssawc:PeopleEditor

    AllowEmpty="true"

    ValidatorEnabled="true"

    id="pplEditorMyBackup"

    AllowTypeIn="false"

    runat="server"

    SelectionSet="User,SecGroup,SPGroup,DL"

    width="350px"

    visible="true"

    MultiSelect="true"

    EnableViewState="true"     

    onkeydown="javascript:AllowDeleteOnly(event);"

    onkeypress="javascript:AllowDeleteOnly(event);"

    />

 

Source view in FireFox

<span id="ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01" style="display: inline-block; width: 350px;" eeaftercallbackclientscript="" showentitydisplaytextintextbox="0" allowempty="1" value="true" removetext="Remove" moreitemstext="More Names..." nomatchestext="<No Matching Names>">

<input id="ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01_hiddenSpanData" type="hidden" name="ctl00$PlaceHolderMain$CollaborationTab$pplAssistantName$ctl01$hiddenSpanData"/>

<input id="ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01_OriginalEntities" type="hidden" value="<Entities><Entity Key="DS\francis.a.b.rosos" DisplayText="Rosos, Francis A. B." IsResolved="True" Description="DS\francis.a.b.rosos"><ExtraData><ArrayOfDictionaryEntry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><DictionaryEntry><Key xsi:type="xsd:string">DisplayName</Key><Value xsi:type="xsd:string">Rosos, Francis A. B.</Value></DictionaryEntry><DictionaryEntry><Key xsi:type="xsd:string">Email</Key><Value xsi:type="xsd:string">francis.a.b.rosos@accenture.com</Value></DictionaryEntry><DictionaryEntry><Key xsi:type="xsd:string">SPUserID</Key><Value xsi:type="xsd:string">8</Value></DictionaryEntry><DictionaryEntry><Key xsi:type="xsd:string">Title</Key><Value xsi:type="xsd:string">Programmer</Value></DictionaryEntry><DictionaryEntry><Key xsi:type="xsd:string">PrincipalType</Key><Value xsi:type="xsd:string">User</Value></DictionaryEntry></ArrayOfDictionaryEntry></ExtraData></Entity></Entities>" name="ctl00$PlaceHolderMain$CollaborationTab$pplAssistantName$ctl01$OriginalEntities"/>

<input id="ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01_HiddenEntityKey" type="hidden" name="ctl00$PlaceHolderMain$CollaborationTab$pplAssistantName$ctl01$HiddenEntityKey"/>

<input id="ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01_HiddenEntityDisplayText" type="hidden" name="ctl00$PlaceHolderMain$CollaborationTab$pplAssistantName$ctl01$HiddenEntityDisplayText"/>

<table id="ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01_OuterTable" class="ms-usereditor" cellspacing="0" cellpadding="0" border="0" style="width: 350px; border-collapse: collapse;">

<tbody>

<tr>

<td valign="top">

<table cellspacing="0" cellpadding="0" border="0" style="width: 100%; table-layout: fixed;">

<tbody>

<tr>

<td>

<div id="ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01_upLevelDiv" class="ms-inputuserfield" autopostback="0" style="display: none; position: absolute;" tabindex="0" name="upLevelDiv"/>

<textarea id="ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01_downlevelTextBox" class="ms-input" style="width: 100%;" autopostback="0" title="People Picker" onkeyup="onKeyUpRw('ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01');" onkeydown="return onKeyDownRw(this, 'ctl00_PlaceHolderMain_CollaborationTab_pplAssistantName_ctl01', 3, false, event);" cols="20" rows="3" name="ctl00$PlaceHolderMain$CollaborationTab$pplAssistantName$ctl01$downlevelTextBox"/>

</td>

</tr>

</tbody>

</table>

</td>

</tr>

<tr>

</tr>

<tr style="padding-top: 2px;">

</tr>

</tbody>

</table>

</span>

 

Maria Ilieva
Telerik team
 answered on 12 Sep 2014
1 answer
299 views
I have a tooltip that includes a radtooltipupload control. I need to open the tooltip and have this opportunity to work on it and then click on the page to close it. I don't need manual close button either. I have changed the hide event to LeaveTooltip to get rid of the hide button but the problem is after opening the tooltip in the middle right position of an image when I want to go into tooltip and I move the mouse from the image into tooltip, the tooltip is disappearing. I want the toltip stay there that the user can upload a file and then when the user click somewhere else in the page tooltip closes. Would you please help me?
P.S: ( I even increased hidedelay into 500 and even autocloseDelay into 0 but it didn't help)

​<telerik:RadToolTipManager runat="server" AnimationDuration="300" ID="DefaultRadToolTipManager" RelativeTo="Element"
Animation="Slide" Position="MiddleRight" OnAjaxUpdate="OnAjaxUpdate" HideEvent="LeaveToolTip" >
</telerik:RadToolTipManager>
Marin Bratanov
Telerik team
 answered on 12 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?