Hello,
i have a RadComboBoxsetup like this in code behind
this
.oWebCombo.EnableAutomaticLoadOnDemand =
true
;
this
.oWebCombo.ItemsPerRequest = 30;
this
.oWebCombo.ShowMoreResultsBox =
true
;
this
.oWebCombo.DataSource = _Med.DataSource;
this
.oWebCombo.DataBind();
The Combobox is filled with approx. 38 Items and is almost acting as desired.
(DataSource is a DataSet which is filled from the DataBase beforehand)
When i click on the dropdown, only 30 items are displayed. When i click on the showmoreresults box, the missing 8 items are added to the dropdown list.
BUT:
The showmoreresults box only has a dropdown arrow and no text in it. There should be text like "Items 1 - 30 of 38".
If i handle the ItemsRequested-Event i can see the correct Messeage inside the Messageproperty of the EventArgs. But it is not displayed.
I looked at the dynamic created SourceCode at runtime and i only find this <span>:
<span class="p-icon p-i-arrow-60-down"></span>
Also, on your Demo side i noticed, that the Comboboxes of your Demo also only have the dropdown arrow and no text:
http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/autocompletesql/defaultcs.aspx
Any help would be highly appreciated!
Best Regards,
Benjamin
I inherited a small website which runs under https in production. I've use the Telerik toolkit and all works well on my dev and staging sites which run under HTTP only.
Under HTTPS I receive the following error from a simple RAD Window control
<telerik:RadWindow runat="server" ID="popUpPurchaseGiftCard" OpenerElementID ="ButtonClientAppointment" Animation="Slide" BorderStyle="None" Title="Gift Cards Purchase" VisibleStatusbar="false" DestroyOnClose="true"
Height="600px" Modal="True" NavigateUrl="https:xxxxxxxxxxxxxx" Width="1200px">
</telerik:RadWindow>
I see the following in the IE Edge Tools Console window instead of the RAD Window being displayed: (where xxx is the domain name)
Appointment.aspxSEC7111: HTTPS security is compromised by
http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=TDVjdgRbdvNAY3tnbizUcGLu6YFr2GBuBq7CnCQ8gd7HihfppJChpgbQ9BAQCypzmHbKddH3fWe4jTlOVGDdq_v6MactvcCgErrHNRcD2SOXlBp60&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=mbGZm65DzNC0tMTq0ElbcZxrrOrBEQdO5XVd-4VeDNwASWIM1dWG_V2H70lnwmH4jnG6rPLVBX9JqRpKYwJCf9Og2uCAmm6YBU1TvM_zLns6UmhuxuTFNDxmPj-zsjfO9NljdQ2&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=cmIcXiVJ__exjjpjrN730mwdTpwqvudM4tBqx41Zc-4A3dUNiydhrrAQpzCRti72FeEad6h4GSH5P0LFa8q28O8hVdPBAUdqESe6h7n8g59Tic3ZEcTVde9zC9R6Nbj0doD90g2&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=aoSSiMnLNTC20U5L7LFIKoG-FZNA_KE-uAJCCPW5jRhYlJ2KJbMpGp3yu2_ZIO9kkdcM6FRm2zYNu2JWWGLeFrvm4sj0yJDLbMxzymJPYKOKHqZ9lj2Doyspr8-D_KBtXfC77_Mirs4bbpl7L5X6GTDdSrU1&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=A22-SyJgKhJ5FWUJePaPlOIqRER0mM06Mwjbg_sfF5s1LXzdP9wkmiWUZjB-hQs9TRcMba8A7gWk_Kpq0PgAONlS893iBfc38pOeZMXWEiNwkUPP3e0qCiieiVMufMpBI6uC-w2&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=GUyLPMOEFhffuIMm6XZ0oMyCmmZmn3-jv_exzglunMHyqkj4wBhoBiGQw5Vfq8fvYae9u5g1gCcoQce1cd83DnGd_sUuOY4DREWyEJTnBEX_eULJ3EpGV4wZKOydlmwuFeWR8zlj203GFG5h-I3ce-2gYLM1&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=mxxObI9nroQxDBLgf-QlAlmPb1XOv3wGG9cgpsvmqb8F6TzI5I892XSCSjTTcylB9ngjV8stDOhwoPT3yixYKZeYorwpCfHruMXQYK7Ms0FnYR712MCRSj2qBdywDxK01buQ2q2kPURZfMoDOE7fNPbwa_U1&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=utaAJrK4EroNO-KNr3p19Ast2nKSB_ArhT7EMZqp-LI42AcTdCyPQENdITK58wmadYFIN8BS8oJ9ReEdvvCZ-p0WzIeKO3Hj0x31O8UtXc5fFsPOOJ7AKPDtMwJE75TetxTIRQ2&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=ei_BvuPu_kfWuvcXX4wAOI7KSwKMXmHYN_KT2SEy6IIHq4sLSm3SkLgmyfNtuYrE3MpD-W5KRFOwpZNtJ92Ur_io3qbqPaM7MOVQBgzMteyVXrlmEz0J396z8C6goLd6ss3yFQ2&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=qsRpKh5Y3Y02fhrPxQCAxb0sQGP0n-5qkVmdyNP5q_NA3C7prPsrSwM1Qm34Fjz-ZgBeu6RJOYm5da4ugvkrsRB6ByeSS-ET7TCWYV99u2_KRUZTjp0xoy5uQbG_G65YaMPIcg2&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=LxjRs3XOu8Cy2bbYGMzbCshZ4UfjgB76at9S3cGO94BpfVrx6a1DA3yHGvxWX-d_ZJzbhUdxTbUpJbgf3XJrrifPCGtlQMb6iHoYOxCXDfoTQ3hYsH18rdmz_ICWaNEtI87e6EEu97HX49wc1TMfuQAm1LY52NwmzZTjEIHNxwgPJ4Js0&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=86EhAqQjfuMKlbK4FWyenGp5v5gd90H1upQfGVWidauLt4LgG5DfFx_5gFiRiFXijwUFLIF35aZYe2QTUMdYptF49Rrg3eWEHKsspjcaVZgpghTy5pAA_25vhO4PyqWFyLcG37-7YwoZ9terih7Vtbjo7RA1&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=wl5RKBCXTWDacHhxsSq8QzeyX2RC5IyryfuUdow2WbZdw1CzUanr0f5u9_dqOxLIPZb5dYrztofWLyP_CHocQxgBhdwKKL3ivXY6s_meZv3-yTzMNTbyvSrqHIWss5yF63LhLw2&t=306be499Appointment.aspxSEC7111:
HTTPS security is compromised by http://xxxxxxxxxxxxxxxxxxxxxxxx/ScriptResource.axd?d=OhiQVM8i2feYV04aiMKgwtuEtq-ddyDpZfKpmcWhAOzbEIJyzrOH9R1tlJS1iMDudkHxlGdMWIc1nhkAGSMWwxCWpeAlqQISR6SMKs-AuwLVM_W_P4wLRYYkq9dij_ufddgKoQ2&t=306be499Appointment.aspx
I'm not sure why the RAD Window is causing the fault but when I click on the first error regarding HTTPS security is compromised by http://xxxxxxxx/WebResource.axd? then I get the attached webresource.css file which has a lot of detail regarding the RAD Window?
I've read some other related links in the forum and I've already removed relative links and spelt them out using a full link to the site with HTTPS but this hasn't made any difference. I've also tried to run the window as popup on the same page rather than use a navigation URL but I get the same bunch of errors.
Hi,
I am using Rad date picker with following options but some how I am not seeing the navigation arrows , if I hover on arrow region or click on that region it does work.
I guess it must be some CSS issue.
<telerik:RadDatePicker ID="radReferenceDateInsalled" runat="server" Culture="English (United States)">
<DateInput DateFormat="MM/dd/yyyy" runat="server" ReadOnly="true" >
</DateInput>
</telerik:RadDatePicker>
<
telerik:RadImageGallery
ID
=
"galRoom"
runat
=
"server"
Width
=
"100%"
BackColor
=
"#F4F4F4"
Culture
=
"it-IT"
DisplayAreaMode
=
"Thumbnails"
>
<
ThumbnailsAreaSettings
Height
=
"608px"
ThumbnailHeight
=
"150"
ThumbnailWidth
=
"150"
ThumbnailsSpacing
=
"2"
/>
<
ImageAreaSettings
ShowDescriptionBox
=
"False"
Height
=
"730"
/>
<
ToolbarSettings
ItemsCounterFormat
=
"Fotografia {0} di {1}"
/>
<
ClientSettings
>
<
AnimationSettings
SlideshowSlideDuration
=
"3000"
>
<
NextImagesAnimation
Type
=
"Random"
/>
<
PrevImagesAnimation
Type
=
"Random"
/>
</
AnimationSettings
>
</
ClientSettings
>
</
telerik:RadImageGallery
>
Protected
Sub
Page_Load(sender
As
Object
, e
As
EventArgs)
Handles
Me
.Load
galRoom.ImagesFolderPath =
"events/ev1"
End
Sub
Hi
I have a page with a timer, a grid and a quite complex scheduler. The trigger checks for new records in a database table and refreshes/rebinds the grid if new information is available.
Every time the timer triggers, memory consumption goes up about 15-20MB for a RadScheduler with about 150-200 appointments, about 3-4 MB for about 20 appointments (no rebinding of scheduler). After a few hours memory consumption of the page in Chrome is almost at 2GB and the page is unusable. Only restarting the browser helps fixing the issue.
This happens also when Timer is off and I navigate back and forth in the RadScheduler in WeekView. This time the scheduler is rebinding, of course.
Any hints where I could look for ewithout having to post the code? Or any example with timers and RadScheduler?
Thank you very much...
hi,
i have a GridTemplateColumn in Radgrid. In the <EditItemTemplate> i have a radcombo. When fire the event radcombo1_SelectedIndexChanged
i need to access to another GridTemplateColumn like this:
<telerik:GridTemplateColumn HeaderText="Annul." UniqueName="flg_ann">
<ItemTemplate>
<asp:CheckBox id="CheckBoxFlgAnnul" runat="server" Checked='<%# Eval("flg_ann") %>'></asp:CheckBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
........rcbStatoRecUpd_SelectedIndexChanged(.......)
Dim radcombo As RadComboBox = CType(sender, RadComboBox)
Dim editedItem As GridEditableItem = TryCast(radcombo.NamingContainer, GridEditableItem)
Those firsts two line of code work well BUT after no way to access to CheckBox column. i try findcontrol in all possible way but i got alway error "object no reference" ecc ecc I also try Dim item As GridDataItem = DirectCast(combo.NamingContainer, GridDataItem) but nothing to do. no way.
Question : there is a way to access to that column or not ?
TY, Maurizio
Hello Telerik Team,
<Reposting this thread from ComboBox forum to this Grid forum, as I thought it is more appropriate to put it here.>
Original link: http://www.telerik.com/forums/need-help-on-radcombobox-multi-checkbox-filtering-not-working
I can't seem to make multiple checkbox filtering work on a RadComboBox inside a RadGrid using a Filter Template.
I have been working on the examples given on the thread below for several days already..
http://www.telerik.com/forums/how-to-persist-dropdownlist-selected-index-and-value-on-postback-from-radgrid-filtertemplate#GW3MyQLmVEmy8XzsmrHzeQ
Particularly, I used Eyup's sample solution of
RadGridFilterComboClientAndServerDataBinding and modified the DataSource
to have advance data binding, as I need to populate my RadComboBox in
the code behind. But this sample code only supported single item
filtering..
So I used the code coming from SearchMultipleValues.aspx and
SearchMultipleValues.aspx.cs to implement the multi checkbox filtering.
This code can be found on Eyup's post below, inside
RadGridFilterMultipleChecked.zip:
http://www.telerik.com/support/code-library/multi-selection-radcombobox-for-filtering-grid#2351833
Please check my combined aspx code and code behind below.
ASPX Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadGridFilterComboClientAndServer.aspx.cs" Inherits="RadGridFilterComboClientAndServer" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2012.3.1308.35, PublicKeyToken=121fae78165ba3d4, Culture=neutral" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
//Put your JavaScript code here.
</
script
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
EnablePartialRendering
=
"true"
>
</
asp:ScriptManager
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowPaging
=
"True"
CellSpacing
=
"0"
GridLines
=
"None"
Width
=
"800px"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
AllowFilteringByColumn
=
"true"
OnItemDataBound
=
"RadGrid1_ItemDataBound"
OnPreRender
=
"RadGrid1_PreRender"
OnItemCommand
=
"RadGrid1_ItemCommand"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataKeyNames
=
"OrderID"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"OrderID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter OrderID column"
HeaderText
=
"OrderID"
ReadOnly
=
"True"
SortExpression
=
"OrderID"
UniqueName
=
"OrderIDClient"
>
<
FilterTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboBoxClientInner"
Height
=
"100px"
AppendDataBoundItems
=
"true"
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("OrderIDClient").CurrentFilterValue %>'
OnDataBinding="RadComboBoxes_DataBinding" DataTextField="TextFieldName" DataValueField="ValueFieldName"
runat="server" OnClientSelectedIndexChanged="CountryIndexChanged">
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"All"
/>
</
Items
>
</
telerik:RadComboBox
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock3"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function CountryIndexChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("OrderIDClient", args.get_item().get_value(), "EqualTo");
}
</
script
>
</
telerik:RadScriptBlock
>
</
FilterTemplate
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"OrderID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter OrderID column"
HeaderText
=
"OrderID"
ReadOnly
=
"True"
SortExpression
=
"OrderID"
UniqueName
=
"OrderIDServer"
>
<
FilterTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboBoxServerInner"
Height
=
"100px"
AppendDataBoundItems
=
"true"
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("OrderIDServer").CurrentFilterValue %>'
OnDataBinding="RadComboBoxes_DataBinding" DataTextField="TextFieldName" DataValueField="ValueFieldName"
OnSelectedIndexChanged="RadComboBoxServerInner_SelectedIndexChanged"
runat="server" AutoPostBack="true">
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"All"
/>
</
Items
>
</
telerik:RadComboBox
>
</
FilterTemplate
>
</
telerik:GridBoundColumn
>
<
telerik:GridDateTimeColumn
DataField
=
"OrderDate"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter OrderDate column"
HeaderText
=
"OrderDate"
SortExpression
=
"OrderDate"
UniqueName
=
"OrderDate"
>
</
telerik:GridDateTimeColumn
>
<
telerik:GridNumericColumn
DataField
=
"Freight"
DataType
=
"System.Decimal"
FilterControlAltText
=
"Filter Freight column"
HeaderText
=
"Freight"
SortExpression
=
"Freight"
UniqueName
=
"Freight"
>
</
telerik:GridNumericColumn
>
<
telerik:GridBoundColumn
DataField
=
"ShipName"
FilterControlAltText
=
"Filter ShipName column"
HeaderText
=
"ShipName"
SortExpression
=
"ShipName"
UniqueName
=
"ShipName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ShipCountry"
FilterControlAltText
=
"Filter ShipCountry column"
HeaderText
=
"ShipCountry"
SortExpression
=
"ShipCountry"
UniqueName
=
"ShipCountry"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Quantity"
FilterControlAltText
=
"Filter Quantity column"
HeaderText
=
"Quantity"
SortExpression
=
"Quantity"
UniqueName
=
"Quantity"
>
<
FilterTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboBoxQuantity"
DataTextField
=
"Quantity"
DataValueField
=
"Quantity"
Height
=
"100px"
AppendDataBoundItems
=
"true"
CheckBoxes
=
"true"
runat
=
"server"
EmptyMessage
=
"Select Quantity"
Skin
=
"Metro"
Filter
=
"Contains"
OnDataBinding
=
"RadComboBoxQuantity_DataBinding"
>
</
telerik:RadComboBox
>
<
asp:ImageButton
ID
=
"ImageButton1"
runat
=
"server"
AlternateText
=
"Filter"
ToolTip
=
"Filter by Quantity"
OnClick
=
"ImageButton1_Click"
ImageUrl
=
"~/worldSearch.png"
/>
</
FilterTemplate
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
form
>
</
body
>
</
html
>
Code Behind:
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
public partial class RadGridFilterComboClientAndServer : System.Web.UI.Page
{
bool isFiltered = false;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
RadGrid1.DataSource = GetGridSource();
}
protected void RadComboBoxServerInner_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
GridFilteringItem filterItem = (sender as RadComboBox).NamingContainer as GridFilteringItem;
filterItem.OwnerTableView.GetColumn("OrderIDServer").CurrentFilterValue = e.Value;
filterItem.FireCommandEvent("Filter", new Pair("EqualTo", "OrderIDServer"));
}
private DataTable GetGridSource()
{
DataTable dataTable = new DataTable();
DataColumn column = new DataColumn();
column.DataType = Type.GetType("System.Int32");
column.ColumnName = "OrderID";
dataTable.Columns.Add(column);
column = new DataColumn();
column.DataType = Type.GetType("System.DateTime");
column.ColumnName = "OrderDate";
dataTable.Columns.Add(column);
column = new DataColumn();
column.DataType = Type.GetType("System.Decimal");
column.ColumnName = "Freight";
dataTable.Columns.Add(column);
column = new DataColumn();
column.DataType = Type.GetType("System.String");
column.ColumnName = "ShipName";
dataTable.Columns.Add(column);
column = new DataColumn();
column.DataType = Type.GetType("System.String");
column.ColumnName = "ShipCountry";
dataTable.Columns.Add(column);
column = new DataColumn();
column.DataType = Type.GetType("System.String");
column.ColumnName = "Quantity";
dataTable.Columns.Add(column);
DataColumn[] PrimaryKeyColumns = new DataColumn[1];
PrimaryKeyColumns[0] = dataTable.Columns["OrderID"];
dataTable.PrimaryKey = PrimaryKeyColumns;
for (int i = 0; i <= 80; i++)
{
DataRow row = dataTable.NewRow();
row["OrderID"] = i + 1;
row["OrderDate"] = DateTime.Now;
row["Freight"] = (i + 1) + (i + 1) * 0.1 + (i + 1) * 0.01;
row["ShipName"] = "Name " + (i + 1);
row["ShipCountry"] = "Country " + (i + 1);
row["Quantity"] = "Quantity " + (i + 1);
dataTable.Rows.Add(row);
}
return dataTable;
}
protected void RadComboBoxes_DataBinding(object sender, EventArgs e)
{
RadComboBox combo = sender as RadComboBox;
combo.DataSource = Enumerable.Range(1, 6).Select(
x => new { ValueFieldName = x, TextFieldName = "ID " + x });
}
protected void RadComboBoxQuantity_DataBinding(object sender, EventArgs e)
{
RadComboBox combo = sender as RadComboBox;
combo.DataSource = GetGridSource();
combo.DataTextField = "Quantity";
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
GridFilteringItem filterItem = (sender as ImageButton).NamingContainer as GridFilteringItem;
RadComboBox combo = filterItem.FindControl("RadComboBoxQuantity") as RadComboBox;
List<
string
> expressions = new List<
string
>();
List<
string
> quantity = new List<
string
>();
foreach (RadComboBoxItem item in combo.CheckedItems)
{
quantity.Add(item.Text);
expressions.Add("(it[\"Quantity\"].ToString().Contains(\"" + item.Text + "\"))");
}
isFiltered = true;
string value = string.Join("OR", expressions.ToArray());
ViewState["QuantityFilterValue"] = string.IsNullOrEmpty(value) ? value : "(" + value + ")";
ViewState["Quantity"] = quantity;
}
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.FilterCommandName)
{
isFiltered = true;
}
}
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridFilteringItem)
{
RadComboBox combo = (e.Item as GridFilteringItem).FindControl("RadComboBoxQuantity") as RadComboBox;
if (ViewState["Quantity"] != null)
{
foreach (string quantity in (List<
string
>)ViewState["Quantity"])
{
combo.FindItemByText(quantity).Checked = true;
}
}
}
}
protected void RadGrid1_PreRender(object sender, System.EventArgs e)
{
if (isFiltered)
{
string[] expressions = RadGrid1.MasterTableView.FilterExpression.Split(new string[] { "AND" }, StringSplitOptions.None);
List<
string
> columnExpressions = new List<
string
>(expressions);
foreach (string expression in columnExpressions)
{
if (expression.Contains("[\"Quantity\"]"))
{
columnExpressions.Remove(expression);
break;
}
}
string finalExpression = string.Join("AND", columnExpressions.ToArray());
string quantityFilterValue = (string)ViewState["QuantityFilterValue"];
if (!string.IsNullOrEmpty(quantityFilterValue))
{
if (!string.IsNullOrEmpty(finalExpression))
{
finalExpression += " AND ";
}
finalExpression += quantityFilterValue;
}
RadGrid1.MasterTableView.FilterExpression = finalExpression;
RadGrid1.MasterTableView.Rebind();
}
}
}
I added a new column, "Quantity", which will be filtered using multi
checkbox filtering. This is our focus which is not working.. This column
is populated inside the GetGridSource(). Filter values are binded to
the RadComboBox using RadComboBoxQuantity_DataBinding event, setting it
to the same data source of the RadGrid. (I know I should bind distinct
values here, but just for the purpose of an example I haven't updated
the code yet.)
Selecting several items from the combobox and clicking ImageButton1, multi checkbox filtering does not work..
Note: I put Filter="Contains" in the RadComboBox property as I read
somewhere here and in the documentation that this will enable the
textfield in the combo box so the user can type, which I also need.
I am currently stuck using Telerik.Web.UI, Version=2012.3.1308.35.
Would anyone know why the multi checkbox filtering does not work?
Any help is appreciated.. Thank you in advance.
I have been trying to implement a RadGrid with batch edit mode enabled. It is essentially just a grid that makes calls to entity framework to update data in a SQL database. It works fine sometimes, but, usually after I've saved changes a few times, all AJAX calls stop working on the page. I have been trying a lot of different ways of reproducing the bug consistently, but I can't figure out how. I usually just add a few records, and edit a few records, save, then repeat the process several times until eventually it stops working. When I press the button in this state, it will flash the loading symbol for a fraction of a second, but nothing else happens. Normally, the loading symbol shows for a second or two, then the grid and database update. The OnUpdateCommand, OnInsertCommand, and any other commands do not fire when in the erroneous state, and other controls on the page that use AJAX don't work anymore. I can't seem to find any code behind method that gets called upon attempting to call them. The pertinent (I think) code is in the page XAML file GateProduct.aspx, the control XAML file Checklist.ascx that contains the RadGrid, and the codebehind for the control Checklist.ascx.cs.
GateProduct.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="GateProduct.aspx.cs" Inherits="GatesWebForm.Pages.GateProduct" %>
<%@ Register Src="~/Controls/Checklist.ascx" TagName="ChecklistPanel" TagPrefix="custom" %>
<%@ Register Src="~/Controls/Projects.ascx" TagName="ProjectsPanel" TagPrefix="custom" %>
<%@ Register Src="~/Controls/Documents.ascx" TagName="DocumentsPanel" TagPrefix="custom" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="Styles/mail.css" rel="stylesheet" />
<style type="text/css">
html .RadGrid .rgMasterTable {
height: auto;
}
.subject {
position: relative;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FolderContent" runat="server">
<div style="padding: 5px 5px 5px 5px">
<asp:Panel runat="server" ID="InfoPanel" BackColor="LightBlue" BorderColor="Black" BorderWidth="2px">
<asp:Label Text="Product: " runat="server" />
<asp:Label ID="ProductName" runat="server" Font-Bold="True" /><br />
<asp:Label runat="server" Text="Version:" />
<asp:Label runat="server" ID="VersionText" Font-Bold="True" /><br />
<asp:Label Text="Gate: " runat="server" />
<asp:Label ID="GateId" runat="server" Font-Bold="True" /><br />
</asp:Panel>
<asp:HyperLink runat="server" Text="Back To Products" ID="ProductsHyperLink" CssClass="hyperLink"></asp:HyperLink>
</div>
<div style="padding: 5px 5px 5px 5px">
<asp:Button runat="server" ID="DuplicateGateButton" Text="Duplicate this gate"
OnClick="DuplicateGateButton_OnClick" />
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<telerik:RadTabStrip runat="server" RenderMode="Lightweight" ID="TabStrip" MultiPageID="MultiPage" SelectIndex="0">
<Tabs>
<telerik:RadTab runat="server" Text="Checklist" />
<telerik:RadTab runat="server" Text="Projects" />
<telerik:RadTab runat="server" Text="Documents" />
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage runat="server" ID="MultiPage" SelectedIndex="0">
<telerik:RadPageView runat="server" ID="ChecklistPage">
<custom:ChecklistPanel runat="server" ID="ChecklistPanel" />
</telerik:RadPageView>
<telerik:RadPageView runat="server" ID="ProjectsPage">
<custom:ProjectsPanel runat="server" ID="ProjectsPanel" />
</telerik:RadPageView>
<telerik:RadPageView runat="server" ID="DocumentsPage">
<custom:DocumentsPanel runat="server" ID="DocumentsPanel" />
</telerik:RadPageView>
</telerik:RadMultiPage>
<telerik:RadWindowManager runat="server" ID="RadWindowManager">
</telerik:RadWindowManager>
<script type="text/javascript">
function gatePromptCallBack(newGateId) {
if (newGateId !== null) {
var id = parseInt(getParamValues('id'));
var gateId = newGateId.toLowerCase();
PageMethods.DuplicateGateProduct(id, gateId);
}
}
function getParamValues(key) {
var query = window.location.search.substring(1);
var params = query.split('&');
for (var i = 0; i < params.length; i++) {
var pos = query.indexOf('=');
var k = params[i].substring(0, pos);
var v = params[i].substring(pos + 1);
if (key === k) return v;
}
return null;
}
</script>
<telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel"></telerik:RadAjaxLoadingPanel>
<asp:SqlDataSource runat="server" ID="GatesDataSource" ProviderName="System.Data.SqlClient"
ConnectionString="<%$ ConnectionStrings:GatesConnectionString %>"
SelectCommand="SELECT * FROM Gates ORDER BY Name" />
</asp:Content>
------
This is the control Checklist.ascx that has the RadGrid:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Checklist.ascx.cs" Inherits="GatesWebForm.Controls.Checklist" %>
<%@ Register Src="~/Controls/StatusMessage.ascx" TagName="StatusMessage" TagPrefix="custom" %>
<input id="ClientAreUnsavedChanges" type="hidden" runat="server"/>
<telerik:RadAjaxManagerProxy runat="server" ID="RadAjaxManager">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="ChecklistGrid" EventName="">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ChecklistPanel" LoadingPanelID="LoadingPanel"/>
<telerik:AjaxUpdatedControl ControlID="StatusMessage"/>
<telerik:AjaxUpdatedControl ControlID="UnsavedChangesScript"/>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="NoChecklistPanel">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ChecklistPanel" LoadingPanelID="LoadingPanel"/>
<telerik:AjaxUpdatedControl ControlID="NoChecklistPanel" LoadingPanelID="LoadingPanel"/>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="CreateEmptyChecklistButton">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ChecklistPanel" LoadingPanelID="LoadingPanel"/>
<telerik:AjaxUpdatedControl ControlID="NoChecklistPanel" LoadingPanelID="LoadingPanel"/>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="CreateDefaultChecklistButton">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ChecklistPanel" LoadingPanelID="LoadingPanel"/>
<telerik:AjaxUpdatedControl ControlID="NoChecklistPanel" LoadingPanelID="LoadingPanel"/>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="DeleteSelectedButton">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ChecklistPanel" LoadingPanelID="LoadingPanel"/>
<telerik:AjaxUpdatedControl ControlID="StatusMessage"/>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="DeleteChecklistButton">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ChecklistPanel" LoadingPanelID="LoadingPanel"/>
<telerik:AjaxUpdatedControl ControlID="NoChecklistPanel"/>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<telerik:RadScriptBlock runat="server" ID="UnsavedChangesScript">
<script type="text/javascript">
function batchEditCellValueChanged() {
window.onbeforeunload = function () {
return true;
}
}
function serverDataBound() {
window.onbeforeunload = null;
}
</script>
</telerik:RadScriptBlock>
<h1>Checklist</h1>
<asp:Panel runat="server" ID="ChecklistPanel">
<telerik:RadGrid ID="ChecklistGrid" runat="server" AllowPaging="true" DataSourceID="ChecklistItemsDataSource"
GridLines="None" Width="95%" AutoGenerateColumns="false" OnUpdateCommand="ChecklistGrid_UpdateCommand"
OnDeleteCommand="ChecklistGrid_OnDeleteCommand" OnInsertCommand="ChecklistGrid_OnInsertCommand"
AllowMultiRowSelection="True" AllowSorting="True" OnDataBound="ChecklistGrid_OnDataBound"
OnItemCommand="ChecklistGrid_OnItemCommand" OnCallingDataMethods="ChecklistGrid_OnCallingDataMethods">
<MasterTableView DataKeyNames="ChecklistItemId" CommandItemDisplay="Top" EditMode="Batch">
<BatchEditingSettings OpenEditingEvent="Click"></BatchEditingSettings>
<CommandItemSettings ShowSaveChangesButton="True"></CommandItemSettings>
<Columns>
<telerik:GridTemplateColumn DataField="Question" HeaderText="Question"
SortExpression="Question" Resizable="True" UniqueName="Question">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "Question") %>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" Text='<%# Bind("Question") %>' TextMode="MultiLine" ID="QuestionTextBox"/>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Comment" HeaderText="Comment"
SortExpression="Comment" Resizable="True">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "Comment") %>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" Text='<%# Bind("Comment") %>' TextMode="MultiLine" ID="CommentTextBox"/>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridDateTimeColumn DataField="DateAnswered" HeaderText="Date Answered"
DataFormatString="{0:d}" PickerType="DatePicker"
ConvertEmptyStringToNull="True" ReadOnly="True"
Resizable="True"/>
</Columns>
</MasterTableView>
<ClientSettings EnableAlternatingItems="False">
<Selecting AllowRowSelect="True" EnableDragToSelectRows="True"/>
<Resizing AllowColumnResize="True" AllowRowResize="True"/>
<ClientEvents OnBatchEditCellValueChanged="batchEditCellValueChanged"/>
</ClientSettings>
</telerik:RadGrid>
<asp:Button runat="server" ID="DeleteSelectedButton" Text="Delete selected items"
OnClick="DeleteSelectedButton_OnClick"
OnClientClick="javascript:if (!confirm('Delete all selected?')) return false;"/>
<asp:Button runat="server" ID="DeleteChecklistButton" Text="Delete entire checklist"
OnClick="DeleteChecklistButton_OnClick"
OnClientClick="javascript:if (!confirm('Delete entire checklist?')) return false;"/>
</asp:Panel>
<asp:Panel runat="server" ID="NoChecklistPanel">
<asp:Label runat="server" Text="No checklist found."/>
<br/>
<asp:Button runat="server" ID="CreateEmptyChecklistButton" Text="Create Empty Checklist"
OnClick="CreateEmptyChecklistButton_OnClick"/>
<asp:Button runat="server" ID="CreateDefaultChecklistButton" Text="Create Default Checklist"
OnClick="CreateDefaultChecklistButton_OnClick"/>
</asp:Panel>
<custom:StatusMessage runat="server" ID="StatusMessage" TargetControlId="ChecklistGrid"/>
<asp:SqlDataSource ID="ChecklistItemsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:GatesConnectionString %>"
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT ChecklistItems.*, Answer,
QuestionTypes.Name AS QuestionTypeName,
People.Name AS PersonName,
People.Username AS PersonUsername,
Departments.Name AS DepartmentName
FROM ChecklistItems
LEFT JOIN ChecklistAnswers
ON Answer_AnswerId = AnswerId
LEFT JOIN QuestionTypes
ON Type_QuestionTypeId = QuestionTypeId
LEFT JOIN People
ON PersonId = AssignedTo_PersonId
LEFT JOIN Departments
ON Department_DepartmentId = DepartmentId
WHERE Checklist_ChecklistId = @GateProductId">
<SelectParameters>
<asp:QueryStringParameter Name="GateProductId" QueryStringField="id"/>
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="AnswersDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:GatesConnectionString %>"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM ChecklistAnswers ORDER BY Answer"/>
<asp:SqlDataSource runat="server" ID="PeopleDataSource"
ConnectionString="<%$ ConnectionStrings:GatesConnectionString %>"
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT NULL AS PersonId, NULL AS Name
UNION
SELECT PersonId, Name FROM People
ORDER BY Name"/>
<asp:ObjectDataSource runat="server" ID="EmployeeDataSource" SelectMethod="GetActiveDirectoryUsers"
TypeName="GatesWebForm.Authenticator">
</asp:ObjectDataSource>
<asp:SqlDataSource runat="server" ID="QuestionTypesDataSource" ConnectionString="<%$ ConnectionStrings:GatesConnectionString %>"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT NULL AS QuestionTypeId, NULL AS Name UNION SELECT QuestionTypeId, Name FROM QuestionTypes ORDER BY Name"/>
<asp:SqlDataSource runat="server" ID="DepartmentsDataSource" ConnectionString="<%$ ConnectionStrings:GatesConnectionString %>"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT NULL AS DepartmentId, NULL AS Name UNION SELECT DepartmentId, Name FROM Departments ORDER BY Name"/>
----------
This is the code behind Checklist.ascx.cs:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web.UI;
using System.Web.UI.WebControls;
using GatesDataEntry;
using GatesDataEntry.GateModels;
using GatesWebForm.Services;
using Microsoft.TeamFoundation.Common;
using Telerik.Web.UI;
namespace GatesWebForm.Controls
{
public partial class Checklist : UserControl
{
private readonly GateContext mContext = new GateContext();
private readonly Authenticator mAuthenticator = new Authenticator();
private RadWindowManager mWindowManager;
private ChecklistDataService mChecklistDataService;
public bool AreUnsavedChanges
{
get => bool.Parse(ClientAreUnsavedChanges.Value);
}
protected void Page_Load(object sender, EventArgs e)
{
var id = int.Parse(Request.QueryString["id"], CultureInfo.InvariantCulture);
if (mContext.Checklists.Any(c => c.ChecklistId == id))
{
ChecklistPanel.Visible = true;
NoChecklistPanel.Visible = false;
}
else
{
ChecklistPanel.Visible = false;
NoChecklistPanel.Visible = true;
}
mChecklistDataService = new ChecklistDataService(id, mContext);
mWindowManager = Parent.FindControl("RadWindowManager") as RadWindowManager;
}
protected void ChecklistGrid_UpdateCommand(object sender, GridCommandEventArgs e)
{
if (!mAuthenticator.IsEditor())
{
mWindowManager.RadAlert("You do not have editor permissions.", 400, 100, "Need Permissions", null);
return;
}
if (e.CommandArgument is GridBatchEditingEventArgument)
try
{
UpdateItem(e);
}
catch (Exception ex)
{
e.Canceled = true;
}
}
private void UpdateItem(GridCommandEventArgs e)
{
if (!(e.CommandArgument is GridBatchEditingEventArgument)) return;
var editedItem = e.Item as GridEditableItem;
var commandArgument = (GridBatchEditingEventArgument) e.CommandArgument;
var newValues = commandArgument.NewValues;
var tableView = commandArgument.OwnerTableView;
tableView.ExtractValuesFromItem(newValues, editedItem);
var id = (int) editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["ChecklistItemId"];
var question = (string) newValues["Question"];
var comment = (string) newValues["Comment"];
var answer = mContext.ChecklistAnswers.Single(a => a.Answer == "Done");
mChecklistDataService.UpdateChecklistItem(id, question, answer, comment, null, null, null);
}
protected void ChecklistGrid_OnDeleteCommand(object sender, GridCommandEventArgs e)
{
if (!mAuthenticator.IsEditor())
{
mWindowManager.RadAlert("You do not have editor permissions.", 400, 100, "Need Permissions", null);
return;
}
try
{
var id = (int) e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ChecklistItemId"];
mChecklistDataService.DeleteChecklistItem(id);
}
catch (Exception)
{
e.Canceled = true;
}
ChecklistGrid.Rebind();
}
protected void ChecklistGrid_OnInsertCommand(object sender, GridCommandEventArgs e)
{
if (!mAuthenticator.IsEditor())
{
mWindowManager.RadAlert("You do not have editor permissions.", 400, 100, "Need Permissions", null);
return;
}
try
{
var commandArgument = e.CommandArgument as GridBatchEditingEventArgument;
var inputValues = commandArgument.NewValues;
var question = (string) inputValues["Question"];
var comment = (string) inputValues["Comment"];
var answer = mContext.ChecklistAnswers.Single(a => a.Answer == "not done");
mChecklistDataService.InsertChecklistItem(question, answer, comment, null, null, null);
StatusMessage.DisplayMessage(false, "Successfully inserted checklist item.");
}
catch (Exception ex)
{
e.Canceled = true;
}
}
protected void CreateEmptyChecklistButton_OnClick(object sender, EventArgs e)
{
if (!mAuthenticator.IsEditor())
{
mWindowManager.RadAlert("You do not have editor permissions.", 400, 100, "Need Permissions", null);
return;
}
mChecklistDataService.CreateEmptyChecklist();
ChecklistGrid.Rebind();
NoChecklistPanel.Visible = false;
ChecklistPanel.Visible = true;
}
protected void CreateDefaultChecklistButton_OnClick(object sender, EventArgs e)
{
if (!mAuthenticator.IsEditor())
{
mWindowManager.RadAlert("You do not have editor permissions.", 400, 100, "Need Permissions", null);
return;
}
mChecklistDataService.CreateDefaultChecklist();
ChecklistGrid.Rebind();
NoChecklistPanel.Visible = false;
ChecklistPanel.Visible = true;
}
protected void DeleteSelectedButton_OnClick(object sender, EventArgs e)
{
if (!mAuthenticator.IsEditor())
{
mWindowManager.RadAlert("You do not have editor permissions.", 400, 100, "Need Permissions", null);
return;
}
try
{
if (ChecklistGrid.SelectedIndexes.Count == 0)
return;
var ids = (from GridDataItem item in ChecklistGrid.SelectedItems
select (int) item.OwnerTableView.DataKeyValues[item.ItemIndex]["ChecklistItemId"]).ToList();
mChecklistDataService.DeleteChecklistItemsRange(ids);
StatusMessage.DisplayMessage(false, "Successfully deleted checklist items.");
}
catch (Exception ex)
{
StatusMessage.DisplayMessage(true, "Failed to delete checklist items.");
}
ChecklistGrid.Rebind();
}
protected void DeleteChecklistButton_OnClick(object sender, EventArgs e)
{
mChecklistDataService.DeleteChecklist();
ChecklistPanel.Visible = false;
NoChecklistPanel.Visible = true;
}
protected void ChecklistGrid_OnDataBound(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "setUnsavedChangesFalse", "serverDataBound();", true);
}
protected void ChecklistGrid_OnItemCommand(object sender, GridCommandEventArgs e)
{
}
protected void ChecklistGrid_OnCallingDataMethods(object sender, CallingDataMethodsEventArgs e)
{
throw new NotImplementedException();
}
}
}
We have 2 tabstrips on one page. One is used as the overall tabstrip and the other as steps through a form submission. We're using the lightweight rendermode and are modifying the styles on the steps tabstrip using css. We'd like to remove the bottom border on the steps tabscrip but not on the primary. When we use:
html .rtsTop .rtsLevel1 {
border-bottom: 0;
}
It removes it from both. If we try to just add the border-bottom attribute to the assigned class for the steps tabstrip it doesn't seem to work. Is there a good way to do this?
Also, is there a documentation page available that shows the CSS options in the lightweight rendermode for TabStrip. We couldn't seem to find it.
thanks