Hi, I'm working with a radmenu that has only one root item. The behavior I want is for a user to be able to click on the menu item, get a dropdown with login controls, and use those to log into the site I'm working on. I already set ClickToOpen="true", and I'm using a ContentTemplate for the textboxes, button, and so forth. I've tested my setup in Chrome, IE, and Safari on desktop browsers, and it works exactly the way I want. The problem occurs on mobile browsers (tested on Safari and Chrome for iOS 8, and Chrome for Android). When I go to my site on a smartphone, for example, and tap on a textbox to start entering login credentials, the whole menu closes. When I tested in Chrome on iOS 8, I noticed that the onscreen keys would pop up for a split second, and then go away along with the menu. This makes it impossible to use the login controls on a mobile device.
The client I'm working with insists that the site be mobile-friendly, so I need to figure this out, and would like to be able to use the radmenu control, though I'm open to other options that will achieve the functionality I need.
Here's my markup for the controls (sorry the formatting isn't great):
01.
<
div
class
=
"login-box"
>
02.
<
telerik:RadMenu
ID
=
"rm1"
runat
=
"server"
CssClass
=
"RadMenu"
ClickToOpen
=
"true"
OnClientItemOpened
=
"ExternalitemOpened"
RenderMode
=
"Classic"
>
03.
<
Items
>
04.
<
telerik:RadMenuItem
runat
=
"server"
PostBack
=
"false"
>
05.
<
ContentTemplate
>
06.
<
div
id
=
"loginDropDown"
>
07.
<
h2
>Log In </
h2
>
08.
<
span
class
=
"failureNotification"
>
09.
<
asp:Literal
ID
=
"FailureText"
runat
=
"server"
></
asp:Literal
>
10.
</
span
>
11.
<
asp:ValidationSummary
ID
=
"vdsumLogin"
runat
=
"server"
CssClass
=
"failureNotification"
ValidationGroup
=
"vdgrpLogin"
/>
12.
<
div
>
13.
<
fieldset
>
14.
<
legend
>Account Information</
legend
>
15.
<
p
>
16.
<
asp:Label
ID
=
"lblUsername"
runat
=
"server"
AssociatedControlID
=
"txtUserN"
>Username:</
asp:Label
>
17.
<
asp:TextBox
ID
=
"txtUserN"
runat
=
"server"
CssClass
=
"textEntry"
></
asp:TextBox
>
18.
<
asp:RequiredFieldValidator
ID
=
"rfvUserName"
runat
=
"server"
ControlToValidate
=
"txtUserN"
CssClass
=
"failureNotification"
ErrorMessage
=
"Please enter a username"
ToolTip
=
"Required field"
ValidationGroup
=
"vdgrpLogin"
>* Required</
asp:RequiredFieldValidator
>
19.
</
p
>
20.
<
p
>
21.
<
asp:Label
ID
=
"lblPassword"
runat
=
"server"
AssociatedControlID
=
"txtPassword"
>Password:</
asp:Label
>
22.
<
asp:TextBox
ID
=
"txtPassword"
runat
=
"server"
CssClass
=
"passwordEntry"
TextMode
=
"Password"
></
asp:TextBox
>
23.
<
asp:RequiredFieldValidator
ID
=
"rfvPassword"
runat
=
"server"
ControlToValidate
=
"txtPassword"
CssClass
=
"failureNotification"
ErrorMessage
=
"Please enter a password"
ToolTip
=
"Required field"
ValidationGroup
=
"vdgrpLogin"
>* Required</
asp:RequiredFieldValidator
>
24.
</
p
>
25.
</
fieldset
>
26.
<
p
class
=
"submitButton"
>
27.
<
asp:Button
ID
=
"btnLogin"
runat
=
"server"
CommandName
=
"Login"
Text
=
"Log In"
ValidationGroup
=
"vdgrpLogin"
CssClass
=
"normalButton"
OnClick
=
"btnLogin_Click"
/>
28.
</
p
>
29.
</
div
>
30.
<
a
href
=
"../Register"
>register</
a
><
br
/>
31.
<
a
href
=
"../Account/ForgotPassword.aspx"
>forgot password?</
a
><
br
/>
32.
<
a
href
=
"../Account/RetrieveUsername.aspx"
>forgot username?</
a
>
33.
</
div
>
34.
</
ContentTemplate
>
35.
</
telerik:RadMenuItem
>
36.
</
Items
>
37.
</
telerik:RadMenu
>
38.
</
div
>
Here's the script I'm using:
function
ExternalitemOpened(s, e) {
if
($telerik.isIE8) {
// Fix an IE 8 bug that causes the list bullets to disappear (standards mode only)
$telerik.$(
"li"
, e.get_item().get_element())
.each(
function
() {
this
.style.cssText =
this
.style.cssText; });
}
}
​
I'm also setting the text of the root item from code-behind. It tells the user they can click the menu to login or logout, depending on context. If they're currently logged in, then clicking the menu will fire an event handler that will log them out. Selections from that code:
rm1.Items(0).Text =
"(logout)"
AddHandler
rm1.ItemClick,
AddressOf
rm1_ItemClick1
rm1.Items(0).Text =
"(committee login)"
Protected
Sub
rm1_ItemClick1(sender
As
Object
, e
As
Telerik.Web.UI.RadMenuEventArgs)
Response.Redirect(
"~/Account/Logout.aspx"
)
End
Sub
Also, the CSS from the markup:
.login-box{
width
:
1024px
;
height
:
50px
;
margin
:
0
auto
;
margin-top
:
8px
;
margin-bottom
:
8px
;
padding
:
0
;
background-color
:
#E6E6E6
;
text-align
:
left
;
}
.login-box h
1
{
font-size
:
1em
;
font-weight
:
normal
;
letter-spacing
:
1px
;
margin
:
0px
0px
0px
20px
;
text-align
:
left
;
padding-top
:
15px
;
display
:inline-
block
;
}
.login-box a:hover{
color
:
#4AB97B
;
}
.RadMenu .rmRootGroup{
border
:
none
!important
;
}
.RadMenu .rmText{
background-color
:
#E6E6E6
!important
;
font-size
:
1em
!important
;
font-weight
:
normal
!important
;
letter-spacing
:
1px
!important
;
margin
:
0px
0px
0px
20px
!important
;
text-align
:
left
!important
;
padding-top
:
12px
!important
;
}
.RadMenu .rmText:hover{
color
:
#4AB97B
!important
;
}
.RadMenu a.rmSelected{
background-color
:
#E6E6E6
!important
;
}
.RadMenu .rmLink{
padding
:
0
0
0
0px
!important
;
}
.RadMenu .rmPopup.rmContentTemplate{
background-color
:
#E6E6E6
!important
;
}
.RadMenu_Default .rmFirst a.rmLink, .RadMenu_Default .rmFirst a.rmLink:hover, .RadMenu_Default .rmLast .rmText,
.RadMenu_Default .rmLast a.rmLink:hover .rmText, .RadMenu_Default .rmVertical a.rmLink, .RadMenu_Default .rmVertical .rmText{
background-color
:
#E6E6E6
!important
;
font-size
:
medium
!important
;
}
.failureNotification
{
font-size
:
1.2em
;
color
: Red;
}
input.passwordEntry
{
border
:
1px
solid
#ccc
;
}
.submitButton
{
text-align
:
right
;
padding-right
:
10px
;
}
.normalButton
{
color
:
#FFFFFF
;
border-radius:
30px
;
background-color
:
#579767
;
border
:
2px
solid
#000000
;
width
:
150px
;
height
:
30px
;
font-family
:
Arial
,
Helvetica
,
sans-serif
;
font-size
:
large
;
}
.normalButton:disabled
{
color
:
#686868
;
border-radius:
30px
;
background-color
:
#969696
;
border
:
2px
solid
#D1D1D1
;
width
:
150px
;
height
:
30px
;
font-family
:
Arial
,
Helvetica
,
sans-serif
;
font-style
:
italic
;
font-size
:
large
;
}
And the mobile CSS (where applicable):
@media only
screen
and (
max-width
:
768px
) {
.login-box{
width
:
100%
;
height
:
50px
;
margin
:
0
auto
;
margin-top
:
8px
;
margin-bottom
:
8px
;
padding
:
0
;
background-color
:
#E6E6E6
;
text-align
:
left
;
}
.login-box h
1
{
font-size
:
1em
;
font-weight
:
normal
;
letter-spacing
:
1px
;
margin
:
0px
0px
0px
10px
;
text-align
:
left
;
padding-top
:
15px
;
}
.normalButton
{
color
:
#FFFFFF
;
border-radius:
30px
;
background-color
:
#579767
;
border
:
2px
solid
#000000
;
width
:
150px
;
height
:
30px
;
font-family
:
Arial
,
Helvetica
,
sans-serif
;
font-size
:
medium
;
}
.normalButton:disabled
{
color
:
#686868
;
border-radius:
30px
;
background-color
:
#969696
;
border
:
2px
solid
#D1D1D1
;
width
:
150px
;
height
:
30px
;
font-family
:
Arial
,
Helvetica
,
sans-serif
;
font-style
:
italic
;
font-size
:
medium
;
}
}
I have spent several hours playing with the markup and searching online for other instances of this issue, with no fix. I looked into using RenderMode="auto" or RenderMode="mobile", but neither worked the way I needed. I am using version 2015.2.623.40 of the web controls.
Please help me get this working on mobile browsers.
//ASP.net
<
telerik:RadTimePicker
runat
=
"server"
ID
=
"rtpStopTime"
Width
=
"80px"
ValidationGroup
=
"GridChanges"
OnLoad
=
"rtpStopTime_DataBinding"
ClientEvents-OnDateSelected
=
"MCRPostShiftStopTimePickerOnTimeSelect"
>
<
DateInput
ID
=
"DateInput2"
runat
=
"server"
AutoCompleteType
=
"None"
TabIndex
=
"3"
></
DateInput
>
<
TimeView
ID
=
"TimeView2"
runat
=
"server"
Interval
=
"15"
Columns
=
"8"
AlternatingTimeStyle-BackColor
=
"#F6F6F9"
></
TimeView
>
</
telerik:RadTimePicker
>
//C#:
protected
void
rtpStartTime_DataBinding(
object
sender, EventArgs e)
{
RadTimePicker TimeBox = (RadTimePicker)sender;
TimeBox.TimeView.CustomTimeValues = StartTimeArray; //6:00 - 23:45 Date = '2015/01/01' ; 0:00 - 5:45 Date = '2015/01/02'
}
function
MCRPostShiftStartTimePickerOnTimeSelect(sender, eventArgs) {
//not sending the correct date from customvalues for values over midnight
//alert("Start Time " + eventArgs.get_newValue());
//alert("Start Date " + eventArgs.get_newDate());
//var date = eventArgs.get_renderDay().get_date();
//alert("Start Date " + date);
//var timepicker = sender;
//alert("timepicker " + timepicker);
//var selectedDate = timepicker.get_selectedDate().format("yyyy/MM/dd");
//var selectedTime = timepicker.get_selectedDate().format("HH:mm:ss")
//alert("Start: " + selectedDate + " " + selectedTime);
}
Hello,
I use the OnItemsRequested event to get the data from database:
Below are design code:
<telerik:RadComboBox ID="ddlItem" runat="server" Width="45%" ZIndex="50000" Height="400px"
DropDownWidth="500px" HighlightTemplatedItems="true" EmptyMessage="[ Search items by typing minimum 2 characters ]"
AllowCustomText="true" MarkFirstMatch="true" EnableLoadOnDemand="true" OnItemsRequested="ddlItem_OnItemsRequested"
Skin="Office2007" ShowMoreResultsBox="true" EnableVirtualScrolling="true" OnClientItemsRequesting="OnClientItemsRequesting"
CheckBoxes="true" >
<HeaderTemplate>
<table style="width: 100%" cellspacing="0" cellpadding="0">
<tr>
<td style="width: 10%" align="left">
<asp:Literal ID="Literal1" runat="server" Text="Group"></asp:Literal>
</td>
<td style="width: 60%" align="left">
<asp:Literal ID="Literal2" runat="server" Text="Item Name"></asp:Literal>
</td>
<td style="width: 15%" align="right">
Stock
</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table style="width: 100%" cellspacing="0" cellpadding="0">
<tr>
<td style="width: 10%" align="left">
<%# DataBinder.Eval(Container,"Attributes['ItemSubCategoryShortName']" )%>
</td>
<td style="width: 60%" align="left">
<%# DataBinder.Eval(Container, "Text")%>
</td>
<td style="width: 15%" align="right">
<%# DataBinder.Eval(Container, "Attributes['ClosingBalance']")%>
</td>
<td style="width: 10%; display: none;" align="right">
<%# DataBinder.Eval(Container, "Attributes['Percentage']")%>
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>​
And i use the following code in c#:
protected void ddlItem_OnItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
//write login code to get the data from database through ItemRequest event.
}
What I want is I use the checkbox to select multiple items or data from drop down and add all the checkboxs true to grid but when i use foreach loop then I can't get the checkbox true items.
Here is the code:
foreach (RadComboBoxItem ComboItem in ddlItem.CheckedItems)
{
if (ComboItem.Checked == true)
{
}
}
The above loop is not working when i try to get the checked true items.
Please help me as soon as possible.
I hope you understand my query.
Thanks
Jiten Mutum
multi-column RadComboBox via a web method.
ASPX
<
telerik:RadComboBox
runat
=
"server"
ID
=
"RadComboBox1"
Width
=
"200px"
MarkFirstMatch
=
"true"
EnableLoadOnDemand
=
"true"
HighlightTemplatedItems
=
"true"
DroDownCssClass
=
"exampleRadComboBox"
>
<
HeaderTemplate
>
<
tr
>
<
th
class
=
"col1"
>Category Name</
th
>
<%-- <
th
class
=
"col2"
>Some other column</
th
>--%>
</
tr
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
tr
>
<
td
class
=
"col1"
>
<%# DataBinder.Eval(Container.DataItem, "Category_Name") %></
td
>
<%-- <
td
class
=
"col2"
>
<%# DataBinder.Eval(Container.DataItem, "Some_Other_Col") %></
td
>--%>
</
tr
>
</
ItemTemplate
>
<
WebServiceSettings
Method
=
"GetCat"
Path
=
"Default.aspx"
/>
</
telerik:RadComboBox
>
Code Behind
[WebMethod]
public
static
RadComboBoxData GetCatType(RadComboBoxContext context)
{
var x =
"[{'CoachingSessionActivityCategoryID':0,'CoachingSessionActivityTypeID':1000005,'Category_Name':'Skills Conditioning','TeamID':0,'ClubID':1,'Type_Name':'Skills Con - Small Sided Games (Attack)'}]"
;
var data = JsonConvert.DeserializeObject<DataTable>(x);
RadComboBoxData comboData =
new
RadComboBoxData();
var itemOffset = context.NumberOfItems;
var endOffset = Math.Min(itemOffset + 10, data.Rows.Count);
comboData.EndOfItems = endOffset == data.Rows.Count;
List<RadComboBoxItemData> result =
new
List<RadComboBoxItemData>(endOffset - itemOffset);
for
(
int
i = itemOffset; i < endOffset; i++)
{
RadComboBoxItemData itemData =
new
RadComboBoxItemData();
itemData.Text = data.Rows[i][
"Category_Name"
].ToString();
itemData.Value = data.Rows[i][
"Category_Name"
].ToString();
result.Add(itemData);
}
comboData.Items = result.ToArray();
return
comboData;
}
The question is:
1) How do I bind the combobox to the web method?
2) How do I bind multiple columns to the combo box with the web method?
Hi,
We're working on an application which has a RadComboBox multiple tiers which can be clicked through.
Similar to https://www.filamentgroup.com/examples/menus/ipod.html#
Menu 1
Food
Drinks
-> Click Food
Menu 2 appears
Starters
Main
Dessert
-> Click Dessert
Menu 3 appears
Ice Cream
Meringue with Orange
All within the same ComboBox?
Is it possible in UI for ASP.NET AJAX to achieve a similar result out of the box?
Additionally one of the requirements is the ability to filter the items based on the path.
So if the user types "Orange" it will bring back results of Meringue with Orange from Food > Dessert menu and Orange Juice from Drinks > Squash menu?
I hope that I've made sense.
Hi,
I have a grid where the user will click a column and I want to handle that column-click server-side. I tried handling OnSelectedCellChanged (with EnablePostBackOnRowClick="true") but that only works when clicking cells, not columns headers. How can I achieve this?
Hello,
We are using Telerik Grid control and having performance issues with the PDF export.
The details:
I did some profiling from the C# webpart side and from the DB side too.
As you can see in the attachments there is only one SQL query which takes less than a second (381ms) to get the data.
1.
EventClass StartTime EndTime Duration (ms) TextData Reads Writes RowCounts
2.
Trace Start 2015-07-14 15:15:33.577
3.
SQL:BatchCompleted 2015-07-14 15:15:33.577 2015-07-14 15:15:33.957 381
SELECT
xx 1023 0 7632
4.
Trace Stop 2015-07-14 15:15:33.957
But the other attachment is about the hot path in the code and it clearly shows that the Grid's internal methods are working hard for 60 seconds (!) to produce the PDF.
These two methods are running 98% percent of the time.
I've created an excel file with MS Excel 2010 on my local machine with the same data and saved it as a PDF. It took less then 10 seconds to generate and save the file.
Is it possible to increase the export's performance and decrease the necessary time to ~15 seconds?
What can cause this long rendering time? Maybe the master-detail view?
Thanks for your tips in advance!
<
telerik:RadGrid
ID
=
"RadGrid_BoatGrid"
runat
=
"server"
Skin
=
"Metro"
OnNeedDataSource
=
"RadGrid_BoatGrid_OnNeedDataSource"
AllowPaging
=
"True"
OnDetailTableDataBind
=
"RadGrid_BoatGrid_OnDetailTableDataBind"
EnableLinqExpressions
=
"True"
>
<
ExportSettings
IgnorePaging
=
"True"
OpenInNewWindow
=
"True"
HideStructureColumns
=
"True"
>
<
Pdf
DefaultFontFamily
=
"Arial"
PageWidth
=
"297mm"
PageHeight
=
"210mm"
PageTitle
=
"Boats"
PaperSize
=
"A4"
></
Pdf
>
</
ExportSettings
>
<
MasterTableView
AutoGenerateColumns
=
"False"
NoMasterRecordsText
=
"There are no Boats."
AllowSorting
=
"True"
DataKeyNames
=
"Id"
>
<
DetailTables
>
<
telerik:GridTableView
runat
=
"server"
Name
=
"Actions"
DataKeyNames
=
"Id"
Width
=
"100%"
AutoGenerateColumns
=
"False"
NoDetailRecordsText
=
"There are no Actions associated with this Boat."
>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"ActionNumber"
HeaderText
=
"Number"
DataField
=
"Id"
>
<
ItemTemplate
>
................
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
..............
<
telerik:GridBoundColumn
HeaderText
=
"% Complete"
DataField
=
"PercentComplete"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
<
Columns
>
.......
<
telerik:GridBoundColumn
UniqueName
=
"Title"
HeaderText
=
"Title"
DataField
=
"Title"
SortExpression
=
"Title"
>
<
HeaderStyle
Width
=
"160px"
></
HeaderStyle
>
</
telerik:GridBoundColumn
>
.......
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Is is possible to set SearchBox Datasource only one time(when page is not postback)?
Because i have to populate 10,000 Names in SearchBox each time if my page get post back
here is my code
protected void Page_Load(object sender, EventArgs e)
{
radSearchEmployeeName.DataSource = GetEmployeeNameList();
radSearchEmployeeName.DataTextField = "LeadFullName";
radSearchEmployeeName.DataValueField = "LeadID";
radSearchEmployeeName.DataBind();
}
I am getting "DataSource not set" error for below code
if (!IsPostBack)
{
radSearchEmployeeName.DataSource = GetEmployeeNameList();
radSearchEmployeeName.DataTextField = "LeadFullName";
radSearchEmployeeName.DataValueField = "LeadID";
radSearchEmployeeName.DataBind();
}