Hi All,
I am using RadAjaxManager, RadPanelBar andRadGrid in my user control.
Issue:
1. Click on Webpart and click on "Add new record" in Grid from "FirstTabl" tab at first without clicking on any tab.
Add Mode and Edit Mode working fine as expected. Showing and populating
all control(RadEditor, RadPanel etc.) from the grid properly.
It works fine.
2. Click on Webpart and then click on any other tab, then click on click on "Add new record". from Grid
Add Mode and Edit Mode behaves weird. Data not getting populating properly.
Controls inside RadGrid and AjaxManager not initializing properly.
Error: 0x800a138f - JavaScript runtime error: Unable to get property '_preInitialize' of undefined or null reference
After follow the #1 step and then if you work with any Tab its working fine.
Can anyone please help me how resolve this issue ? Why this is happing with TAB and Grid with Ajaxmanager.
Thanks,
Harish Patil
I have following RadComboBox that triggers a javascript function which in turn enables a different RadComboBox
<
telerik:RadComboBox
ID
=
"ddlMode"
runat
=
"Server"
CssClass
=
"selectBox"
AutoPostBack
=
"false"
Width
=
"90"
Font-Size
=
"Small"
OnClientSelectedIndexChanged
=
"ddlMode_OnClientSelectedIndexChanged"
><
Items
><
telerik:RadComboBoxItem
Text
=
"New"
Value
=
"0"
Selected
=
"true"
/><
telerik:RadComboBoxItem
Text
=
"Edit"
Value
=
"1"
/>
</
Items
>
</
telerik:RadComboBox
>
Following is the Javascript called:
function
ddlMode_OnClientSelectedIndexChanged(sender, args) {
debugger;
var
category = $find(
"<%= ddlPRInfo_ItemCategory.ClientID %>"
);
category.enabled =
true
;
}
But it doesn't work.
Please guide on same..
Probably a very noob question:
Supposed I have a RadComboBox in the ItemTemplate of a RadDataForm.
The entity "Client" have a column called "genderID", which should be bound to the dataform.
Another entity "DefGender" should be bound to the combobox, with "genderID" as the DataValueField, "genderText" as the DataTextField, and I want to somehow bind the SelectedValue to Client.genderID
How would you do this pragmatically? It was pretty straight forward in Silverlight, but I couldn't figure this out in ASP.
Thanks.
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.