+ RadComboBox1.ClearSelection()
+
+
+ RadComboBox1.ClearSelection();
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ RadPane pane1 = new RadPane();
+ RadSplitter1.Items.Add(pane1);
+
+ RadSplitbar splitBar1 = new RadSplitBar();
+ RadSplitter1.Items.Add(splitBar1);
+
+ RadPane pane2 = new RadPane();
+ RadSplitter1.Items.Add(pane2);
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ If Not Page.IsPostBack Then
+ Dim pane1 As RadPane = New RadPane()
+ RadSplitter1.Items.Add(pane1)
+
+ Dim splitBar1 As RadSplitbar = New RadSplitBar()
+ RadSplitter1.Items.Add(splitBar1)
+
+ Dim pane2 As RadPane = New RadPane()
+ RadSplitter1.Items.Add(pane2)
+
+ End If
+ End Sub
+
+
+ RadPane pane = new RadPane();
+
+ RadMenu1.Panes.Add(pane);
+
+
+ Dim pane As RadPane = New RadPane()
+
+ RadMenu1.Panes.Add(pane)
+
+
+ RadPane pane = RadSplitter1.GetPaneById("pane1");
+ if (pane != null)
+ {
+ RadSplitter1.Panes.Remove(pane);
+ }
+
+
+ Dim pane As RadPane = RadSplitter1.GetPaneById("pane1")
+ If Not pane Is Nothing Then
+ RadSplitter1.Panes.Remove(pane)
+ End If
+
+
+ private void Button1_Click(object sender, System.EventArgs e)
+ {
+ RadAjaxManager1.Redirect("support.aspx");
+ }
+
+
+ Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
+ RadAjaxManager1.Redirect("support.aspx")
+ End Sub 'Button1_Click
+
+
+ private void Button1_Click(object sender, System.EventArgs e)
+ {
+ if (!UserAccessAllowed(UserProfile))
+ {
+ RadAjaxManager1.Alert("You are not allowed to access this user control!");
+ }
+ else
+ {
+ LoadSecretControl();
+ }
+ }
+
+
+ Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
+ If Not UserAccessAllowed(UserProfile) Then
+ RadAjaxManager1.Alert("You are not allowed to access this user control!")
+ Else
+ LoadSecretControl()
+ End If
+ End Sub 'Button1_Click
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ // Create a generic AJAX Request when the button is clicked.
+ // "return false" to prevent postbacks
+ Button1.Attributes["onclick"] = RadAjaxPanel1.GetAjaxEventReference("argument...") + " return false;";
+ // Generic requests can be fired on both AJAX Manager and AJAX Panel
+ Button1.Attributes["onclick"] = RadAjaxManager1.GetAjaxEventReference("argument...") + " return false;";
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Page.Load
+ ' Create a generic AJAX Request When the button Is clicked.
+ ' "return false" To prevent postbacks
+ Button1.Attributes["onclick"] = RadAjaxPanel1.GetAjaxEventReference("argument...") & " return false;"
+ ' Generic requests can be fired On both AJAX Manager And AJAX Panel
+ Button1.Attributes["onclick"] = RadAjaxManager1.GetAjaxEventReference("argument...") & " return false;"
+ End Sub
+
+ + Note Both the SelectedDate property and the + SelectedDates collection are updated before the SelectionChanged + event is raised. You can override the date selection by using the + OnSelectionChanged event handler to manually set the + SelectedDate property. The SelectionChanged event does not get + raised when this property is programmatically set. ++
+ Note Both the SelectedDate property and the + SelectedDates collection are updated before the SelectionChanged + event is raised.You can override the dates selection by using the + OnSelectionChanged event handler to manually set the + SelectedDates collection. The SelectionChanged event is not + raised when this collection is programmatically set. ++
| Culture Name | +Culture Identifier | +Language-Country/Region | +
|---|---|---|
| "" (empty string) | +0x007F | +invariant culture | +
| af | +0x0036 | +Afrikaans | +
| af-ZA | +0x0436 | +Afrikaans - South Africa | +
| sq | +0x001C | +Albanian | +
| sq-AL | +0x041C | +Albanian - Albania | +
| ar | +0x0001 | +Arabic | +
| ar-DZ | +0x1401 | +Arabic - Algeria | +
| ar-BH | +0x3C01 | +Arabic - Bahrain | +
| ar-EG | +0x0C01 | +Arabic - Egypt | +
| ar-IQ | +0x0801 | +Arabic - Iraq | +
| ar-JO | +0x2C01 | +Arabic - Jordan | +
| ar-KW | +0x3401 | +Arabic - Kuwait | +
| ar-LB | +0x3001 | +Arabic - Lebanon | +
| ar-LY | +0x1001 | +Arabic - Libya | +
| ar-MA | +0x1801 | +Arabic - Morocco | +
| ar-OM | +0x2001 | +Arabic - Oman | +
| ar-QA | +0x4001 | +Arabic - Qatar | +
| ar-SA | +0x0401 | +Arabic - Saudi Arabia | +
| ar-SY | +0x2801 | +Arabic - Syria | +
| ar-TN | +0x1C01 | +Arabic - Tunisia | +
| ar-AE | +0x3801 | +Arabic - United Arab Emirates | +
| ar-YE | +0x2401 | +Arabic - Yemen | +
| hy | +0x002B | +Armenian | +
| hy-AM | +0x042B | +Armenian - Armenia | +
| az | +0x002C | +Azeri | +
| az-AZ-Cyrl | +0x082C | +Azeri (Cyrillic) - Azerbaijan | +
| az-AZ-Latn | +0x042C | +Azeri (Latin) - Azerbaijan | +
| eu | +0x002D | +Basque | +
| eu-ES | +0x042D | +Basque - Basque | +
| be | +0x0023 | +Belarusian | +
| be-BY | +0x0423 | +Belarusian - Belarus | +
| bg | +0x0002 | +Bulgarian | +
| bg-BG | +0x0402 | +Bulgarian - Bulgaria | +
| ca | +0x0003 | +Catalan | +
| ca-ES | +0x0403 | +Catalan - Catalan | +
| zh-HK | +0x0C04 | +Chinese - Hong Kong SAR | +
| zh-MO | +0x1404 | +Chinese - Macau SAR | +
| zh-CN | +0x0804 | +Chinese - China | +
| zh-CHS | +0x0004 | +Chinese (Simplified) | +
| zh-SG | +0x1004 | +Chinese - Singapore | +
| zh-TW | +0x0404 | +Chinese - Taiwan | +
| zh-CHT | +0x7C04 | +Chinese (Traditional) | +
| hr | +0x001A | +Croatian | +
| hr-HR | +0x041A | +Croatian - Croatia | +
| cs | +0x0005 | +Czech | +
| cs-CZ | +0x0405 | +Czech - Czech Republic | +
| da | +0x0006 | +Danish | +
| da-DK | +0x0406 | +Danish - Denmark | +
| div | +0x0065 | +Dhivehi | +
| div-MV | +0x0465 | +Dhivehi - Maldives | +
| nl | +0x0013 | +Dutch | +
| nl-BE | +0x0813 | +Dutch - Belgium | +
| nl-NL | +0x0413 | +Dutch - The Netherlands | +
| en | +0x0009 | +English | +
| en-AU | +0x0C09 | +English - Australia | +
| en-BZ | +0x2809 | +English - Belize | +
| en-CA | +0x1009 | +English - Canada | +
| en-CB | +0x2409 | +English - Caribbean | +
| en-IE | +0x1809 | +English - Ireland | +
| en-JM | +0x2009 | +English - Jamaica | +
| en-NZ | +0x1409 | +English - New Zealand | +
| en-PH | +0x3409 | +English - Philippines | +
| en-ZA | +0x1C09 | +English - South Africa | +
| en-TT | +0x2C09 | +English - Trinidad and Tobago | +
| en-GB | +0x0809 | +English - United Kingdom | +
| en-US | +0x0409 | +English - United States | +
| en-ZW | +0x3009 | +English - Zimbabwe | +
| et | +0x0025 | +Estonian | +
| et-EE | +0x0425 | +Estonian - Estonia | +
| fo | +0x0038 | +Faroese | +
| fo-FO | +0x0438 | +Faroese - Faroe Islands | +
| fa | +0x0029 | +Farsi | +
| fa-IR | +0x0429 | +Farsi - Iran | +
| fi | +0x000B | +Finnish | +
| fi-FI | +0x040B | +Finnish - Finland | +
| fr | +0x000C | +French | +
| fr-BE | +0x080C | +French - Belgium | +
| fr-CA | +0x0C0C | +French - Canada | +
| fr-FR | +0x040C | +French - France | +
| fr-LU | +0x140C | +French - Luxembourg | +
| fr-MC | +0x180C | +French - Monaco | +
| fr-CH | +0x100C | +French - Switzerland | +
| gl | +0x0056 | +Galician | +
| gl-ES | +0x0456 | +Galician - Galician | +
| ka | +0x0037 | +Georgian | +
| ka-GE | +0x0437 | +Georgian - Georgia | +
| de | +0x0007 | +German | +
| de-AT | +0x0C07 | +German - Austria | +
| de-DE | +0x0407 | +German - Germany | +
| de-LI | +0x1407 | +German - Liechtenstein | +
| de-LU | +0x1007 | +German - Luxembourg | +
| de-CH | +0x0807 | +German - Switzerland | +
| el | +0x0008 | +Greek | +
| el-GR | +0x0408 | +Greek - Greece | +
| gu | +0x0047 | +Gujarati | +
| gu-IN | +0x0447 | +Gujarati - India | +
| he | +0x000D | +Hebrew | +
| he-IL | +0x040D | +Hebrew - Israel | +
| hi | +0x0039 | +Hindi | +
| hi-IN | +0x0439 | +Hindi - India | +
| hu | +0x000E | +Hungarian | +
| hu-HU | +0x040E | +Hungarian - Hungary | +
| is | +0x000F | +Icelandic | +
| is-IS | +0x040F | +Icelandic - Iceland | +
| id | +0x0021 | +Indonesian | +
| id-ID | +0x0421 | +Indonesian - Indonesia | +
| it | +0x0010 | +Italian | +
| it-IT | +0x0410 | +Italian - Italy | +
| it-CH | +0x0810 | +Italian - Switzerland | +
| ja | +0x0011 | +Japanese | +
| ja-JP | +0x0411 | +Japanese - Japan | +
| kn | +0x004B | +Kannada | +
| kn-IN | +0x044B | +Kannada - India | +
| kk | +0x003F | +Kazakh | +
| kk-KZ | +0x043F | +Kazakh - Kazakhstan | +
| kok | +0x0057 | +Konkani | +
| kok-IN | +0x0457 | +Konkani - India | +
| ko | +0x0012 | +Korean | +
| ko-KR | +0x0412 | +Korean - Korea | +
| ky | +0x0040 | +Kyrgyz | +
| ky-KZ | +0x0440 | +Kyrgyz - Kazakhstan | +
| lv | +0x0026 | +Latvian | +
| lv-LV | +0x0426 | +Latvian - Latvia | +
| lt | +0x0027 | +Lithuanian | +
| lt-LT | +0x0427 | +Lithuanian - Lithuania | +
| mk | +0x002F | +Macedonian | +
| mk-MK | +0x042F | +Macedonian - FYROM | +
| ms | +0x003E | +Malay | +
| ms-BN | +0x083E | +Malay - Brunei | +
| ms-MY | +0x043E | +Malay - Malaysia | +
| mr | +0x004E | +Marathi | +
| mr-IN | +0x044E | +Marathi - India | +
| mn | +0x0050 | +Mongolian | +
| mn-MN | +0x0450 | +Mongolian - Mongolia | +
| no | +0x0014 | +Norwegian | +
| nb-NO | +0x0414 | +Norwegian (Bokmål) - Norway | +
| nn-NO | +0x0814 | +Norwegian (Nynorsk) - Norway | +
| pl | +0x0015 | +Polish | +
| pl-PL | +0x0415 | +Polish - Poland | +
| pt | +0x0016 | +Portuguese | +
| pt-BR | +0x0416 | +Portuguese - Brazil | +
| pt-PT | +0x0816 | +Portuguese - Portugal | +
| pa | +0x0046 | +Punjabi | +
| pa-IN | +0x0446 | +Punjabi - India | +
| ro | +0x0018 | +Romanian | +
| ro-RO | +0x0418 | +Romanian - Romania | +
| ru | +0x0019 | +Russian | +
| ru-RU | +0x0419 | +Russian - Russia | +
| sa | +0x004F | +Sanskrit | +
| sa-IN | +0x044F | +Sanskrit - India | +
| sr-SP-Cyrl | +0x0C1A | +Serbian (Cyrillic) - Serbia | +
| sr-SP-Latn | +0x081A | +Serbian (Latin) - Serbia | +
| sk | +0x001B | +Slovak | +
| sk-SK | +0x041B | +Slovak - Slovakia | +
| sl | +0x0024 | +Slovenian | +
| sl-SI | +0x0424 | +Slovenian - Slovenia | +
| es | +0x000A | +Spanish | +
| es-AR | +0x2C0A | +Spanish - Argentina | +
| es-BO | +0x400A | +Spanish - Bolivia | +
| es-CL | +0x340A | +Spanish - Chile | +
| es-CO | +0x240A | +Spanish - Colombia | +
| es-CR | +0x140A | +Spanish - Costa Rica | +
| es-DO | +0x1C0A | +Spanish - Dominican Republic | +
| es-EC | +0x300A | +Spanish - Ecuador | +
| es-SV | +0x440A | +Spanish - El Salvador | +
| es-GT | +0x100A | +Spanish - Guatemala | +
| es-HN | +0x480A | +Spanish - Honduras | +
| es-MX | +0x080A | +Spanish - Mexico | +
| es-NI | +0x4C0A | +Spanish - Nicaragua | +
| es-PA | +0x180A | +Spanish - Panama | +
| es-PY | +0x3C0A | +Spanish - Paraguay | +
| es-PE | +0x280A | +Spanish - Peru | +
| es-PR | +0x500A | +Spanish - Puerto Rico | +
| es-ES | +0x0C0A | +Spanish - Spain | +
| es-UY | +0x380A | +Spanish - Uruguay | +
| es-VE | +0x200A | +Spanish - Venezuela | +
| sw | +0x0041 | +Swahili | +
| sw-KE | +0x0441 | +Swahili - Kenya | +
| sv | +0x001D | +Swedish | +
| sv-FI | +0x081D | +Swedish - Finland | +
| sv-SE | +0x041D | +Swedish - Sweden | +
| syr | +0x005A | +Syriac | +
| syr-SY | +0x045A | +Syriac - Syria | +
| ta | +0x0049 | +Tamil | +
| ta-IN | +0x0449 | +Tamil - India | +
| tt | +0x0044 | +Tatar | +
| tt-RU | +0x0444 | +Tatar - Russia | +
| te | +0x004A | +Telugu | +
| te-IN | +0x044A | +Telugu - India | +
| th | +0x001E | +Thai | +
| th-TH | +0x041E | +Thai - Thailand | +
| tr | +0x001F | +Turkish | +
| tr-TR | +0x041F | +Turkish - Turkey | +
| uk | +0x0022 | +Ukrainian | +
| uk-UA | +0x0422 | +Ukrainian - Ukraine | +
| ur | +0x0020 | +Urdu | +
| ur-PK | +0x0420 | +Urdu - Pakistan | +
| uz | +0x0043 | +Uzbek | +
| uz-UZ-Cyrl | +0x0843 | +Uzbek (Cyrillic) - Uzbekistan | +
| uz-UZ-Latn | +0x0443 | +Uzbek (Latin) - Uzbekistan | +
| vi | +0x002A | +Vietnamese | +
| vi-VN | +0x042A | +Vietnamese - Vietnam | +
+ CAUTION This control can be used to display user input, which + might include malicious client script. Check any information that is sent from + a client for executable script, SQL statements, or other code before displaying + it in your application. ASP.NET provides an input request validation feature to + block script and HTML in user input. Validation server controls are also + provided to assess user input. For more information, see Validation + Server Controls in MSDN. ++
+ CAUTION This control can be used to display user input, which + might include malicious client script. Check any information that is sent from + a client for executable script, SQL statements, or other code before displaying + it in your application. ASP.NET provides an input request validation feature to + block script and HTML in user input. Validation server controls are also + provided to assess user input. For more information, see Validation + Server Controls in MSDN. ++







+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ RadDateInput dateInput = new RadDateInput();
+ dateInput.ID = "dateInput";
+ dateInput.Format = "d"; //Short date format
+ dateInput.Culture = new CultureInfo("en-US");
+ dateInput.SelectedDate = DateTime.Now;
+
+ DateInputPlaceholder.Controls.Add(dateInput);
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ Dim dateInput As New RadDateInput()
+ dateInput.ID = "dateInput"
+ dateInput.Format = "d" 'Short Date Format
+ dateInput.Culture = New CultureInfo("en-US")
+ dateInput.SelectedDate = DateTime.Now
+
+ DateInputPlaceholder.Controls.Add(dateInput)
+ End Sub
+
+ + </%@ Page Language="C#" AutoEventWireup="True" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
+ <head>
+ <title>RadTextBox Example </title>
+
<script runat="server">
+
+
protected void RadTextBox1_TextChanged(object sender, EventArgs e)
+ {
this.RadTextBox1.Label = this.RadTextBox1.Text;
}
</script>
+
</head>
<body>
<form id="form1" runat="server">
<h3>
+ RadTextBox Example
</h3>
+ <radI:RadTextBox ID="RadTextBox1" AutoPostBack="true" EmptyMessage="Type Here" Label="Default Label: " runat="server" OnTextChanged="RadTextBox1_TextChanged">
+ </radI:RadTextBox>
+
</form>
</body>
</html> +
+ </%@ Page Language="C#" AutoEventWireup="True" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>RadTextBox Example </title>
+
<script runat="server">
+
protected void Page_Load(Object sender, EventArgs e)
{
int Answer;
+
// Due to a timing issue with when page validation occurs, call the
+ // Validate method to ensure that the values on the page are valid.
Page.Validate();
+
// Add the values in the text boxes if the page is valid.
if(Page.IsValid)
{
Answer = Convert.ToInt32(Value1.Text) + Convert.ToInt32(Value2.Text);
+
AnswerMessage.Text = Answer.ToString();
}
+
}
</script>
+
</head>
<body>
<form id="form1" runat="server">
<h3>
RadTextBox Example
+ </h3>
<table>
<tr>
<td colspan="5">
Enter integer values into the text boxes.
+ <br />
The two values are automatically added
<br />
when you tab out of the text boxes.
+ <br />
</td>
</tr>
<tr>
<td colspan="5">
+
</td>
</tr>
<tr align="center">
<td>
+ <radI:RadTextBox ID="Value1" Columns="2" MaxLength="3" AutoPostBack="True" Text="1" runat="server" />
</td>
<td>
+ +
</td>
<td>
<radI:RadTextBox ID="Value2" Columns="2" MaxLength="3" AutoPostBack="True" Text="1" runat="server" />
+ </td>
<td>
=
</td>
<td>
<asp:Label ID="AnswerMessage" runat="server" />
+ </td>
</tr>
<tr>
<td colspan="2">
+ <asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Value1"
ErrorMessage="Please enter a value.<br />" EnableClientScript="False" Display="Dynamic"
+ runat="server" />
<asp:RangeValidator ID="Value1RangeValidator" ControlToValidate="Value1" Type="Integer"
+ MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ EnableClientScript="False" Display="Dynamic" runat="server" />
</td>
+ <td colspan="2">
<asp:RequiredFieldValidator ID="Value2RequiredValidator" ControlToValidate="Value2"
+ ErrorMessage="Please enter a value.<br />" EnableClientScript="False" Display="Dynamic"
runat="server" />
+ <asp:RangeValidator ID="Value2RangeValidator" ControlToValidate="Value2" Type="Integer"
MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ EnableClientScript="False" Display="Dynamic" runat="server" />
</td>
<td>
 
</td>
</tr>
</table>
+ </form>
</body>
</html>
+
+ </%@ Page Language="VB" AutoEventWireup="True" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
<!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>RadTextBox Example </title>
<script runat="server">
+ Protected Sub Page_Load(sender As Object, e As EventArgs)
Dim Answer As Integer
' Due to a timing issue with when page validation occurs, call the
' Validate method to ensure that the values on the page are valid.
+ Page.Validate()
' Add the values in the text boxes if the page is valid.
If Page.IsValid Then
Answer = Convert.ToInt32(Value1.Text) + Convert.ToInt32(Value2.Text)
+ AnswerMessage.Text = Answer.ToString()
End If
End Sub
</script>
</head>
<body>
<form id="form1" runat="server">
<h3>
+ RadTextBox Example
</h3>
<table>
<tr>
+ <td colspan="5">
Enter Integer values into the text boxes.
+ <br />
The two values are automatically added
+ <br />
When you tab out of the text boxes.
+ <br />
</td>
</tr>
+ <tr>
<td colspan="5">
</td>
+ </tr>
<tr align="center">
<td>
+ <radI:RadTextBox ID="Value1" Columns="2" MaxLength="3" AutoPostBack="True" Text="1" runat="server" />
+ </td>
<td>
+
</td>
+ <td>
+ <radI:RadTextBox ID="Value2" Columns="2" MaxLength="3" AutoPostBack="True" Text="1" runat="server" />
+ </td>
<td>
=
</td>
+ <td>
<asp:Label ID="AnswerMessage" runat="server" />
+ </td>
</tr>
<tr>
<td colspan="2">
+ <asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Value1"
+ ErrorMessage="Please enter a value.<br />" EnableClientScript="False" Display="Dynamic"
+ runat="server" />
+ <asp:RangeValidator ID="Value1RangeValidator" ControlToValidate="Value1" Type="Integer"
+ MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ EnableClientScript="False" Display="Dynamic" runat="server" />
</td>
+ <td colspan="2">
+ <asp:RequiredFieldValidator ID="Value2RequiredValidator" ControlToValidate="Value2"
+ ErrorMessage="Please enter a value.<br />" EnableClientScript="False" Display="Dynamic"
+ runat="server" />
+ <asp:RangeValidator ID="Value2RangeValidator" ControlToValidate="Value2" Type="Integer"
+ MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ EnableClientScript="False" Display="Dynamic" runat="server" />
+ </td>
<td>
 
</td>
+ </tr>
</table>
</form>
</body>
</html> +
+ </%@ Page Language="C#" AutoEventWireup="True" /%>+
+ </%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
+ <title>RadTextBox Example </title>
+
<script runat="server">
+
protected void AddButton_Click(Object sender, EventArgs e)
{
+ int Answer;
+
Answer = Convert.ToInt32(Value1.Text) + Convert.ToInt32(Value2.Text);
+
AnswerMessage.Text = Answer.ToString();
+
}
+
</script>
+
</head>
<body>
<form id="form1" runat="server">
+ <h3>
RadTextBox Example
</h3>
<table>
+ <tr>
<td colspan="5">
Enter integer values into the text boxes.
+ <br />
Click the Add button to add the two values.
+ <br />
Click the Reset button to reset the text boxes.
+ </td>
</tr>
<tr>
<td colspan="5">
+ +
</td>
</tr>
<tr align="center">
+ <td>
+ <radI:RadTextBox ID="Value1" Columns="2" MaxLength="3" Text="1" runat="server" />
+ </td>
<td>
+
</td>
+ <td>
<radI:RadTextBox ID="Value2" Columns="2" MaxLength="3" Text="1" runat="server" />
+ </td>
<td>
=
</td>
+ <td>
<asp:Label ID="AnswerMessage" runat="server" />
</td>
+ </tr>
<tr>
<td colspan="2">
+ <asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Value1"
+ ErrorMessage="Please enter a value.<br />" Display="Dynamic" runat="server" />
+ <asp:RangeValidator ID="Value1RangeValidator" ControlToValidate="Value1" Type="Integer"
+ MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ Display="Dynamic" runat="server" />
</td>
<td colspan="2">
+ <asp:RequiredFieldValidator ID="Value2RequiredValidator" ControlToValidate="Value2"
+ ErrorMessage="Please enter a value.<br />" Display="Dynamic" runat="server" />
+ <asp:RangeValidator ID="Value2RangeValidator" ControlToValidate="Value2" Type="Integer"
+ MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ Display="Dynamic" runat="server" />
</td>
<td>
+  
</td>
</tr>
<tr align="center">
+ <td colspan="4">
<asp:Button ID="AddButton" Text="Add" OnClick="AddButton_Click" runat="server" />
+ </td>
<td>
+
</td>
</tr>
</table>
</form>
</body>
</html>
+
+ </%@ Page Language="VB" AutoEventWireup="True" /%>+
+ </%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html>
<head>
<title>RadTextBox Example </title>
<script runat="server">
+ Protected Sub AddButton_Click(sender As Object, e As EventArgs)
Dim Answer As Integer
+ Answer = Convert.ToInt32(Value1.Text) + Convert.ToInt32(Value2.Text)
AnswerMessage.Text = Answer.ToString()
+
End Sub
</script>
</head>
<body>
<form id="form1" runat="server">
+ <h3>
RadTextBox Example
</h3>
<table>
<tr>
+ <td colspan="5">
Enter Integer values into the text boxes.
+ <br />
Click the Add button To add the two values.
+ <br />
Click the Reset button To reset the text boxes.
+ </td>
</tr>
<tr>
<td colspan="5">
+ </td>
</tr>
<tr align="center">
<td>
+ <radI:RadTextBox ID="Value1" Columns="2" MaxLength="3" Text="1" runat="server" />
+ </td>
<td>
+
</td>
+ <td>
<radI:RadTextBox ID="Value2" Columns="2" MaxLength="3" Text="1" runat="server" />
+ </td>
<td>
=
</td>
+ <td>
<asp:Label ID="AnswerMessage" runat="server" />
+ </td>
</tr>
<tr>
<td colspan="2">
+ <asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Value1"
+ ErrorMessage="Please enter a value.<br />" Display="Dynamic" runat="server" />
+ <asp:RangeValidator ID="Value1RangeValidator" ControlToValidate="Value1" Type="Integer"
+ MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ Display="Dynamic" runat="server" />
</td>
+ <td colspan="2">
+ <asp:RequiredFieldValidator ID="Value2RequiredValidator" ControlToValidate="Value2"
+ ErrorMessage="Please enter a value.<br />" Display="Dynamic" runat="server" />
+ <asp:RangeValidator ID="Value2RangeValidator" ControlToValidate="Value2" Type="Integer"
+ MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ Display="Dynamic" runat="server" />
</td>
+ <td>
 
</td>
</tr>
+ <tr align="center">
<td colspan="4">
+ <asp:Button ID="AddButton" Text="Add" OnClick="AddButton_Click" runat="server" />
+ </td>
<td>
</td>
+ </tr>
</table>
</form>
</body>
</html> +
+ </%@ Page Language="C#" AutoEventWireup="True" /%>+
+ </%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
+ <title>MultiLine TextBox Example </title>
+
<script runat="server">
protected void SubmitButton_Click(Object sender, EventArgs e)
+ {
+
Message.Text = "Thank you for your comment: <br />" + Comment.Text;
+
}
+
protected void Check_Change(Object sender, EventArgs e)
{
+
Comment.Wrap = WrapCheckBox.Checked;
Comment.ReadOnly = ReadOnlyCheckBox.Checked;
+
}
+
</script>
+
</head>
<body>
<form id="form1" runat="server">
<h3>
+ MultiLine TextBox Example
</h3>
Please enter a comment and click the submit button.
+ <br />
<br />
+ <radI:RadTextBox ID="Comment" TextMode="MultiLine" Columns="50" Rows="5" runat="server" />
+ <br />
<asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Comment"
+ ErrorMessage="Please enter a comment.<br />" Display="Dynamic" runat="server" />
+ <asp:CheckBox ID="WrapCheckBox" Text="Wrap Text" Checked="True" AutoPostBack="True"
+ OnCheckedChanged="Check_Change" runat="server" />
+
<asp:CheckBox ID="ReadOnlyCheckBox" Text="ReadOnly" Checked="False" AutoPostBack="True"
+ OnCheckedChanged="Check_Change" runat="server" />
+
<asp:Button ID="SubmitButton" Text="Submit" OnClick="SubmitButton_Click" runat="server" />
+ <hr />
<asp:Label ID="Message" runat="server" />
</form>
</body>
+ </html> +
+ </%@ Page Language="VB" AutoEventWireup="True" /%>+
+ </%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
+ <title>MultiLine RadTextBox Example </title>
+
<script runat="server">
+
Protected Sub SubmitButton_Click(sender As Object, e As EventArgs )
+
Message.Text = "Thank you for your comment: <br />" + Comment.Text
+
End Sub
+
Protected Sub Check_Change(sender As Object, e As EventArgs )
+
Comment.Wrap = WrapCheckBox.Checked
Comment.ReadOnly = ReadOnlyCheckBox.Checked
+
End Sub
+
</script>
+
</head>
<body>
<form id="form1" runat="server">
<h3>
+ MultiLine RadTextBox Example
</h3>
Please enter a comment and click the submit button.
+ <br />
<br />
+ <radI:RadTextBox ID="Comment" TextMode="MultiLine" Columns="50" Rows="5" runat="server" />
+ <br />
<asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Comment"
+ ErrorMessage="Please enter a comment.<br />" Display="Dynamic" runat="server" />
+ <asp:CheckBox ID="WrapCheckBox" Text="Wrap Text" Checked="True" AutoPostBack="True"
+ OnCheckedChanged="Check_Change" runat="server" />
+
<asp:CheckBox ID="ReadOnlyCheckBox" Text="ReadOnly" Checked="False" AutoPostBack="True"
+ OnCheckedChanged="Check_Change" runat="server" />
+
<asp:Button ID="SubmitButton" Text="Submit" OnClick="SubmitButton_Click" runat="server" />
+ <hr />
<asp:Label ID="Message" runat="server" />
</form>
</body>
+ </html> +
+ </%@ Page Language="C#" /%>+
+ </%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
+ <title>Untitled Page</title>
<script runat="server">
+ protected void Button1_Click(object sender, EventArgs e)
{
+ RadNumericTextBox1.EmptyMessage = RadNumericTextBox1.Text;
RadNumericTextBox1.Text = String.Empty;
+ }
</script>
</head>
<body>
<form id="form1" runat="server">
+ <radI:RadTextBox EmptyMessage="Type Here" ID="RadNumericTextBox1" runat="server">
+ </radI:RadTextBox>
+ <asp:Button ID="Button1" runat="server" Text="Set Empty Message" OnClick="Button1_Click" />
+ </form>
</body>
</html>
+
+ </%@ Page Language="VB" /%>+
+ </%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
+ <title>Untitled Page</title>
<script runat="server">
+ Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
+ RadNumericTextBox1.EmptyMessage = RadNumericTextBox1.Text
RadNumericTextBox1.Text = String.Empty
+ End Sub
</script>
</head>
<body>
<form id="form1" runat="server">
+ <radI:RadTextBox EmptyMessage="Type Here" ID="RadNumericTextBox1" runat="server">
+ </radI:RadTextBox>
<asp:Button ID="Button1" runat="server" Text="Set Empty Message" />
+ </form>
</body>
</html> +
+ </%@ Page Language="C#" /%>+
+ </%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
+ <title>RadTextBox selection</title>
<script runat="server">
+ protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
+ if (DropDownList1.SelectedValue == "CaretToBeginning")
{
+ this.RadTextBox1.SelectionOnFocus = Telerik.WebControls.SelectionOnFocus.CaretToBeginning;
+ }
else if (DropDownList1.SelectedValue == "CaretToEnd")
{
+ this.RadTextBox1.SelectionOnFocus = Telerik.WebControls.SelectionOnFocus.CaretToEnd;
+ }
else if (DropDownList1.SelectedValue == "SelectAll")
{
+ this.RadTextBox1.SelectionOnFocus = Telerik.WebControls.SelectionOnFocus.SelectAll;
+ }
}
</script>
</head>
<body>
+ <form id="form1" runat="server">
<div>
+ <radI:RadTextBox SelectionOnFocus="CaretToBeginning" ID="RadTextBox1" runat="server"></radI:RadTextBox>
+ <br />
+ <asp:DropDownList AutoPostBack="true" ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
+ <asp:ListItem Text="CaretToBeginning">CaretToBeginning</asp:ListItem>
+ <asp:ListItem Text="CaretToEnd">CaretToEnd</asp:ListItem>
+ <asp:ListItem Text="SelectAll">SelectAll</asp:ListItem>
+ </asp:DropDownList></div>
</form>
</body>
</html> +
+ </%@ Page Language="C#" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ +
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
+ <title>Untitled Page</title>
+ <script language="javascript" type="text/javascript">
function Click(sender)
{
+ alert("click");
}
</script>
</head>
<body>
+ <form id="form1" runat="server">
+ <radI:RadTextBox ShowButton="true" ID="RadNumericTextBox1" runat="server">
+ <ClientEvents OnButtonClick="Click" />
<ButtonTemplate>
+ <input type="button" value="click here" />
</ButtonTemplate>
+ </radI:RadTextBox>
</form>
</body>
</html> +
+ </%@ Page Language="C#" AutoEventWireup="True" /%>+
+ </%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
+ <title>RadTextBox Example </title>
+
<script runat="server">
+
+
protected void AddButton_Click(object sender, EventArgs e)
{
+ int Answer;
+
Answer = Convert.ToInt32(Value1.Text) + Convert.ToInt32(Value2.Text);
+
AnswerMessage.Text = Answer.ToString();
}
</script>
+
</head>
<body>
<form id="form1" runat="server">
<h3>
+ RadTextBox Example
</h3>
<table>
<tr>
+ <td colspan="5">
Enter integer values into the text boxes.
+ <br />
Click the Add button to add the two values.
+ <br />
Click the Reset button to reset the text boxes.
+ </td>
</tr>
<tr>
<td colspan="5">
+
</td>
</tr>
<tr align="center">
+ <td>
<radI:RadTextBox ID="Value1" Columns="2" MaxLength="3" Text="1" runat="server" />
+ </td>
<td>
+
</td>
+ <td>
<radI:RadTextBox ID="Value2" Columns="2" MaxLength="3" Text="1" runat="server" />
+ </td>
<td>
=
</td>
+ <td>
<asp:Label ID="AnswerMessage" runat="server" />
+ </td>
</tr>
<tr>
<td colspan="2">
+ <asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Value1"
+ ErrorMessage="Please enter a value.<br />" Display="Dynamic" runat="server" />
+ <asp:RangeValidator ID="Value1RangeValidator" ControlToValidate="Value1" Type="Integer"
+ MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ Display="Dynamic" runat="server" />
</td>
+ <td colspan="2">
+ <asp:RequiredFieldValidator ID="Value2RequiredValidator" ControlToValidate="Value2"
+ ErrorMessage="Please enter a value.<br />" Display="Dynamic" runat="server" />
+ <asp:RangeValidator ID="Value2RangeValidator" ControlToValidate="Value2" Type="Integer"
+ MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ Display="Dynamic" runat="server" />
</td>
<td>
+  
</td>
</tr>
<tr align="center">
+ <td colspan="4">
+ <asp:Button ID="AddButton" Text="Add" OnClick="AddButton_Click" runat="server" />
+ </td>
<td>
+
</td>
</tr>
</table>
</form>
</body>
+ </html> +
+ </%@ Page Language="VB" AutoEventWireup="True" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
+ <title>RadTextBox Example </title>
<script runat="server">
+ Protected Sub AddButton_Click(sender As Object, e As EventArgs)
Dim Answer As Integer
+ Answer = Convert.ToInt32(Value1.Text) + Convert.ToInt32(Value2.Text)
+ AnswerMessage.Text = Answer.ToString()
End Sub
</script>
</head>
+ <body>
<form id="form1" runat="server">
<h3>
RadTextBox Example
+ </h3>
<table>
<tr>
<td colspan="5">
+ Enter Integer values into the text boxes.
<br />
+ Click the Add button To add the two values.
<br />
+ Click the Reset button To reset the text boxes.
</td>
+ </tr>
<tr>
<td colspan="5">
</td>
+ </tr>
<tr align="center">
<td>
+ <radI:RadTextBox ID="Value1" Columns="2" MaxLength="3" Text="1" runat="server" />
+ </td>
<td>
+
</td>
+ <td>
<radI:RadTextBox ID="Value2" Columns="2" MaxLength="3" Text="1" runat="server" />
+ </td>
<td>
=
</td>
+ <td>
<asp:Label ID="AnswerMessage" runat="server" />
</td>
+ </tr>
<tr>
<td colspan="2">
+ <asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Value1"
+ ErrorMessage="Please enter a value.<br />" Display="Dynamic" runat="server" />
+ <asp:RangeValidator ID="Value1RangeValidator" ControlToValidate="Value1" Type="Integer"
+ MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ Display="Dynamic" runat="server" />
</td>
+ <td colspan="2">
+ <asp:RequiredFieldValidator ID="Value2RequiredValidator" ControlToValidate="Value2"
+ ErrorMessage="Please enter a value.<br />" Display="Dynamic" runat="server" />
+ <asp:RangeValidator ID="Value2RangeValidator" ControlToValidate="Value2" Type="Integer"
+ MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ Display="Dynamic" runat="server" />
</td>
<td>
 
+ </td>
</tr>
<tr align="center">
<td colspan="4">
+ <asp:Button ID="AddButton" Text="Add" OnClick="AddButton_Click" runat="server" />
+ </td>
+ <td>
</td>
+ </tr>
</table>
</form>
</body>
</html> +
+ </%@ Page Language="C#" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
+ </head>
<body>
<form id="form1" runat="server">
+ <radI:RadTextBox EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server">
+ <EnabledStyle BackColor="red" />
<EmptyMessageStyle BackColor="AliceBlue" />
+ <FocusedStyle BackColor="yellow" />
<HoveredStyle BackColor="blue" />
+ </radI:RadTextBox>
</form>
</body>
</html> +
+ </%@ Page Language="C#" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
+ <title>Untitled Page</title>
</head>
<body>
+ <form id="form1" runat="server">
+ <radI:RadTextBox EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server">
+ <EnabledStyle BackColor="red" />
<EmptyMessageStyle BackColor="AliceBlue" />
+ <FocusedStyle BackColor="yellow" />
<HoveredStyle BackColor="blue" />
+ </radI:RadTextBox>
</form>
</body>
</html> +
+ </%@ Page Language="C#" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
+ </head>
<body>
<form id="form1" runat="server">
+ <radI:RadTextBox EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server">
+ <EnabledStyle BackColor="red" />
<EmptyMessageStyle BackColor="AliceBlue" />
+ <FocusedStyle BackColor="yellow" />
<HoveredStyle BackColor="blue" />
+ </radI:RadTextBox>
</form>
</body>
</html> +
+ </%@ Page Language="C#" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
+ </head>
<body>
<form id="form1" runat="server">
+ <radI:RadTextBox EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server">
+ <EnabledStyle BackColor="red" />
<EmptyMessageStyle BackColor="AliceBlue" />
+ <FocusedStyle BackColor="yellow" />
<HoveredStyle BackColor="blue" />
</radI:RadTextBox>
+ </form>
</body>
</html>
+
+ </%@ Page Language="C#" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
+ <title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
+ <radI:RadTextBox EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server">
+ <EnabledStyle BackColor="red" />
<EmptyMessageStyle BackColor="AliceBlue" />
+ <FocusedStyle BackColor="yellow" />
<HoveredStyle BackColor="blue" />
+ </radI:RadTextBox>
</form>
</body>
</html> +
+ </%@ Page Language="C#" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
+ <body>
<form id="form1" runat="server">
+ <radI:RadTextBox EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server">
+ <EnabledStyle BackColor="red" />
<EmptyMessageStyle BackColor="AliceBlue" />
+ <FocusedStyle BackColor="yellow" />
<HoveredStyle BackColor="blue" />
+ </radI:RadTextBox>
</form>
</body>
</html> +
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ RadDateInput1.DisplayDateFormat = "M/d/yyyy"; //Short date pattern. The same as "d".
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ RadDateInput1.DisplayDateFormat = "M/d/yyyy" 'Short date pattern. The same as "d".
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ RadDateInput1.DateFormat = "M/d/yyyy"; //Short date pattern. The same as "d".
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ RadDateInput1.DateFormat = "M/d/yyyy" 'Short date pattern. The same as "d".
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ RadDateInput1.SelectedDate = DateTime.Now;
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ RadDateInput1.SelectedDate = DateTime.Now
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ RadDateInput1.DbSelectedDate = tableRow["BirthDate"];
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ RadDateInput1.DbSelectedDate = tableRow("BirthDate")
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ RadDateInput1.Culture = new CultureInfo("en-US");
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ RadDateInput1.Culture = New CultureInfo("en-US")
+ End Sub
+
+ + <script type="text/javascript">+
function onDateChange(dateInput, args)
{
alert("New date:" + args.NewDate);
}
</script>
+
<radI:RadDateInput
ID="RadDateInput1"
runat="server"
OnClientDateChanged="onDateChange">
</radI:RadDateInput> +
+ [ASPX/ASCX] ++
+ <script type="text/javascript" >+
function DatePicker_OnDateSelected(pickerInstance, args)
{
alert("The picker date has been chanded from " + args.OldDate + " to " + args.NewDate);
}
</script>
<radCln:RadDatePicker ID="RadDatePicker1" runat="server" >
<ClientEvents OnDateSelected="DatePicker_OnDateSelected" />
</radCln:RadDatePicker> +
+ <script type="text/javascript">+
function Opening(sender, args)
{
args.CancelOpen = true;
//or
return false;
}
</script>
<radCln:RadDatePicker ID="RadDatePicker1" runat="server">
<ClientEvents OnPopupOpening="Opening"/>
</radCln:RadDatePicker> +
+ <script type="text/javascript">+
function Opening(sender, args)
{
args.CancelCalendarSynchronize = true;
sender.Calendar.NavigateToDate([2006,12,19]);
}
</script>
<radCln:RadDatePicker ID="RadDatePicker1" runat="server" >
<ClientEvents OnPopupOpening="Opening"/>
</radCln:RadDatePicker> +
+ [ASPX/ASCX] ++
+ <script type="text/javascript">+
function OnPopupOpening(datepickerInstance, args)
{
......
}
</script>
<radcln:RadDatePicker ID="RadDatePicker1" runat="server">
<ClientEvents OnPopupOpening="OnPopupOpening" />
</radcln:RadDatePicker> +
+ [ASPX/ASCX] ++
+ <script type="text/javascript">+
function OnPopupClosing(datepickerInstance, args)
{
......
}
</script>
<radcln:RadDatePicker ID="RadDatePicker1" runat="server">
<ClientEvents OnPopupClosing="OnPopupClosing" />
</radcln:RadDatePicker> +
+ <script type="text/javascript">+
function Closing(sender, args)
{
args.CancelClose = true;
//or
return false;
}
</script>
<radCln:RadDatePicker ID="RadDatePicker1" runat="server">
<ClientEvents OnPopupClosing="Closing"/>
</radCln:RadDatePicker> +
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ RadDatePicker1.SelectedDate = DateTime.Now;
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ RadDatePicker1.SelectedDate = DateTime.Now
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ RadDatePicker1.DbSelectedDate = tableRow["BirthDate"];
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ RadDatePicker1.DbSelectedDate = tableRow("BirthDate")
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ RadDatePicker1.Culture = new CultureInfo("en-US");
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ RadDatePicker1.Culture = New CultureInfo("en-US")
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ RadDateTimePicker1.Culture = new CultureInfo("en-US");
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ RadDateTimePicker1.Culture = New CultureInfo("en-US")
+ End Sub
+
+
+ using System;
+ using System.Data;
+ using System.Configuration;
+ using System.Web;
+ using System.Web.Security;
+ using System.Web.UI;
+ using System.Web.UI.WebControls;
+ using System.Web.UI.WebControls.WebParts;
+ using System.Web.UI.HtmlControls;
+
+ public partial class _Default : System.Web.UI.Page
+ {
+ protected void RadTimePicker1_ItemDataBound(object sender, Telerik.WebControls.Base.Calendar.Events.TimePickerEventArgs e)
+ {
+ if (e.Item.ItemType == ListItemType.AlternatingItem)
+ {
+ e.Item.Controls.Add(new LiteralControl("AlternatingItem"));
+ }
+ }
+ }
+
+
+ Imports System
+ Imports System.Data
+ Imports System.Configuration
+ Imports System.Web
+ Imports System.Web.Security
+ Imports System.Web.UI
+ Imports System.Web.UI.WebControls
+ Imports System.Web.UI.WebControls.WebParts
+ Imports System.Web.UI.HtmlControls
+ Public Class _Default
+ Inherits System.Web.UI.Page
+
+ Protected Sub RadTimePicker1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.WebControls.Base.Calendar.Events.TimePickerEventArgs)
+ If (e.Item.ItemType = ListItemType.AlternatingItem) Then
+ e.Item.Controls.Add(New LiteralControl("AlternatingItem"))
+ End If
+ End Sub
+ End Class
+
+
+ protected void RadTimePicker1_ItemCreated(object sender, Telerik.WebControls.Base.Calendar.Events.TimePickerEventArgs e)
+ {
+ if (e.Item.ItemType == ListItemType.Item)
+ {
+ e.Item.CssClass = "TimeCss";
+ }
+
+ if (e.Item.ItemType == ListItemType.AlternatingItem)
+ {
+ e.Item.CssClass = "AlternatingTimeCss";
+ }
+ }
+
+
+ Protected Sub RadTimePicker1_ItemCreated(sender As Object, e As Telerik.WebControls.Base.Calendar.Events.TimePickerEventArgs)
+ If e.Item.ItemType = ListItemType.Item Then
+ e.Item.CssClass = "TimeCss"
+ End If
+
+ If e.Item.ItemType = ListItemType.AlternatingItem Then
+ e.Item.CssClass = "AlternatingTimeCss"
+ End If
+ End Sub 'RadTimePicker1_ItemCreated
+
+ | + |
+ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+ <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radCln:RadTimePicker
+ ID="RadTimePicker1"
+ runat="server">
+ <TimeView>
+ <AlternatingTimeTemplate>
+ <input type="button" id="button1" value='<%# DataBinder.Eval(((DataListItem)Container).DataItem, "time", "{0:t}") %>' />
+ </AlternatingTimeTemplate>
+ </TimeView>
+ </radCln:RadTimePicker>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+ <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radCln:RadTimePicker
+ ID="RadTimePicker1"
+ runat="server">
+ <TimeView ShowFooter="true">
+ <FooterTemplate>
+ <asp:Label ID="Label1" runat="server" Text="Footer"></asp:Label>
+ </FooterTemplate>
+ </TimeView>
+ </radCln:RadTimePicker>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+ <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radCln:RadTimePicker
+ ID="RadTimePicker1"
+ runat="server">
+ <TimeView>
+ <HeaderTemplate>
+ <asp:Label ID="Label1" runat="server" Text="Header"></asp:Label>
+ </HeaderTemplate>
+ </TimeView>
+ </radCln:RadTimePicker>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+ <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radCln:RadTimePicker
+ ID="RadTimePicker1"
+ runat="server">
+ <TimeView>
+ <HeaderTemplate>
+ <asp:Label ID="Label1" runat="server" Text="Header"></asp:Label>
+ </HeaderTemplate>
+ </TimeView>
+ </radCln:RadTimePicker>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+ <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ <script language="javascript">
+ function ClientTimeSelected(sender, args)
+ {
+ alert(args.oldTime);
+ alert(args.newTime);
+ }
+ </script>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radCln:RadTimePicker
+ ID="RadTimePicker1"
+ runat="server">
+ <TimeView OnClientTimeSelected="ClientTimeSelected">
+ </TimeView>
+ </radCln:RadTimePicker>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+ <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radCln:RadTimePicker
+ ID="RadTimePicker1"
+ runat="server">
+ <TimeView Columns="5" >
+ </TimeView>
+ </radCln:RadTimePicker>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+ <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radCln:RadTimePicker
+ ID="RadTimePicker1"
+ runat="server">
+ <TimeView ShowFooter="true" >
+ <FooterTemplate>
+ <asp:Label ID="Label1" runat="server" Text="Hello Footer!"></asp:Label>
+ </FooterTemplate>
+ </TimeView>
+ </radCln:RadTimePicker>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+ <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radCln:RadTimePicker
+ ID="RadTimePicker1"
+ runat="server">
+ <TimeView ShowHeader="true">
+ <HeaderTemplate>
+ <asp:Label ID="Label1" runat="server" Text="Hello Header!"></asp:Label>
+ </HeaderTemplate>
+ </TimeView>
+ </radCln:RadTimePicker>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+ <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <div>
+ <asp:DropDownList AutoPostBack="true" ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
+ <asp:ListItem Text="Select" Value=""></asp:ListItem>
+ <asp:ListItem Text="DarkGray" Value="DarkGray"></asp:ListItem>
+ <asp:ListItem Text="Khaki" Value="Khaki"></asp:ListItem>
+ <asp:ListItem Text="DarkKhaki" Value="DarkKhaki"></asp:ListItem>
+ </asp:DropDownList>
+ </div>
+ <radCln:RadTimePicker
+ ID="RadTimePicker1"
+ runat="server">
+ <TimePopupButton ImageUrl="clock.gif" HoverImageUrl="clock.gif" />
+ <TimeView Skin="None">
+ </TimeView>
+ </radCln:RadTimePicker>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ using System;
+ using System.Data;
+ using System.Configuration;
+ using System.Web;
+ using System.Web.Security;
+ using System.Web.UI;
+ using System.Web.UI.WebControls;
+ using System.Web.UI.WebControls.WebParts;
+ using System.Web.UI.HtmlControls;
+
+ public partial class _Default : System.Web.UI.Page
+ {
+ protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ this.RadTimePicker1.TimeView.TimeStyle.BackColor =
+ System.Drawing.Color.FromName(this.DropDownList1.SelectedItem.Value);
+ }
+ }
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+ <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <div>
+ <asp:DropDownList AutoPostBack="true" ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
+ <asp:ListItem Text="Select" Value=""></asp:ListItem>
+ <asp:ListItem Text="DarkGray" Value="DarkGray"></asp:ListItem>
+ <asp:ListItem Text="Khaki" Value="Khaki"></asp:ListItem>
+ <asp:ListItem Text="DarkKhaki" Value="DarkKhaki"></asp:ListItem>
+ </asp:DropDownList>
+ </div>
+ <radCln:RadTimePicker
+ ID="RadTimePicker1"
+ runat="server">
+ <TimePopupButton ImageUrl="clock.gif" HoverImageUrl="clock.gif" />
+ <TimeView Skin="None">
+ </TimeView>
+ </radCln:RadTimePicker>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ using System;
+ using System.Data;
+ using System.Configuration;
+ using System.Web;
+ using System.Web.Security;
+ using System.Web.UI;
+ using System.Web.UI.WebControls;
+ using System.Web.UI.WebControls.WebParts;
+ using System.Web.UI.HtmlControls;
+
+ public partial class _Default : System.Web.UI.Page
+ {
+ protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ this.RadTimePicker1.TimeView.AlternatingTimeStyle.BackColor =
+ System.Drawing.Color.FromName(this.DropDownList1.SelectedItem.Value);
+ }
+ }
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+ <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radCln:RadTimePicker
+ ID="RadTimePicker1"
+ runat="server">
+ <TimePopupButton ImageUrl="clock.gif" HoverImageUrl="clock.gif" />
+ <TimeView Skin="None" ShowHeader="true">
+ <HeaderStyle BackColor="red" />
+ </TimeView>
+ </radCln:RadTimePicker>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+ <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radCln:RadTimePicker
+ ID="RadTimePicker1"
+ runat="server">
+ <TimePopupButton ImageUrl="clock.gif" HoverImageUrl="clock.gif" />
+ <TimeView Skin="None" ShowFooter="true">
+ <FooterStyle BackColor="Aqua" />
+ </TimeView>
+ </radCln:RadTimePicker>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ RadComboBox1.ClearSelection()
+
+
+ RadComboBox1.ClearSelection();
+
+
+ Dim item As RadComboBoxItem = RadComboBox1.FindItemByText("New York")
+
+
+ RadComboBoxItem item = RadComboBox1.FindItemByText("New York");
+
+
+ Dim item As RadComboBoxItem = RadComboBox1.FindItemByText("New York",true)
+
+
+ RadComboBoxItem item = RadComboBox1.FindItemByText("New York",true);
+
+
+ Dim item As RadComboBoxItem = RadComboBox1.FindItemByValue("1")
+
+
+ RadComboBoxItem item = RadComboBox1.FindItemByValue("1");
+
+
+ Dim item As RadComboBoxItem = RadComboBox1.FindItemByValue("1", true)
+
+
+ RadComboBoxItem item = RadComboBox1.FindItemByValue("1", true);
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadComboBox1.FindItem(ItemWithEqualsTextAndValue);
+ }
+ private static bool ItemWithEqualsTextAndValue(RadComboBoxItem item)
+ {
+ if (item.Text == item.Value)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
+ RadComboBox1.FindItem(ItemWithEqualsTextAndValue)
+ End Sub
+ Private Shared Function ItemWithEqualsTextAndValue(ByVal item As RadComboBoxItem) As Boolean
+ If item.Text = item.Value Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+
+ RadComboBox1.LoadContentFile("~/myfile.xml")
+
+
+ RadComboBox1.LoadContentFile("~/myfile.xml");
+
+
+ RadComboBox1.Sort=RadComboBoxSort.Ascending
+ RadComboBox1.SortItems()
+
+
+ RadComboBox1.Sort=RadComboBoxSort.Ascending;
+ RadComboBox1.SortItems();
+
+
+ RadComboBox1.Sort=RadComboBoxSort.Ascending
+ Dim comparer As MyComparer = New MyComparer()
+ RadComboBox1.SortItems(comparer)
+ Public Class MyComparer
+ Implements IComparer
+
+ Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer
+ Dim p1 As New RadComboBoxItem()
+ Dim p2 As New RadComboBoxItem()
+
+ If TypeOf x Is RadComboBoxItem Then
+ p1 = TryCast(x, RadComboBoxItem)
+ Else
+ Throw New ArgumentException("Object is not of type RadComboBoxItem.")
+ End If
+
+ If TypeOf y Is RadComboBoxItem Then
+ p2 = TryCast(y, RadComboBoxItem)
+ Else
+ Throw New ArgumentException("Object is not of type RadComboBoxItem.")
+ End If
+
+ Dim cmp As Integer = 0
+ If p1.ComboBoxParent.Sort = RadComboBoxSort.Ascending Then
+ cmp = [String].Compare(p1.Value, p2.Value, Not p1.ComboBoxParent.SortCaseSensitive)
+ End If
+ If p1.ComboBoxParent.Sort = RadComboBoxSort.Descending Then
+ cmp = [String].Compare(p1.Value, p2.Value, Not p1.ComboBoxParent.SortCaseSensitive) * -1
+ End If
+
+ Return cmp
+ End Function
+
+ End Class
+
+
+
+ RadComboBox1.Sort=RadComboBoxSort.Ascending;
+ MyCoparer comparer = new MyComparer();
+ RadComboBox1.SortItems(comparer);
+ public class MyComparer : IComparer
+ {
+
+ public int Compare(object x, object y)
+ {
+ RadComboBoxItem p1 = new RadComboBoxItem();
+ RadComboBoxItem p2 = new RadComboBoxItem();
+
+ if (x is RadComboBoxItem)
+ p1 = x as RadComboBoxItem;
+ else
+ throw new ArgumentException("Object is not of type RadComboBoxItem.");
+
+ if (y is RadComboBoxItem)
+ p2 = y as RadComboBoxItem;
+ else
+ throw new ArgumentException("Object is not of type RadComboBoxItem.");
+
+ int cmp = 0;
+ if (p1.ComboBoxParent.Sort == RadComboBoxSort.Ascending)
+ {
+ cmp = String.Compare(p1.Value, p2.Value, !p1.ComboBoxParent.SortCaseSensitive);
+ }
+ if (p1.ComboBoxParent.Sort == RadComboBoxSort.Descending)
+ {
+ cmp = String.Compare(p1.Value, p2.Value, !p1.ComboBoxParent.SortCaseSensitive) * -1;
+ }
+
+ return cmp;
+ }
+
+ }
+
+
+ foreach (ClientOperation<RadComboBoxItem> operation in RadToolBar1.ClientChanges)
+ {
+ RadComboBoxItem item = operation.Item;
+
+ switch (operation.Type)
+ {
+ case ClientOperationType.Insert:
+ //An item has been inserted - operation.Item contains the inserted item
+ break;
+ case ClientOperationType.Remove:
+ //An item has been inserted - operation.Item contains the removed item.
+ //Keep in mind the item has been removed from the combobox.
+ break;
+ case ClientOperationType.Update:
+ UpdateClientOperation<RadComboBoxItem> update = operation as UpdateClientOperation<RadComboBoxItem>
+ //The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
+ break;
+ case ClientOperationType.Clear:
+ //All children of the combobox have been removed - operation.Item will always be null.
+ break;
+ }
+ }
+
+
+ For Each operation As ClientOperation(Of RadComboBoxItem) In RadToolBar1.ClientChanges
+ Dim item As RadComboBoxItem = operation.Item
+ Select Case operation.Type
+ Case ClientOperationType.Insert
+ 'An item has been inserted - operation.Item contains the inserted item
+ Exit Select
+ Case ClientOperationType.Remove
+ 'An item has been inserted - operation.Item contains the removed item.
+ 'Keep in mind the item has been removed from the combobox.
+ Exit Select
+ Case ClientOperationType.Update
+ Dim update As UpdateClientOperation(Of RadComboBoxItem) = TryCast(operation, UpdateClientOperation(Of RadComboBoxItem))
+ 'The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
+ Exit Select
+ Case ClientOperationType.Clear
+ //All children of the combobox have been removed - operation.Item will always be Nothing.
+ Exist Select
+ End Select
+ Next
+
+
+ RadComboBox1.Items[0].Text = "Example";
+ RadComboBox1.Items[0].Value = "1";
+
+
+ RadComboBox1.Items(0).Text = "Example"
+ RadComboBox1.Items(0).Value = "1"
+
+
+ If RadComboBox1.IsEmpty
+ '
+ '
+ '
+ End If
+
+
+ if (RadComboBox1.IsEmpty)
+ {
+ //
+ //
+ //
+ }
+
+
+ RadComboBox1.RadComboBoxImagePosition = RadComboBoxImagePosition.Left;
+
+
+ RadComboBox1.RadComboBoxImagePosition = RadComboBoxImagePosition.Right
+
+
+ string comboText = RadComboBox1.Text
+
+
+ Dim comboText As String = RadComboBox1.Text
+
+
+ [ScriptService]
+ public class WebServiceName : WebService
+ {
+ [WebMethod]
+ public RadComboBoxItemData[] WebServiceMethodName(object context)
+ {
+ // We cannot use a dictionary as a parameter, because it is only supported by script services.
+ // The context object should be cast to a dictionary at runtime.
+ IDictionary<string, object> contextDictionary = (IDictionary<string, object>) context;
+
+ //...
+ }
+ }
+
+
+ RadComboBox1.AutoCompleteSeparator = ";,";
+
+
+ RadComboBox1.AutoCompleteSeparator = ";,"
+
+
+ <telerik:radcombobox id="RadComboBox1" Runat="server" ></telerik:radcombobox>
+
+ private void RadComboBox1_SelectedIndexChanged(object o, Telerik.WebControls.RadComboBoxSelectedIndexChangedEventArgs e)
+ {
+ Label1.Text = RadComboBox1.SelectedItem.Text;
+ }
+
+
+ <telerik:radcombobox id="RadComboBox1" Runat="server" ></telerik:radcombobox>
+
+ Private Sub RadComboBox1_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.WebControls.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
+ Label1.Text = RadComboBox1.SelectedItem.Text
+ End Sub
+
+ ++<ItemTemplate> +++<asp:CheckBox runat="server" + ID="CheckBox"></asp:CheckBox> +
+ <asp:Label runat="server" ID="Label1"++Text='<%# DataBinder.Eval(Container, "Text") %>' +></asp:Label> +</ItemTemplate> +<Items> +++<telerik:RadComboBoxItem Text="News" /> +<telerik:RadComboBoxItem Text="Sports" /> +<telerik:RadComboBoxItem Text="Games" /> +</Items> +
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadComboBox1.ExpandAnimation.Type = AnimationType.Linear;
+ RadComboBox1.ExpandAnimation.Duration = 300;
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ RadComboBox1.ExpandAnimation.Type = AnimationType.Linear
+ RadComboBox1.ExpandAnimation.Duration = 300
+ End Sub
+
+
+
+
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadComboBox1.CollapseAnimation.Type = AnimationType.Linear;
+ RadComboBox1.CollapseAnimation.Duration = 300;
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ RadComboBox1.CollapseAnimation.Type = AnimationType.Linear
+ RadComboBox1.CollapseAnimation.Duration = 300
+ End Sub
+
+
+ RadComboBox1.Sort = RadComboBoxSort.Ascending;
+ RadComboBox1.Sort = RadComboBoxSort.Descending;
+ RadComboBox1.Sort = RadComboBoxSort.None;
+
+
+ RadComboBox1.Sort = RadComboBoxSort.Ascending
+ RadComboBox1.Sort = RadComboBoxSort.Descending
+ RadComboBox1.Sort = RadComboBoxSort.None
+
+
+ RadComboBox1.SortCaseSensitive = false;
+
+
+
+ RadComboBox1.SortCaseSensitive = false
+
+
+ <script type="text/javascript">
+ function onSelectedIndexChanging(sender, eventArgs)
+ {
+ var item = eventArgs.get_item();
+ if (item.get_text() == "LA")
+ {
+ // do not allow selecting item with text "LA"
+ return false;
+ }
+ else
+ {
+ // alert the new item text and value.
+ alert(item.get_text() + ":" + item.get_value());
+ }
+ }
+ </script>
+
+ <telerik:radcombobox ID="RadComboBox1" runat="server"
+ OnClientSelectedIndexChanging="onSelectedIndexChanging">
+ </telerik:radcombobox>
+
+
+ <script language="javascript">
+ function onSelectedIndexChanged(sender,eventArgs)
+ {
+ var item = eventArgs.get_item();
+ // alert the new item text and value.
+ alert(item.get_text() + ":" + item.get_value());
+ }
+ </script>
+
+ <telerik:radcombobox ID="RadComboBox1" runat="server"
+ OnClientSelectedIndexChanged="onSelectedIndexChanged">
+ </telerik:radcombobox>
+
+
+ <telerik:radcombobox
+ Runat="server"
+ ID="RadComboBox3"
+ OnClientKeyPressing="HandleKeyPress"
+ ...
+ />
+
+ <script type="text/javascript">
+
+ function HandleKeyPress(sender, e)
+ {
+ if (e.keyCode == 13)
+ {
+ document.forms[0].submit();
+ }
+ }
+
+ </script>
+
+
+ <script language="javascript">
+
+ function HandleOpen(sender,args)
+ {
+ if (someCondition)
+ {
+ args.set_cancel(true);
+ }
+ else
+ {
+ alert("Opening combobox with " + comboBox.get_items().get_count() + " items");
+ }
+ }
+
+ </script>
+
+
+ <telerik:radcombobox
+ id="RadComboBox1"
+ Runat="server"
+ OnClientDropDownOpening="HandleOpen">
+ </telerik:radcombobox>
+
+
+ <script language="javascript">
+
+ function HandleOpen(sender,args)
+ {
+ alert("Opening combobox with " + comboBox.get_items().get_count() + " items");
+
+ }
+
+ </script>
+
+
+ <telerik:radcombobox
+ id="RadComboBox1"
+ Runat="server"
+ OnClientDropDownOpened="HandleOpen">
+ </telerik:radcombobox>
+
+
+ <script type="text/avascript">
+
+ function OnClientFocus(sender,args)
+ {
+ alert("focus");
+ }
+
+ </script>
+
+
+ <telerik:radcombobox
+ id="RadComboBox1"
+ Runat="server"
+ OnClientFocus="OnClientFocus">
+ </telerik:radcombobox>
+
+
+ <script type="text/avascript">
+
+ function OnClientBlur(sender,args)
+ {
+ alert("blur");
+ }
+
+ </script>
+
+
+ <telerik:radcombobox
+ id="RadComboBox1"
+ Runat="server"
+ OnClientBlur="OnClientBlur">
+ </telerik:radcombobox>
+
+
+ <script language="javascript">
+
+ function HandleClose(sender, args)
+ {
+ if (someCondition)
+ {
+ args.set_cancel(true);
+ }
+ else
+ {
+ alert("Closing combobox with " + sender.get_items().get_count() + " items");
+ }
+ }
+
+ </script>
+
+
+ <telerik:radcombobox
+ id="RadComboBox1"
+ Runat="server"
+ OnClientDropDownClosing="HandleClose">
+ </telerik:radcombobox>
+
+
+ <script language="javascript">
+
+ function HandleClose(sender, args)
+ {
+ alert("Closed combobox with " + sender.get_items().get_count() + " items");
+
+ }
+
+ </script>
+
+
+ <telerik:radcombobox
+ id="RadComboBox1"
+ Runat="server"
+ OnClientDropDownClosed="HandleClose">
+ </telerik:radcombobox>
+
+
+ RadComboBoxItem newsItem = new RadComboBoxItem("News");
+ RadComboBox1.Items.Add(newsItem);
+
+
+ Dim newsItem As RadPanelItem = New RadComboBoxItem("News")
+ RadComboBox1.Items.Add(newsItem)
+
+
+ Dim item As RadComboBoxItem = RadComboBox1.FindItemByText("New York",true)
+
+
+ RadComboBoxItem item = RadComboBox1.FindItemByText("New York",true);
+
+
+ Dim item As RadComboBoxItem = RadComboBox1.FindItemByValue("1", true)
+
+
+ RadComboBoxItem item = RadComboBox1.FindItemByValue("1", true);
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadComboBox1.FindItem(ItemWithEqualsTextAndValue);
+ }
+ private static bool ItemWithEqualsTextAndValue(RadComboBoxItem item)
+ {
+ if (item.Text == item.Value)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
+ RadComboBox1.FindItem(ItemWithEqualsTextAndValue)
+ End Sub
+ Private Shared Function ItemWithEqualsTextAndValue(ByVal item As RadComboBoxItem) As Boolean
+ If item.Text = item.Value Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+
+ RadComboBoxItem[] items = new RadComboBoxItem[] { new RadComboBoxItem("First"), new RadComboBoxItem("Second"), new RadComboBoxItem("Third") };
+ RadComboBox1.Items.AddRange(items);
+
+
+ Dim items() As RadComboBoxItem = {New RadComboBoxItem("First"), New RadComboBoxItem("Second"), New RadComboBoxItem("Third")}
+ RadComboBox1.Items.AddRange(items)
+
+ + <telerik:GridBoundColumn FooterText="BoundColumn footer" UniqueName="CustomerID" SortExpression="CustomerID"+
HeaderText="Bound<br/>Column" DataField="CustomerID">
</telerik:GridBoundColumn> +
+ <radG:GridBoundColumn+
DataField="ContactName"
HeaderText="ContactName"
SortExpression="ContactName"
UniqueName="ContactName"
Groupable="false">
</radG:GridBoundColumn> +
+ protected void RadGrid1_PreRender(object sender, EventArgs e)
+ {
+ foreach (GridBoundColumn column in RadGrid1.MasterTableView.Columns)
+ {
+ Response.Write(column.UniqueName + column.OrderIndex + "<br>");
+ }
+
+ RadGrid1.MasterTableView.SwapColumns(2, 4);
+
+ foreach (GridBoundColumn column in RadGrid1.MasterTableView.Columns)
+ {
+ Response.Write(column.UniqueName + column.OrderIndex + "<br>");
+ }
+ }
+
+
+ Protected Sub RadGrid1_PreRender(sender As Object, e As EventArgs)
+ Dim column As GridBoundColumn
+ For Each column In RadGrid1.MasterTableView.Columns
+ Response.Write((column.UniqueName + column.OrderIndex + "<br>"))
+ Next column
+
+ RadGrid1.MasterTableView.SwapColumns(2, 4)
+
+ Dim column As GridBoundColumn
+ For Each column In RadGrid1.MasterTableView.Columns
+ Response.Write((column.UniqueName + column.OrderIndex + "<br>"))
+ Next column
+ End Sub 'RadGrid1_PreRender
+
+
+
+ protected void RadGrid1_PreRender(object sender, EventArgs e)
+ |
+
+
+ <radG:GridTemplateColumn
+ |
+
| + |
+ protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
+ {
+ GridEditableItem editedItem = e.Item as GridEditableItem;
+ GridEditManager editMan = editedItem.EditManager;
+
+ foreach( GridColumn column in e.Item.OwnerTableView.RenderColumns )
+ {
+ if ( column is IGridEditableColumn )
+ {
+ IGridEditableColumn editableCol = (column as IGridEditableColumn);
+ if ( editableCol.IsEditable )
+ {
+ IGridColumnEditor editor = editMan.GetColumnEditor( editableCol );
+
+ string editorType = editor.ToString();
+ string editorText = "unknown";
+ object editorValue = null;
+
+ if ( editor is GridTextColumnEditor )
+ {
+ editorText = (editor as GridTextColumnEditor).Text;
+ editorValue = (editor as GridTextColumnEditor).Text;
+ }
+
+ if ( editor is GridBoolColumnEditor )
+ {
+ editorText = (editor as GridBoolColumnEditor).Value.ToString();
+ editorValue = (editor as GridBoolColumnEditor).Value;
+ }
+
+ if ( editor is GridDropDownColumnEditor )
+ {
+ editorText = (editor as GridDropDownColumnEditor).SelectedText + "; " +
+ (editor as GridDropDownColumnEditor).SelectedValue;
+ editorValue = (editor as GridDropDownColumnEditor).SelectedValue;
+ }
+
+ try
+ {
+ DataRow[] changedRows = this.EmployeesData.Tables["Employees"].Select( "EmployeeID = " + editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["EmployeeID"] );
+ changedRows[0][column.UniqueName] = editorValue;
+ this.EmployeesData.Tables["Employees"].AcceptChanges();
+ }
+ catch(Exception ex)
+ {
+ RadGrid1.Controls.Add(new LiteralControl ("<strong>Unable to set value of column '" + column.UniqueName + "'</strong> - " + ex.Message));
+ e.Canceled = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+
+ Private Sub RadGrid1_UpdateCommand(ByVal source As System.Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand
+
+ Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
+ Dim editMan As GridEditManager = editedItem.EditManager
+
+ Dim column As GridColumn
+
+ For Each column In e.Item.OwnerTableView.Columns
+ If Typeof column Is IGridEditableColumn Then
+ Dim editableCol As IGridEditableColumn = CType(column, IGridEditableColumn)
+ If (editableCol.IsEditable) Then
+ Dim editor As IGridColumnEditor = editMan.GetColumnEditor(editableCol)
+
+ Dim editorType As String = CType(editor, Object).ToString()
+ Dim editorText As String = "unknown"
+ Dim editorValue As Object = Nothing
+
+ If (Typeof editor Is GridTextColumnEditor) Then
+ editorText = CType(editor, GridTextColumnEditor).Text
+ editorValue = CType(editor, GridTextColumnEditor).Text
+ End If
+
+ If (Typeof editor Is GridBoolColumnEditor) Then
+ editorText = CType(editor, GridBoolColumnEditor).Value.ToString()
+ editorValue = CType(editor, GridBoolColumnEditor).Value
+ End If
+
+ If (Typeof editor Is GridDropDownColumnEditor) Then
+ editorText = CType(editor, GridDropDownColumnEditor).SelectedText & "; " & CType(editor, GridDropDownColumnEditor).SelectedValue
+ editorValue = CType(editor, GridDropDownColumnEditor).SelectedValue
+ End If
+
+ Try
+ Dim changedRows As DataRow() = Me.EmployeesData.Tables("Employees").Select("EmployeeID = " & editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("EmployeeID"))
+ changedRows(0)(column.UniqueName) = editorValue
+ Me.EmployeesData.Tables("Employees").AcceptChanges()
+ Catch ex As Exception
+ RadGrid1.Controls.Add(New LiteralControl("<strong>Unable to set value of column '" & column.UniqueName & "'</strong> - " + ex.Message))
+ e.Canceled = True
+ End Try
+
+ End If
+ End If
+ Next
+ End Sub
+
+
+ <radG:GridButtonColumn FooterText="PushButtonColumn<br/>footer" DataTextFormatString="Select {0}"
ButtonType="PushButton" UniqueName="column" HeaderText="PushButton<br/>Column"
CommandName="Select" DataTextField="CustomerID">
</radG:GridButtonColumn>
+
+ |
+ | |
| CancelCommandName | +Represents the Cancel command name. Fires RadGrid.CancelCommand + event and sets Item.Edit to false for the parent + Item. |
| DeleteCommandName | +Represents the Delete command name. Fires RadGrid.DeleteCommand + event. Under .Net 2.0 performs automatic delete operation and then sets + Item.Edit to false. |
| UpdateCommandName | +Represents the Update command name. Fires RadGrid.UpdateCommand + event. Under .Net 2.0 performs automatic update operation and then sets + Item.Edit to false. |
|
+ |
+ Represents the Edit command name. Sets Item.Edit to + true. |
|
+ |
+ Represents the Select command name. Sets Item.Selected to + true. |
|
+ |
+ Represents the Deselect command name. Sets Item.Selected to + false. |
|
+ | |
|
+ |
+ By default grid renders an image button in the CommandItem. Opens
+ the insert item. |
|
+ |
+ Fires RadGrid.InsertCommand event. Under .Net 2.0 Perfoms
+ automatic insert operation and closes the insert item. |
|
+ |
+ By default grid renders an image button in the CommandItem. Forces + RadGrid.Rebind |
|
+ |
+ Represents the Sort command name. By default it is fired by image buttons in the + header item when Sorting is enabled. The argument for the SortCommand + must be the DataField name for the DataField to be + sorted. |
| + |
+ [ASPX/ASCX]<br/><br/><radg:RadGrid id=<font class="string">"RadGrid1"</font> runat=<font class="string">"server"</font>><br/> <MasterTableView AutoGenerateColumns=<font class="string">"False"</font>><br/> <Columns><br/> <radg:GridButtonColumn HeaderText=<font class="string">"Customer ID"</font><font color="red">DataTextField=<font class="string">"CustomerID"</font></font><br/><font color="red">DataTextFormatString=<font class="string">"Edit Customer {0}"</font></font> ButtonType=<font class="string">"LinkButton"</font> UniqueName=<font class="string">"ButtonColumn"</font>><br/> </radg:GridButtonColumn>
+
+
+
+
+
+ | + |
+ [ASPX/ASCX]<br/><br/><radg:RadGrid id=<font color="black"><font class="string">"RadGrid1"</font> runat=<font class="string">"server"</font>><br/> <MasterTableView AutoGenerateColumns=<font class="string">"False"</font>><br/> <Columns><br/> <radg:GridButtonColumn HeaderText=<font class="string">"Customer ID"</font></font><font color="red">DataTextField=<font class="string">"CustomerID"</font><br/>DataTextFormatString=<font class="string">"Edit Customer {0}"</font></font> ButtonType=<font class="string" color="black">"LinkButton"</font> UniqueName=<font color="black"><font class="string">"ButtonColumn"</font>><br/> </radg:GridButtonColumn></font>
+
+ + <radG:GridCheckBoxColumn FooterText="CheckBoxColumn footer" UniqueName="Bool" HeaderText="CheckBox<br/>Column"+
DataField="Bool">
</radG:GridCheckBoxColumn> +
+ <radG:GridClientDeleteColumn ConfirmText="Are you sure you want to delete the selected row?" HeaderStyle-Width="35px" ButtonType="ImageButton" ImageUrl="~/RadControls/Grid/Skins/WebBlue/Delete.gif" /> ++
+ <radG:GridClientSelectColumn UniqueName="CheckboxSelectColumn" HeaderText="CheckboxSelect column <br />" /> ++
+ GridBoundColumn boundColumn;
+ boundColumn = new GridBoundColumn();
+ boundColumn.DataField = "CustomerID";
+ boundColumn.HeaderText = "CustomerID";
+ RadGrid1.MasterTableView.Columns.Add(boundColumn);
+
+ boundColumn = new GridBoundColumn();
+ boundColumn.DataField = "ContactName";
+ boundColumn.HeaderText = "Contact Name";
+ RadGrid1.MasterTableView.Columns.Add(boundColumn);
+
+ RadGrid1.MasterTableView.Columns.Add( new GridExpandColumn() );
+
+
+ Dim boundColumn As GridBoundColumn
+ boundColumn = New GridBoundColumn()
+ boundColumn.DataField = "CustomerID"
+ boundColumn.HeaderText = "CustomerID"
+ RadGrid1.MasterTableView.Columns.Add(boundColumn)
+
+ boundColumn = New GridBoundColumn()
+ boundColumn.DataField = "ContactName"
+ boundColumn.HeaderText = "Contact Name"
+ RadGrid1.MasterTableView.Columns.Add(boundColumn)
+
+ RadGrid1.MasterTableView.Columns.Add(New GridExpandColumn())
+
+ + <radg:GridEditCommandColumn ButtonType="ImageButton" UpdateImageUrl="..\Img\Update.gif"+
EditImageUrl="..\Img\Edit.gif" InsertImageUrl="..\Img\Insert.gif"
CancelImageUrl="..\Img\Cancel.gif" UniqueName="EditCommandColumn">
</radg:GridEditCommandColumn> +
+
+
+ |
+
+ <radG:GridTemplateColumn UniqueName="TemplateColumn" SortExpression="CompanyName">+
<FooterTemplate>
<img src="Img/image.gif" alt="" style="vertical-align: middle" />
Template footer
+ </FooterTemplate>
<HeaderTemplate>
+ <table id="Table1" cellspacing="0" cellpadding="0" width="300" border="1">
<tr>
<td colspan="2" align="center">
<b>Contact details</b></td>
</tr>
<tr>
<td style="width: 50%" align="center">
+ <asp:LinkButton CssClass="Button" Width="140" ID="btnContName" Text="Contact name"
+ ToolTip="Sort by ContactName" CommandName='Sort' CommandArgument='ContactName'
+ runat="server" /></td>
<td style="width: 50%" align="center">
+ <asp:LinkButton CssClass="Button" Width="140" ID="btnContTitle" Text="Contact title"
+ ToolTip="Sort by ContactTitle" CommandName='Sort' CommandArgument='ContactTitle'
+ runat="server" /></td>
</tr>
</table>
+ </HeaderTemplate>
<ItemTemplate>
+ <table cellpadding="1" cellspacing="1" class="customTable">
+ <tr>
<td style="width: 50%">
+ </%# Eval("ContactName") /%>
</td>
+ <td style="width: 50%">
+ </%# Eval("ContactTitle") /%>
+ </td>
</tr>
<tr>
+ <td colspan="2" align="center">
+ <a href='</%# "http://www.google.com/search?hl=en&q=" + DataBinder.Eval(Container.DataItem, "ContactName") + "&btnG=Google+Search"/%>'>
+ <em>Search Google for
</%# Eval("ContactName") /%>
+ </em></a>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<img src="Img/image.gif" alt="" />
+ </td>
</tr>
</table>
+ </ItemTemplate>
</radG:GridTemplateColumn> +
++function + GridCreating() +{ +alert("Creting grid with ClientID: " + this.ClientID); +}
+ RadGrid1.ClientSettings.ClientEvents.OnRowContextMenu = " try { ... my event handling code ... } catch (exp) { alert(exp.message); }";
+
+
+ // Get a reference to the control that triggered expand/collapse command
+ protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
+ {
+ if (e.CommandName == RadGrid.ExpandCollapseCommandName)
+ {
+ Control c = e.CommandSource as Control;
+ }
+ }
+
+
+ ' Get a reference to the control that triggered expand/collapse command
+ Protected Sub RadGrid1_ItemCommand([source] As Object, e As GridCommandEventArgs)
+ If e.CommandName = RadGrid.ExpandCollapseCommandName Then
+ Dim c As Control = e.CommandSource
+ End If
+ End Sub 'RadGrid1_ItemCommand
+
+
+ protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
+ {
+ if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
+ {
+ GridEditFormItem item = e.Item as GridEditFormItem;
+ Hashtable newValues = new Hashtable();
+ item.OwnerTableView.ExtractValuesFromItem(newValues, item);
+ if (newValues["Name"].ToString() == "DefaultName")
+ {
+ e.Canceled = true;
+ }
+ }
+ }
+
+
+ Protected Sub RadGrid1_UpdateCommand([source] As Object, e As GridCommandEventArgs)
+ If Typeof e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then
+ Dim item As GridEditFormItem = e.Item
+ Dim newValues As New Hashtable()
+ item.OwnerTableView.ExtractValuesFromItem(newValues, item)
+ If newValues("Name").ToString() = "DefaultName" Then
+ e.Canceled = True
+ End If
+ End If
+ End Sub
+
+
+ protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
+ {
+ if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
+ {
+ GridEditFormItem item = e.Item as GridEditFormItem;
+ Hashtable newValues = new Hashtable();
+ item.OwnerTableView.ExtractValuesFromItem(newValues, item);
+ if (newValues["Name"].ToString() == "DefaultName")
+ {
+ e.Canceled = true;
+ }
+ }
+ }
+
+
+ Protected Sub RadGrid1_UpdateCommand([source] As Object, e As GridCommandEventArgs)
+ If Typeof e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then
+ Dim item As GridEditFormItem = e.Item
+ Dim newValues As New Hashtable()
+ item.OwnerTableView.ExtractValuesFromItem(newValues, item)
+ If newValues("Name").ToString() = "DefaultName" Then
+ e.Canceled = True
+ End If
+ End If
+ End Sub
+
+
+ protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
+ {
+ GridDataItem parentItem = e.DetailTableView.ParentItem as GridDataItem;
+ if (e.DetailTableView.DataSourceID == "AccessDataSource2")
+ {
+ Session["CustomerID"] = parentItem["CustomerID"].Text;
+ }
+ }
+
+
+ Protected Sub RadGrid1_DetailTableDataBind(ByVal source As Object, ByVal e As GridDetailTableDataBindEventArgs) Handles RadGrid1.DetailTableDataBind
+ Dim parentItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
+ If (e.DetailTableView.DataSourceID = "AccessDataSource2") Then
+ Session("CustomerID") = parentItem("CustomerID").Text
+ End If
+ End Sub
+
+
+ protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
+ {
+ GridDataItem parentItem = e.DetailTableView.ParentItem as GridDataItem;
+ if (e.DetailTableView.DataSourceID == "AccessDataSource2")
+ {
+ Session["CustomerID"] = parentItem["CustomerID"].Text;
+ }
+ }
+
+
+ Protected Sub RadGrid1_DetailTableDataBind(ByVal source As Object, ByVal e As GridDetailTableDataBindEventArgs) Handles RadGrid1.DetailTableDataBind
+ Dim parentItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
+ If (e.DetailTableView.DataSourceID = "AccessDataSource2") Then
+ Session("CustomerID") = parentItem("CustomerID").Text
+ End If
+ End Sub
+
+
+ GridGroupByField gridGroupByField;
+
+ gridGroupByField = new GridGroupByField();
+ gridGroupByField.FieldName = "Freight";
+ gridGroupByField.HeaderText = "Total shipping cost is ";
+ gridGroupByField.Aggregate = GridAggregateFunction.Sum;
+ expression.SelectFields.Add( gridGroupByField );
+
+
+ Dim gridGroupByField As GridGroupByField
+
+ gridGroupByField = New GridGroupByField
+ gridGroupByField.FieldName = "Freight"
+ gridGroupByField.HeaderText = "Total shipping cost is "
+ gridGroupByField.Aggregate = GridAggregateFunction.Sum
+ expression.SelectFields.Add(gridGroupByField)
+
+
+ Dim groupExpression As GridGroupByExpression = New GridGroupByExpression()
+
+ Dim groupByField As GridGroupByField = New GridGroupByField()
+
+ groupByField = New GridGroupByField()
+ groupByField.FieldName = "Received"
+ groupExpression.SelectFields.Add(groupByField)
+
+ groupByField = New GridGroupByField()
+ groupByField.FieldName = "Received"
+ groupExpression.GroupByFields.Add(groupByField)
+
+ RadGrid1.MasterTableView.GroupByExpressions.Add(groupExpression)
+
+
+ GridGroupByExpression groupExpression = new GridGroupByExpression();
+
+ GridGroupByField groupByField = new GridGroupByField();
+ groupByField = new GridGroupByField();
+ groupByField.FieldName = "Received";
+ groupExpression.SelectFields.Add(groupByField);
+
+ groupByField = new GridGroupByField();
+ groupByField.FieldName = "Received";
+ groupExpression.GroupByFields.Add(groupByField);
+
+ RadGrid1.MasterTableView.GroupByExpressions.Add(groupExpression);
+
+
+ Dim groupExpression As GridGroupByExpression = New GridGroupByExpression()
+
+ Dim groupByField As GridGroupByField = New GridGroupByField()
+ groupByField.FieldName = "Size"
+ groupByField.SetAggregate(GridAggregateFunction.Sum)
+ groupExpression.SelectFields.Add(groupByField)
+
+ groupByField = New GridGroupByField()
+ groupByField.FieldName = "Received"
+ groupExpression.SelectFields.Add(groupByField)
+
+ groupByField = New GridGroupByField()
+ groupByField.FieldName = "Received"
+ groupExpression.GroupByFields.Add(groupByField)
+
+ RadGrid1.MasterTableView.GroupByExpressions.Add(groupExpression)
+
+
+ GridGroupByExpression groupExpression = new GridGroupByExpression();
+
+ GridGroupByField groupByField = new GridGroupByField();
+ groupByField.FieldName = "Size";
+ groupByField.SetAggregate(GridAggregateFunction.Sum);
+ groupExpression.SelectFields.Add(groupByField);
+
+ groupByField = new GridGroupByField();
+ groupByField.FieldName = "Received";
+ groupExpression.SelectFields.Add(groupByField);
+
+ groupByField = new GridGroupByField();
+ groupByField.FieldName = "Received";
+ groupExpression.GroupByFields.Add(groupByField);
+
+ RadGrid1.MasterTableView.GroupByExpressions.Add(groupExpression);
+
+
+ GridGroupByExpression groupExpression = new GridGroupByExpression();
+
+ groupByField = new GridGroupByField();
+ groupByField.FieldName = "Received";
+ groupExpression.SelectFields.Add(groupByField);
+
+ groupByField = new GridGroupByField();
+ groupByField.FieldName = "Received";
+ groupByField.SetSortOrder(GridSortOrder.Ascending);
+ groupExpression.GroupByFields.Add(groupByField);
+
+ RadGrid1.MasterTableView.GroupByExpressions.Add(groupExpression);
+
+
+ Dim groupExpression As GridGroupByExpression = New GridGroupByExpression()
+
+ Dim groupByField As GridGroupByField = New GridGroupByField()
+
+ groupByField = New GridGroupByField()
+ groupByField.FieldName = "Received"
+ groupExpression.SelectFields.Add(groupByField)
+
+ groupByField = New GridGroupByField()
+ groupByField.FieldName = "Received"
+ groupByField.SetSortOrder(GridSortOrder.Descending)
+ groupExpression.GroupByFields.Add(groupByField)
+
+ RadGrid1.MasterTableView.GroupByExpressions.Add(groupExpression)
+
+
+ Dim groupExpression As GridGroupByExpression = RadGrid1.MasterTableView.GroupByExpressions(0)
+ Dim headerText as String = groupExpression.SelectFields(0).GetHeaderText()
+
+
+ GridGroupByExpression groupExpression = RadGrid1.MasterTableView.GroupByExpressions[0] as GridGroupByExpression;
+ String headerText = groupExpression.SelectFields[0].GetHeaderText()
+
+
+ Dim groupExpression As GridGroupByExpression = RadGrid1.MasterTableView.GroupByExpressions(0)
+ Dim formatString As String = groupExpression.SelectFields(0).GetFormatString()
+
+
+ GridGroupByExpression groupExpression = RadGrid1.MasterTableView.GroupByExpressions[0] As GridGroupByExpression;
+ String formatString = groupExpression.SelectFields[0].GetFormatString()
+
+
+ GridGroupByField gridGroupByField;
+
+ //Add select fields (before the "Group By" clause)
+ gridGroupByField = new GridGroupByField();
+ gridGroupByField.FieldName = "EmployeeID";
+ gridGroupByField.HeaderText = "Employee";
+ expression.SelectFields.Add( gridGroupByField );
+
+ //Add a field for group-by (after the "Group By" clause)
+ gridGroupByField = new GridGroupByField();
+ gridGroupByField.FieldName = "EmployeeID";
+ expression.GroupByFields.Add( gridGroupByField );
+
+
+ Dim gridGroupByField As GridGroupByField
+
+ 'Add select field (before the "Group By" clause)
+ gridGroupByField = New GridGroupByField()
+ gridGroupByField.FieldName = "EmployeeID"
+ gridGroupByField.HeaderText = "Employee"
+ expression.SelectFields.Add(gridGroupByField)
+
+ 'Add a field for group-by (after the "Group By" clause)
+ gridGroupByField = New GridGroupByField()
+ gridGroupByField.FieldName = "EmployeeID"
+ expression.GroupByFields.Add(gridGroupByField)
+
+
+ GridGroupByField gridGroupByField;
+
+ //Add select fields (before the "Group By" clause)
+ gridGroupByField = new GridGroupByField();
+ gridGroupByField.FieldName = "EmployeeID";
+ gridGroupByField.FieldAlias = "EmployeeIdentificator";
+ expression.SelectFields.Add( gridGroupByField );
+
+
+ Dim gridGroupByField As GridGroupByField
+
+ 'Add select fields (before the "Group By" clause)
+ gridGroupByField = New GridGroupByField
+ gridGroupByField.FieldName = "EmployeeID"
+ gridGroupByField.FieldAlias = "EmployeeIdentificator"
+ expression.SelectFields.Add(gridGroupByField)
+
+
+ GridGroupByField gridGroupByField;
+
+ gridGroupByField = new GridGroupByField();
+ gridGroupByField.FieldName = "Freight";
+ gridGroupByField.HeaderText = "Total shipping cost is ";
+ gridGroupByField.Aggregate = GridAggregateFunction.Sum;
+ expression.SelectFields.Add( gridGroupByField );
+
+
+ Dim gridGroupByField As GridGroupByField
+
+ gridGroupByField = New GridGroupByField
+ gridGroupByField.FieldName = "Freight"
+ gridGroupByField.HeaderText = "Total shipping cost is "
+ gridGroupByField.Aggregate = GridAggregateFunction.Sum
+ expression.SelectFields.Add(gridGroupByField)
+
+
+ GridGroupByField gridGroupByField;
+
+ gridGroupByField = new GridGroupByField();
+ gridGroupByField.FieldName = "EmployeeID";
+ gridGroupByField.SortOrder = GridSortOrder.Descending;
+ expression.GroupByFields.Add( gridGroupByField );
+
+
+ Dim gridGroupByField As GridGroupByField
+
+ gridGroupByField = New GridGroupByField
+ gridGroupByField.FieldName = "EmployeeID"
+ gridGroupByField.SortOrder = GridSortOrder.Descending
+ expression.GroupByFields.Add(gridGroupByField)
+
+
+ GridGroupByField gridGroupByField;
+
+ gridGroupByField = new GridGroupByField();
+ gridGroupByField.FieldName = "EmployeeID";
+ gridGroupByField.FormatString = "<strong>{0}</strong>";
+ expression.SelectFields.Add( gridGroupByField );
+
+
+ Dim gridGroupByField As GridGroupByField
+
+ gridGroupByField = New GridGroupByField
+ gridGroupByField.FieldName = "EmployeeID"
+ gridGroupByField.FormatString = "<strong>{0}</strong>"
+ expression.SelectFields.Add(gridGroupByField)
+
+
+ GridGroupByField gridGroupByField;
+
+ gridGroupByField = new GridGroupByField();
+ gridGroupByField.FieldName = "EmployeeID";
+ gridGroupByField.HeaderText = "EmployeeNo";
+ expression.SelectFields.Add( gridGroupByField );
+
+
+ Dim gridGroupByField As GridGroupByField
+
+ gridGroupByField = New GridGroupByField
+ gridGroupByField.FieldName = "EmployeeID"
+ gridGroupByField.HeaderText = "EmployeeNo"
+ expression.SelectFields.Add(gridGroupByField)
+
+
+ GridGroupByField gridGroupByField;
+
+ gridGroupByField = new GridGroupByField();
+ gridGroupByField.FieldName = "EmployeeID";
+ gridGroupByField.HeaderValueSeparator = " for current group: ";
+ expression.SelectFields.Add( gridGroupByField );
+
+
+ Dim gridGroupByField As GridGroupByField
+
+ gridGroupByField = New GridGroupByField
+ gridGroupByField.FieldName = "EmployeeID"
+ gridGroupByField.HeaderValueSeparator = " for current group: "
+ expression.SelectFields.Add(gridGroupByField)
+
+ + <GroupingSettings GroupContinuesFormatString="The group continues on the next page." /> ++
+ <GroupingSettings GroupContinuedFormatString="This group continues from the previous page." /> ++
+ <GroupingSettings ExpandTooltip="Click here to expand the group!" /> ++
+ <GroupingSettings ExpandTooltip="Click here to collapse the group!" /> ++
+ <radG:RadGrid>+
..
<GroupingSettings UnGroupTooltip="Wanna ungroup? Drag me back!" />
</radG:RadGrid> +
+ protected void RadGrid1_GroupsChanging(object source, Telerik.Web.UI.GridGroupsChangingEventArgs e)
+ {
+ if (e.Action == GridGroupsChangingAction.Group)
+ {
+ GridGroupByField countryGroupField = new GridGroupByField();
+ countryGroupField.FieldName = "Country";
+ GridGroupByField cityGroupField = new GridGroupByField();
+ cityGroupField.FieldName = "City";
+
+ e.Expression.SelectFields.Clear();
+ e.Expression.SelectFields.Add(countryGroupField);
+ e.Expression.SelectFields.Add(cityGroupField);
+
+ e.Expression.GroupByFields.Clear();
+ e.Expression.GroupByFields.Add(countryGroupField);
+ e.Expression.GroupByFields.Add(cityGroupField);
+ ...
+ }
+ }
+
+
+ Protected Sub RadGrid1_GroupsChanging(ByVal source As Object, ByVal e As Telerik.Web.UI.GridGroupsChangingEventArgs)
+ 'Expression is added (by drag/grop on group panel)
+ If (e.Action = GridGroupsChangingAction.Group) Then
+ Dim countryGroupField As GridGroupByField = New GridGroupByField
+ countryGroupField.FieldName = "Country"
+ Dim cityGroupField As GridGroupByField = New GridGroupByField
+ cityGroupField.FieldName = "City"
+ e.Expression.SelectFields.Clear
+ e.Expression.SelectFields.Add(countryGroupField)
+ e.Expression.SelectFields.Add(cityGroupField)
+ e.Expression.GroupByFields.Clear
+ e.Expression.GroupByFields.Add(countryGroupField)
+ e.Expression.GroupByFields.Add(cityGroupField)
+ End If
+ End Sub
+
+
+ //get MasterTableView's second (index 1) nested view item
+ GridNestedViewItem firstLevelNestedViewItem = (GridNestedViewItem)RadGrid1.MasterTableView.GetItems(GridItemType.NestedView)[1];
+ //get second nested view item at level 2 of the hierarchy
+ GridNestedViewItem secondLevelNestedViewItem = (GridNestedViewItem)firstLevelNestedViewItem.NestedTableViews[0].GetItems(GridItemType.NestedView)[1];
+ //get the first item to be expanded
+ GridItem itemToExpand = secondLevelNestedViewItem.NestedTableViews[0].GetItems(GridItemType.Item)[0];
+ itemToExpand.ExpandHierarchyToTop();
+
+
+ 'get MasterTableView's second (index 1) nested view item
+ Dim firstLevelNestedViewItem As GridNestedViewItem = CType(RadGrid1.MasterTableView.GetItems(GridItemType.NestedView)(1), GridNestedViewItem)
+ 'get second nested view item at level 2 of the hierarchy
+ Dim secondLevelNestedViewItem As GridNestedViewItem = CType(firstLevelNestedViewItem.NestedTableViews(0).GetItems(GridItemType.NestedView)(1), GridNestedViewItem)
+ 'get the first item to be expanded
+ Dim itemToExpand As GridItem = secondLevelNestedViewItem.NestedTableViews(0).GetItems(GridItemType.Item)(0)
+ itemToExpand.ExpandHierarchyToTop()
+
+
+ protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ GridTableView tableview = RadGrid1.SelectedItems[0].OwnerTableView;
+ }
+
+
+ Protected Sub RadGrid1_SelectedIndexChanged(sender As Object, e As EventArgs)
+ Dim tableview As GridTableView = RadGrid1.SelectedItems(0).OwnerTableView
+ End Sub
+
+
+ protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Label1.Text = RadGrid1.SelectedItems[0].OwnerID;
+ }
+
+
+ Protected Sub RadGrid1_SelectedIndexChanged(sender As Object, e As EventArgs)
+ Label1.Text = RadGrid1.SelectedItems(0).OwnerID
+ End Sub
+
+
+ protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
+ {
+ if (e.Item is GridEditableItem && e.Item.IsInEditMode)
+ {
+ Response.Write(e.Item.OwnerGridID);
+
+ }
+ }
+
+
+ Protected Sub RadGrid1_ItemCreated(sender As Object, e As GridItemEventArgs)
+ If Typeof e.Item Is GridEditableItem And e.Item.IsInEditMode Then
+ Response.Write(e.Item.OwnerGridID)
+ End If
+ End Sub
+
+
+ protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
+ {
+ if (e.Item is GridItem && (e.Item as GridItem).HasChildItems == true)
+ {
+ Label1.Text = "has items";
+ }
+ }
+
+
+ Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs)
+ If (Typeof e.Item Is GridItem AndAlso CType(e.Item, GridItem).HasChildItems = True) Then
+ Label1.Text = "has items"
+ End If
+ End Sub
+
+
+ protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
+ {
+ if (e.Item is GridItem && (e.Item as GridItem).CanExpand == true)
+ {
+ Label1.Text = "Item was expanded";
+ }
+ }
+
+
+ Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs)
+ If (Typeof e.Item Is GridItem AndAlso CType(e.Item, GridItem).CanExpand = True)
+ Label1.Text = "Item was expanded"
+ End If
+ End Sub
+
+
+ protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Response.Write(RadGrid1.SelectedItems[0].ItemIndexHierarchical);
+ }
+
+
+ Protected Sub RadGrid1_SelectedIndexChanged(sender As Object, e As EventArgs)
+ Response.Write(RadGrid1.SelectedItems(0).ItemIndexHierarchical)
+ End Sub 'RadGrid1_SelectedIndexChanged
+
+
+ foreach (GridDataItem dataItem in rgdStateRules.MasterTableView.Items)
+ {
+ if (dataItem.ItemType == GridItemType.Item ||
+ dataItem.ItemType == GridItemType.AlternatingItem)
+ {
+ string reqName = dataItem["SomeColumnUniqueName"]. Text;
+ ....
+ }
+ }
+
+
+ Dim dataItem As GridDataItem
+ For Each dataItem In rgdStateRules.MasterTableView.Items
+ If dataItem.ItemType = GridItemType.Item Or dataItem.ItemType = GridItemType.AlternatingItem Then
+ Dim reqName As String = dataItem("SomeColumnUniqueName").Text
+ End If
+ Next dataItem
+
+
+ for(int i = 0; i < RadGrid.Items.Count - 1;i++)
+ if(RadGrid.Items[i].Expanded)
+ {
+ RadGrid.Items[i].Expanded = false;
+ }
+
+
+ Dim i As Integer
+ For i = 0 To (RadGrid.Items.Count - 1) Step -1
+ If RadGrid.Items(i).Expanded Then
+ RadGrid.Items(i).Expanded = False
+ End If
+ Next i
+
+
+ if (e.Item is GridCommandItem)
+ {
+ e.Item.Display = false;
+ }
+
+
+ If Typeof e.Item Is GridCommandItem Then
+ e.Item.Display = False
+ End If
+
+
+ protected void RadGrid1_PreRender(object sender, EventArgs e)
+ {
+ foreach (GridDataItem dataitem in RadGrid1.MasterTableView.Items)
+ {
+ if (dataitem.Selected == true)
+ {
+ //do your thing
+ }
+ }
+ }
+
+
+ Protected Sub RadGrid1_PreRender(sender As Object, e As EventArgs)
+ Dim dataitem As GridDataItem
+ For Each dataitem In RadGrid1.MasterTableView.Items
+ If dataitem.Selected = True Then
+ 'do your thing
+ End If
+ Next dataitem
+ End Sub 'RadGrid1_PreRender
+
+
+ if (e.Item.GroupIndex == EditItemGroupIndex | EditItemGroupIndex.StartsWith(e.Item.GroupIndex + "_"))
+ {
+ e.Item.Expanded = true;
+ }
+
+
+ If e.Item.GroupIndex = EditItemGroupIndex Or EditItemGroupIndex.StartsWith(e.Item.GroupIndex & "_") Then
+ e.Item.Expanded = True
+ End If
+
+
+ if (e.Item is GridEditableItem && e.Item.IsInEditMode)
+ {
+ TextBox txt = (e.Item as GridEditableItem)["SomeColumnName"].Controls[0] as TextBox;
+ }
+
+
+ If Typeof e.Item Is GridEditableItem And e.Item.IsInEditMode Then
+ ...
+ End If
+
+
+ GridEditManager editMan = editedItem.EditManager;
+ IGridEditableColumn editableCol = (column as IGridEditableColumn);
+ IGridColumnEditor editor = editMan.GetColumnEditor( editableCol );
+
+
+ Dim editMan As GridEditManager = editedItem.EditManager
+ Dim editableCol As IGridEditableColumn = CType(column, IGridEditableColumn)
+ Dim editor As IGridColumnEditor = editMan.GetColumnEditor(editableCol)
+
+
+ foreach (DictionaryEntry entry in newValues)
+ {
+ Label1.Text += "\n<br />Key: " + entry.Key + "<br />New value: " + entry.Value + "<br /> Old value: " + editedItem.SavedOldValues[entry.Key] + "<br />";
+ }
+
+
+
+
+ For Each entry As DictionaryEntry In newValues
+ Label1.Text += "" & Microsoft.VisualBasic.Chr(10) & "<br />Key: " + entry.Key + "<br />New value: " + entry.Value + "<br /> Old value: " + editedItem.SavedOldValues(entry.Key) + "<br />"
+ Next
+
+
+ string keyValues = ((GridEditableItem)e.Item).KeyValues;
+ if (keyValues.Contains("CustomerID"))
+ Session["CustomerID"] = keyValues.Substring(13, keyValues.Length - 1);
+ else
+ Session["OrderID"] = keyValues.Substring(10, keyValues.Length - 1);
+
+
+ Dim keyValues As String = CType(e.Item, GridEditableItem).KeyValues
+ If keyValues.Contains("CustomerID") Then
+ Session("CustomerID") = keyValues.Substring(13, keyValues.Length - 1)
+ Else
+ Session("OrderID") = keyValues.Substring(10, keyValues.Length - 1)
+ End If
+
+
+ protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
+ {
+ if (e.Item is GridDataItem)
+ {
+ GridDataItem dataItem = (GridDataItem) e.Item;
+ ((Button) dataItem["MyTemplateColumn"].Controls[0]).OnClientClick =
+ dataItem.ClientFireCommandFunction("MyCommandName", "");
+ }
+ }
+
+
+ Protected Sub RadGrid1_ItemCreated(sender As Object, e As GridItemEventArgs) Handles RadGrid1.ItemCreated
+ If Typeof e.Item Is GridFilteringItem Then
+ Dim filteringItem As GridFilteringItem = CType(e.Item, GridFilteringItem)
+
+ 'set dimensions for the filter textbox
+ Dim box As TextBox = CType(filteringItem("ContactName").Controls(0), TextBox)
+ box.Width = Unit.Pixel(30)
+
+ 'set ImageUrl which points to your custom image
+ Dim image As Image = CType(filteringItem("ContactName").Controls(1), Image)
+ image.ImageUrl = "<my_image_url>"
+ End If
+ End Sub 'RadGrid1_ItemCreated
+
+
+ Protected void RadGrid1_ItemCreated(Object sender, GridItemEventArgs e)
+ {
+ If (e.Item Is GridFilteringItem)
+ {
+ GridFilteringItem filteringItem = e.Item As GridFilteringItem;
+
+ //Set dimensions For the filter textbox
+ TextBox box = filteringItem["ContactName"].Controls[0] As TextBox;
+ box.Width = Unit.Pixel(30);
+
+ //Set ImageUrl which points To your custom image
+ Image image = filteringItem["ContactName"].Controls[1] As Image;
+ image.ImageUrl = "<my_image_url>";
+ }
+ }
+
+
+ Private Sub RadGrid1_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs)
+ If Typeof e.Item Is GridGroupHeaderItem Then
+ Dim item As GridGroupHeaderItem = CType(e.Item, GridGroupHeaderItem)
+ 'do something here
+ End If
+ End Sub 'RadGrid1_ItemDataBound
+
+
+ private void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
+ {
+ if ( e.Item is GridGroupHeaderItem )
+ {
+ GridGroupHeaderItem item = (GridGroupHeaderItem)e.Item;
+ //do something here
+ }
+ }
+ }
+
+
+ Dim groupHeader As GridGroupHeaderItem = RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader)(0)
+ Dim groupItems As GridItem() = groupHeader.GetChildItems()
+ 'traverse the items and operate with them further
+
+
+ GridGroupHeaderItem groupHeader= RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader)[0] as GridGroupHeaderItem;
+ GridItem [] groupItems = groupHeader.GetChildItems();
+ //traverse the items and operate with them further
+
+
+ Dim groupHeader As GridGroupHeaderItem = RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader)(0)
+ groupHeader.SetVisibleChildren(False)
+
+
+ GridGroupHeaderItem groupHeader = RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader)[0] as GridGroupHeaderItem;
+ groupHeader.SetVisibleChildren(false);
+
+
+ Private Sub RadGrid1_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs)
+ If Typeof e.Item Is GridGroupHeaderItem Then
+ Dim item As GridGroupHeaderItem = CType(e.Item, GridGroupHeaderItem)
+ Dim groupDataRow As DataRowView = CType(e.Item.DataItem, DataRowView)
+
+ 'Clear the present text of the cell
+ item.DataCell.Text = ""
+ Dim column As DataColumn
+ For Each column In groupDataRow.DataView.Table.Columns
+
+ 'Check the condition and add only the field you need
+ If column.ColumnName = "Country" Then
+ item.DataCell.Text += "Customized display - Country is " + groupDataRow("Country").ToString()
+ End If
+ Next column
+ End If
+ End Sub 'RadGrid1_ItemDataBound
+
+
+ Private void RadGrid1_ItemDataBound(Object sender, Telerik.Web.UI.GridItemEventArgs e)
+ {
+ If ( e.Item Is GridGroupHeaderItem )
+ {
+ GridGroupHeaderItem item = (GridGroupHeaderItem)e.Item;
+ DataRowView groupDataRow = (DataRowView)e.Item.DataItem;
+
+ //Clear the present text of the cell
+ item.DataCell.Text = "";
+ foreach( DataColumn column In groupDataRow.DataView.Table.Columns)
+
+ //Check the condition And add only the field you need
+ If ( column.ColumnName == "Country" )
+ {
+ item.DataCell.Text += "Customized display - Country is " + groupDataRow
+ ["Country"].ToString();
+ }
+ }
+ }
+
+
+ Dim groupHeader As GridGroupHeaderItem = grid.MasterTableView.GetItems(GridItemType.GroupHeader)(0)
+ If (groupHeader.HasChildItems) Then
+ 'operate with the items
+ Else
+ 'do something else
+ End If
+
+
+ GridGroupHeaderItem groupHeader = grid.MasterTableView.GetItems(GridItemType.GroupHeader)[0] as GridGroupHeaderItem;
+ if (groupHeader.HasChildItems)
+ {
+ //operate with the items
+ }
+ else
+ {
+ //do something else
+ }
+
+
+ foreach (GridNestedViewItem nestedViewItem in radgrid1.MasterTableView.GetItems(GridItemType.NestedView))
+ {
+ TableCell cell = nestedViewItem.NestedViewCell;
+ cell.BorderColor = System.Drawing.Color.Red;
+ }
+
+
+ Dim nestedViewItem As GridNestedViewItem
+ For Each nestedViewItem In RadGrid1.MasterTableView.GetItems(GridItemType.NestedView)
+ Dim cell As TableCell = nestedViewItem.NestedViewCell
+ cell.BorderColor = System.Drawing.Color.Red
+ Next nestedViewItem
+
+
+ GridTableView nestedTable = RadGrid1.MasterTableView.Items[0].ChildItem.NestedTableViews[0];
+
+
+ Dim nestedTable As GridTableView = RadGrid1.MasterTableView.Items(0).ChildItem.NestedTableViews(0)
+
+
+ protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
+ {
+ if (e.Item is GridPagerItem)
+ {
+ GridPagerItem gridPager = e.Item as GridPagerItem;
+ Control numericPagerControl = gridPager.GetNumericPager();
+ gridPager.Controls[0].Controls.Add(numericPagerControl);
+ }
+ }
+
+
+ Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)
+ If Typeof e.Item Is GridPagerItem Then
+ Dim gridPager As GridPagerItem = TryCast(e.Item, GridPagerItem)
+ Dim numericPagerControl As Control = gridPager.GetNumericPager()
+ gridPager.Controls(0).Controls.Add(numericPagerControl)
+ End If
+ End Sub
+
+
+ if (((GridPagerItem)this.Item).IsTopPager)
+ {
+ Item.Visible = false;
+ return;
+ }
+
+
+ If CType(Me.Item, GridPagerItem).IsTopPager Then
+ Item.Visible = False
+ Return
+ End If
+
+
+ if (e.Item is GridPagerItem)
+ {
+ GridPagerItem pagerItem = (e.Item as GridPagerItem);
+ pagerItem.PagerContentCell.Controls.Clear();
+ //custom paging
+ }
+
+
+ If Typeof e.Item Is GridPagerItem Then
+ Dim pagerItem As GridPagerItem = CType(e.Item, GridPagerItem)
+ pagerItem.PagerContentCell.Controls.Clear
+ 'custom paging
+ End If
+
+ + <radG:RadGrid ID="RadGrid1" EnableAJAX="True" ShowHeader="true" runat="server" Skin="None"+
Width= "97%" GridLines="None" OnColumnCreated="RadGrid1_ColumnCreated"
OnItemCreated="RadGrid1_ItemCreated"
OnNeedDataSource= "RadGrid1_NeedDataSource">
<MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" EnableNoRecordsTemplate="false"
+ DataKeyNames= "ID,ParentID" Width="100%">
<SelfHierarchySettings ParentKeyName="ParentID" KeyName="ID" />
</MasterTableView>
<ClientSettings AllowExpandCollapse="true" /> + </radG:RadGrid> +
+ <radG:RadGrid ID="RadGrid1" EnableAJAX="True" ShowHeader="true" runat="server" Skin="None"+
Width= "97%" GridLines="None" OnColumnCreated="RadGrid1_ColumnCreated"
OnItemCreated="RadGrid1_ItemCreated"
OnNeedDataSource= "RadGrid1_NeedDataSource">
<MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" EnableNoRecordsTemplate="false"
+ DataKeyNames= "ID,ParentID" Width="100%">
<SelfHierarchySettings ParentKeyName="ParentID" KeyName="ID" />
</MasterTableView>
<ClientSettings AllowExpandCollapse="true" /> +
+ </radG:RadGrid> ++
| Gets an object that can be used to synchronize access to the + GirdSortExpressionCollection. | +
+
+ <MasterTableView GroupLoadMode="Server">
+ |
+
+ <MasterTableView GroupLoadMode="Client">
+ |
+
+ <ClientSettings AllowGroupExpandCollapse="True">
+ |
+
+
+ |
+

+
+
+ |
+
+ protected void RadGrid1_PreRender(object sender, System.EventArgs e)
+ {
+ RadGrid1.MasterTableView.GetColumn( "CustomerID" ).Visible = false;
+ }
+
+ + [C#]+
private void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.InitInsertCommandName)
+ {
e.Canceled = true;
+ e.Item.OwnerTableView.InsertItem();
GridEditableItem insertedItem = e.Item.OwnerTableView.GetInsertItem();
+ GridEditFormItem editFormItem = insertedItem as GridEditFormItem;
TextBox box = editFormItem.FindControl("txtEmployeeID") as TextBox;
box.Text = "11";
}
} +
++
[VB.NET] +
+ Private Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand+
If (e.CommandName = RadGrid.InitInsertCommandName) Then
+ e.Canceled = True
e.Item.OwnerTableView.InsertItem()
Dim insertedItem As GridEditableItem = e.Item.OwnerTableView.GetInsertItem()
+ Dim editFormItem As GridEditFormItem = CType(insertedItem, GridEditFormItem)
Dim box As TextBox = CType(MyUserControl.FindControl("insertedItem"), TextBox)
box.Text = "11"
End If
End Sub +
+ protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)+
{
GridDataInsertItem gridDataInsertItem =
(GridDataInsertItem)(RadGrid1.MasterTableView.GetInsertItem());
+ Hashtable ht = new Hashtable();
gridDataInsertItem.ExtractValues(ht);
//Loop through each "DictionaryEntry" in hash table and insert using key value
foreach (DictionaryEntry ent in ht)
+ {
//get the key values and insert to custom datasource.
} +
} +
+ Protected Sub RadGrid1_InsertCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)+
Dim gridDataInsertItem As GridDataInsertItem = CType(RadGrid1.MasterTableView.GetInsertItem,GridDataInsertItem)
+ Dim ht As Hashtable = New Hashtable
gridDataInsertItem.ExtractValues(ht)
'Loop through each "DictionaryEntry" in hash table and insert using key value
For Each ent As DictionaryEntry In ht
+ 'get the key values and insert to custom datasource.
Next
End Sub +
+ RadGrid1.GridLines = GridLines.None
+
+
+ RadGrid1.GridLines = GridLines.None;
+
+
+ RadGrid1.HorizontalAlign = HorizontalAlign.Right
+
+
+ RadGrid1.HorizontalAlign = HorizontalAlign.Right;
+
+
+ protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
+ {
+ if (e.Exception != null)
+ {
+ e.KeepInEditMode = true;
+ e.ExceptionHandled = true;
+ Response.Write("Employee " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"] + " cannot be updated. Reason: " + e.Exception.Message);
+ }
+ else
+ {
+ Response.Write("Employee " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"] + " updated");
+ }
+ }
+
+
+ int eID = (int)tableView.DataKeyValues[editedItem.ItemIndex]["EmployeeID"];
+
+
+ Dim eID as Integer = (CInt)tableView.DataKeyValues(editedItem.ItemIndex)("EmployeeID")
+
+
+ Protected Sub RadGrid1_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles RadGrid1.ItemUpdated
+ If Not e.Exception Is Nothing Then
+ e.KeepInEditMode = True
+ e.ExceptionHandled = True
+ Response.Write("Employee " + e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("EmployeeID").ToString() + " cannot be updated. Reason: " + e.Exception.Message)
+ Else
+ Response.Write("Employee " + e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("EmployeeID").ToString() + " updated")
+ End If
+ End Sub
+
+
+ RadGrid1.MasterTableView.NoRecordsTemplate = New NoRecordsTemplate()
+
+ Public Class NoRecordsTemplate
+ Implements ITemplate
+
+ Public Sub New()
+ End Sub
+
+ Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn
+ Dim lbl As Label = New Label()
+ lbl.ID = "Label1"
+ lbl.Text = "Currently there are no items in this folder."
+ lbl.ForeColor = System.Drawing.Color.RoyalBlue
+ container.Controls.Add(lbl)
+ End Sub
+ End Class
+
+
+ RadGrid1.MasterTableView.NoRecordsTemplate = new NoRecordsTemplate();
+
+ class NoRecordsTemplate: ITemplate
+ {
+ public NoRecordsTemplate()
+ {
+ }
+
+ public void InstantiateIn(Control container)
+ {
+ Label lbl = new Label();
+ lbl.ID = "Label1";
+ lbl.Text = "Currently there are no items in this folder.";
+ lbl.ForeColor = System.Drawing.Color.RoyalBlue;
+ container.Controls.Add(lbl);
+ }
+ }
+
+
+ If (Not Page.IsPostBack) Then
+ RadGrid1.MasterTableView.FilterExpression = "([Country] LIKE '<see cref="Germany"/>') "
+
+ Dim column As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("Country")
+ column.CurrentFilterFunction = GridKnownFunction.Contains
+ column.CurrentFilterValue = "Germany"
+ End If
+
+
+ if (!Page.IsPostBack)
+ {
+ RadGrid1.MasterTableView.FilterExpression = "([Country] LIKE \'<see cref="Germany"/>\') ";
+
+ GridColumn column = RadGrid1.MasterTableView.GetColumnSafe("Country");
+ column.CurrentFilterFunction = GridKnownFunction.Contains;
+ column.CurrentFilterValue = "Germany";
+ }
+
+
+
+ |
+
+ |
+
+ |
+
+
+ |
+

+
+
+ |
+
+ The following example demonstrates how to style the Caption of a MasterTableView and detail GridTableView. ++
+ <head runat="server">+
<title>Untitled Page</title>
<style type="text/css">
+ .MasterTable_Default caption
{
color: red;
} +
+ .DetailTable_Default caption+
{
color: blue;
}
+
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<radG:RadGrid runat="server" ID="RadGrid1" DataSourceID="SqlDataSource1" AllowPaging="true"
AllowMultiRowEdit="true" OnItemCommand="RadGrid1_ItemCommand" >
<MasterTableView EditMode="EditForms" DataKeyNames="CustomerID" Caption="Master Caption" CommandItemDisplay="Top">
+ <Columns>
<radG:GridEditCommandColumn>
</radG:GridEditCommandColumn>
</Columns>
<DetailTables>
<radG:GridTableView DataKeyNames="OrderID" DataSourceID="SqlDataSource2" Caption="Detail Caption" CssClass="DetailTable_Default">
<ParentTableRelation>
<radG:GridRelationFields DetailKeyField="CustomerID" MasterKeyField="CustomerID" />
</ParentTableRelation>
</radG:GridTableView>
</DetailTables>
</MasterTableView>
</radG:RadGrid>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="</%$ ConnectionStrings:NorthwindConnectionString2/%>"
SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [ContactTitle] FROM [Customers]">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="</%$ ConnectionStrings:NorthwindConnectionString2/%>"
SelectCommand="SELECT [OrderID], [CustomerID], [ShipCountry] FROM [Orders] WHERE ([CustomerID] = @CustomerID)">
<SelectParameters>
<asp:Parameter Name="CustomerID" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</form>
</body> +
+ RadGrid1.SelectedItemStyle.BackColor = System.Drawing.Color.Azure
+
+
+ RadGrid1.SelectedItemStyle.BackColor = System.Drawing.Color.Azure;
+
+
+ Country, City, count(Country) Items, ContactName Group By Country, City desc
+
+
+ Country, City, count(Country) Items, ContactName Group By Country, City desc
+
+
+ protected void RadGrid1_PreRender(object sender, System.EventArgs e)
+ {
+ TableCell cell;
+
+ foreach (cell in RadGrid1.GroupPanel.GroupPanelItems)
+ {
+ Control ctrl;
+ foreach (ctrl in cell.Controls)
+ {
+ if (ctrl is ImageButton)
+ {
+ ImageButton button = ctrl as ImageButton;
+ button.ImageUrl = "<my_img_url>";
+ button.CausesValidation = false;
+ }
+ }
+ }
+ }
+
+
+ Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.PreRender
+ Dim cell As TableCell
+
+ For Each cell In RadGrid1.GroupPanel.GroupPanelItems
+ Dim ctrl As Control
+ For Each ctrl In cell.Controls
+ If (Typeof ctrl Is ImageButton) Then
+ Dim button As ImageButton = CType(ctrl, ImageButton)
+ button.ImageUrl = "<my_img_url>"
+ button.CausesValidation = False
+ End If
+ Next ctrl
+ Next cell
+ End Sub
+
+
+ protected void RadGrid1_PreRender(object sender, System.EventArgs e)
+ {
+ TableCell cell;
+
+ foreach (cell in RadGrid1.GroupPanel.GroupPanelItems)
+ {
+ Control ctrl;
+ foreach (ctrl in cell.Controls)
+ {
+ if (ctrl is ImageButton)
+ {
+ ImageButton button = ctrl as ImageButton;
+ button.ImageUrl = "<my_img_url>";
+ button.CausesValidation = false;
+ }
+ }
+ }
+ }
+
+
+ Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.PreRender
+ Dim cell As TableCell
+
+ For Each cell In RadGrid1.GroupPanel.GroupPanelItems
+ Dim ctrl As Control
+ For Each ctrl In cell.Controls
+ If (Typeof ctrl Is ImageButton) Then
+ Dim button As ImageButton = CType(ctrl, ImageButton)
+ button.ImageUrl = "<my_img_url>"
+ button.CausesValidation = False
+ End If
+ Next ctrl
+ Next cell
+ End Sub
+
+ + <GroupPanel Text="Drag here the column you need to group by."></GroupPanel> ++
+ <GroupPanel Text="Drag a column here.">+
<PanelStyle BackColor="Aqua" BorderStyle="Dotted" />
</GroupPanel> +
+ <GroupPanel Text="Drag a column here.">+
<PanelStyle BackColor="Aqua" BorderStyle="Dotted" />
<PanelItemsStyle BackColor="Black" Font-Italic="true"/>
</GroupPanel> +
+ private void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ RadMenu1.LoadContentFile("~/Menu/Examples/Menu.xml");
+ }
+ }
+
+
+ Private Sub Page_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+ If Not Page.IsPostBack Then
+ RadMenu1.LoadContentFile("~/Menu/Examples/Menu.xml")
+ End If
+ End Sub
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ foreach (RadMenuItem item in RadMenu1.GetAllItems())
+ {
+ item.Enabled = false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ For Each childItem As RadMenuItem In RadMenu1.GetAllItems
+ childItem.Enabled = False
+ Next
+ End Sub
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadMenu1.FindItem(ItemWithEqualsTextAndValue);
+ }
+ private static bool ItemWithEqualsTextAndValue(RadMenuItem item)
+ {
+ if (item.Text == item.Value)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
+ RadMenu1.FindItem(ItemWithEqualsTextAndValue)
+ End Sub
+ Private Shared Function ItemWithEqualsTextAndValue(ByVal item As RadMenuItem) As Boolean
+ If item.Text = item.Value Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+
+ foreach (ClientOperation<RadMenuItem> operation in RadToolBar1.ClientChanges)
+ {
+ RadMenuItem item = operation.Item;
+
+ switch (operation.Type)
+ {
+ case ClientOperationType.Insert:
+ //An item has been inserted - operation.Item contains the inserted item
+ break;
+ case ClientOperationType.Remove:
+ //An item has been inserted - operation.Item contains the removed item.
+ //Keep in mind the item has been removed from the menu.
+ break;
+ case ClientOperationType.Update:
+ UpdateClientOperation<RadMenuItem> update = operation as UpdateClientOperation<RadMenuItem>
+ //The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
+ break;
+ case ClientOperationType.Clear:
+ //All children of have been removed - operation.Item contains the parent item whose children have been removed. If operation.Item is null then the root items have been removed.
+ break;
+ }
+ }
+
+
+ For Each operation As ClientOperation(Of RadMenuItem) In RadToolBar1.ClientChanges
+ Dim item As RadMenuItem = operation.Item
+ Select Case operation.Type
+ Case ClientOperationType.Insert
+ 'An item has been inserted - operation.Item contains the inserted item
+ Exit Select
+ Case ClientOperationType.Remove
+ 'An item has been inserted - operation.Item contains the removed item.
+ 'Keep in mind the item has been removed from the menu.
+ Exit Select
+ Case ClientOperationType.Update
+ Dim update As UpdateClientOperation(Of RadMenuItem) = TryCast(operation, UpdateClientOperation(Of RadMenuItem))
+ 'The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
+ Exit Select
+ Case ClientOperationType.Clear
+ 'All children of have been removed - operation.Item contains the parent item whose children have been removed. If operation.Item is Nothing then the root items have been removed.
+ Exist Select
+ End Select
+ Next
+
+
+ RadMenu1.Items[0].Text = "Example";
+ RadMenu1.Items[0].NavigateUrl = "http://www.example.com";
+
+
+ RadMenu1.Items(0).Text = "Example"
+ RadMenu1.Items(0).NavigateUrl = "http://www.example.com"
+
+ ++<ItemTemplate> +++<asp:CheckBox runat="server" + ID="CheckBox"></asp:CheckBox> +
+ <asp:Label runat="server" ID="Label1"++Text='<%# DataBinder.Eval(Container, "Text") %>' +></asp:Label> +</ItemTemplate> +<Items> +++<telerik:RadMenuItem Text="News" /> +<telerik:RadMenuItem Text="Sports" /> +<telerik:RadMenuItem Text="Games" /> +</Items> +
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadMenu1.ExpandAnimation.Type = AnimationType.Linear;
+ RadMenu1.ExpandAnimation.Duration = 300;
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ RadMenu1.ExpandAnimation.Type = AnimationType.Linear
+ RadMenu1.ExpandAnimation.Duration = 300
+ End Sub
+
+
+
+
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadMenu1.CollapseAnimation.Type = AnimationType.Linear;
+ RadMenu1.CollapseAnimation.Duration = 300;
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ RadMenu1.CollapseAnimation.Type = AnimationType.Linear
+ RadMenu1.CollapseAnimation.Duration = 300
+ End Sub
+
+
+ [ScriptService]
+ public class WebServiceName : WebService
+ {
+ [WebMethod]
+ public RadMenuItemData[] WebServiceMethodName(RadMenuItemData item, object context)
+ {
+ // We cannot use a dictionary as a parameter, because it is only supported by script services.
+ // The context object should be cast to a dictionary at runtime.
+ IDictionary<string, object> contextDictionary = (IDictionary<string, object>) context;
+
+ //...
+ }
+ }
+
+
+ private void RadMenu1_ItemCreated(object sender, Telerik.WebControls.RadMenuItemEventArgs e)
+ {
+ e.Item.ToolTip = e.Item.Text;
+ }
+
+
+ Sub RadMenu1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.WebControls.RadMenuItemEventArgs) Handles RadMenu1.ItemCreated
+ e.Item.ToolTip = e.Item.Text
+ End Sub
+
+
+ private void RadMenu1_ItemDataBound(object sender, Telerik.WebControls.RadMenuEventArgs e)
+ {
+ RadMenuItem item = e.RadMenuItem;
+ DataRowView dataRow = (DataRowView) e.Item.DataItem;
+
+ item.ImageUrl = "image" + dataRow["ID"].ToString() + ".gif";
+ item.NavigateUrl = dataRow["URL"].ToString();
+ }
+
+
+ Sub RadMenu1_ItemDataBound(ByVal sender As Object, ByVal e As RadMenuEventArgs) Handles RadMenu1.ItemDataBound
+ Dim item As RadMenuItem = e.RadMenuItem
+ Dim dataRow As DataRowView = CType(e.Item.DataItem, DataRowView)
+
+ item.ImageUrl = "image" + dataRow("ID").ToString() + ".gif"
+ item.NavigateUrl = dataRow("URL").ToString()
+ End Sub
+
+ + <radG:GridTemplateColumn UniqueName="TemplateColumn"> ++
+ <EditItemTemplate> ++
+ <asp:LinkButton runat="server" ID="Cancel" Text="Cancel Edit" CommandName="Cancel"> ++
+ </asp:LinkButton> ++
+ </EditItemTemplate> ++
+ </radG:GridTemplateColumn> ++
+ <radG:GridTemplateColumn UniqueName="TemplateColumn"> ++
+ <ItemTemplate> ++
+ <asp:LinkButton runat="server" ID="Delete" Text="Delete" CommandName="Delete"> ++
+ </asp:LinkButton> ++
+ </ItemTemplate> ++
+ </radG:GridTemplateColumn> ++
+ <radG:GridTemplateColumn UniqueName="TemplateColumn"> ++
+ <ItemTemplate> ++
+ <asp:LinkButton runat="server" ID="Edit" Text="Edit" CommandName="Edit"> ++
+ </asp:LinkButton> ++
+ </ItemTemplate> ++
+ </radG:GridTemplateColumn> ++
+ <CommandItemTemplate> ++
+ <asp:LinkButton runat="server" ID="AddNew" Text="Add new record" CommandName="InitInsert"> ++
+ </asp:LinkButton> ++
+ </CommandItemTemplate> ++
+ <radG:GridTemplateColumn UniqueName="TemplateColumn"> ++
+ <EditItemTemplate> ++
+ <asp:LinkButton runat="server" ID="Update" Text="Update" CommandName="Update"> ++
+ </asp:LinkButton> ++
+ </EditItemTemplate> ++
+ </radG:GridTemplateColumn> ++
+ <CommandItemTemplate> ++
+ <asp:LinkButton runat="server" ID="UpdateEdited" Text="Update Edited" CommandName="UpdateEdited"> ++
+ </asp:LinkButton> ++
+ </CommandItemTemplate> ++
+ <CommandItemTemplate> ++
+ <asp:LinkButton runat="server" ID="DeleteSelected" Text="Delete Selected" CommandName="DeleteSelected"> ++
+ </asp:LinkButton> ++
+ </CommandItemTemplate> ++
+ <%@ Page Language="VB" @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+
+ Protected Sub RadGrid1_CancelCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
+ Response.Write("Cancel")
+ End Sub
+
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server" OnCancelCommand="RadGrid1_CancelCommand" >
+ <MasterTableView>
+ <Columns>
+ <radG:GridEditCommandColumn>
+ </radG:GridEditCommandColumn>
+ </Columns>
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+
+ Protected Sub RadGrid1_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
+ Response.Write("Delete")
+ End Sub
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server" OnDeleteCommand="RadGrid1_DeleteCommand" >
+ <MasterTableView>
+ <Columns>
+ <radG:GridButtonColumn Text="Delete" CommandName="Delete" UniqueName="Delete"></radG:GridButtonColumn>
+ </Columns>
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+
+ Protected Sub RadGrid1_EditCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
+ Response.Write("Edit")
+ End Sub
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server" OnEditCommand="RadGrid1_EditCommand" >
+ <MasterTableView>
+ <Columns>
+ <radG:GridEditCommandColumn>
+ </radG:GridEditCommandColumn>
+ </Columns>
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" <see cref="> <"/>@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+
+
+ Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)
+ If e.Item.ItemType = GridItemType.AlternatingItem Or e.Item.ItemType = GridItemType.Item Then
+ Dim item As Telerik.Web.UI.GridDataItem
+ item = e.Item
+ Dim LinkButton1 As LinkButton
+ LinkButton1 = item("LinkColumn").FindControl("LinkButton1")
+ LinkButton1.CommandArgument = e.Item.ItemIndex.ToString()
+ End If
+ End Sub
+
+ Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
+ ' If multiple buttons are used in a Telerik RadGrid control, use the
+ ' CommandName property to determine which button was clicked.
+ If e.CommandName = "Add" Then
+
+ ' Convert the row index stored in the CommandArgument
+ ' property to an Integer.
+ Dim index As Integer = Convert.ToInt32(e.CommandArgument)
+
+ ' Retrieve the item that contains the button clicked
+ ' by the user from the Items collection.
+ Dim item As Telerik.Web.UI.GridDataItem = RadGrid1.Items(index)
+
+ ' Create a new ListItem object for the customer in the item.
+ Dim nitem As New ListItem()
+ nitem.Text = Server.HtmlDecode(item("CustomerID").Text)
+
+ ' If the customer is not already in the ListBox, add the ListItem
+ ' object to the Items collection of the ListBox control.
+ If Not CustomersListBox.Items.Contains(nitem) Then
+
+ CustomersListBox.Items.Add(nitem)
+
+ End If
+
+ End If
+ End Sub
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server" OnItemCreated="RadGrid1_ItemCreated" OnItemCommand="RadGrid1_ItemCommand">
+ <MasterTableView>
+ <Columns>
+ <radG:GridTemplateColumn
+ UniqueName="LinkColumn"
+ HeaderText="LinkColumn">
+ <ItemTemplate>
+ <asp:LinkButton CommandName="Add" Text="click" ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
+ </ItemTemplate>
+ </radG:GridTemplateColumn>
+ </Columns>
+ </MasterTableView>
+ </radG:RadGrid>
+ <asp:listbox id="CustomersListBox" runat="server"/>
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<<see cref="NorthwindConnectionString">$ ConnectionStrings</see>>"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+
+
+ Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)
+ If e.Item.ItemType = GridItemType.AlternatingItem Or e.Item.ItemType = GridItemType.Item Then
+ Dim item As Telerik.Web.UI.GridDataItem
+ item = e.Item
+ Dim LinkButton1 As LinkButton
+ LinkButton1 = item("LinkColumn").FindControl("LinkButton1")
+ LinkButton1.CommandArgument = e.Item.ItemIndex.ToString()
+ End If
+ End Sub
+
+ Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
+ ' If multiple buttons are used in a Telerik RadGrid control, use the
+ ' CommandName property to determine which button was clicked.
+ If e.CommandName = "Add" Then
+
+ ' Convert the row index stored in the CommandArgument
+ ' property to an Integer.
+ Dim index As Integer = Convert.ToInt32(e.CommandArgument)
+
+ ' Retrieve the item that contains the button clicked
+ ' by the user from the Items collection.
+ Dim item As Telerik.Web.UI.GridDataItem = RadGrid1.Items(index)
+
+ ' Create a new ListItem object for the customer in the item.
+ Dim nitem As New ListItem()
+ nitem.Text = Server.HtmlDecode(item("CustomerID").Text)
+
+ ' If the customer is not already in the ListBox, add the ListItem
+ ' object to the Items collection of the ListBox control.
+ If Not CustomersListBox.Items.Contains(nitem) Then
+
+ CustomersListBox.Items.Add(nitem)
+
+ End If
+
+ End If
+ End Sub
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server" OnItemCreated="RadGrid1_ItemCreated" OnItemCommand="RadGrid1_ItemCommand">
+ <MasterTableView>
+ <Columns>
+ <radG:GridTemplateColumn
+ UniqueName="LinkColumn"
+ HeaderText="LinkColumn">
+ <ItemTemplate>
+ <asp:LinkButton CommandName="Add" Text="click" ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
+ </ItemTemplate>
+ </radG:GridTemplateColumn>
+ </Columns>
+ </MasterTableView>
+ </radG:RadGrid>
+ <asp:listbox id="CustomersListBox" runat="server"/>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+
+ Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)
+ If e.Item.ItemType = GridItemType.AlternatingItem Or e.Item.ItemType = GridItemType.Item Then
+ Dim item As Telerik.Web.UI.GridDataItem
+ item = e.Item
+ item("CustomerID").Text = "Telerik"
+ End If
+ End Sub
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server" OnItemDataBound="RadGrid1_ItemDataBound">
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </form>
+ </body>
+ </html>
+
+ + protected void RadGrid1_PageSizeChanged(object source, GridPageSizeChangedEventArgs e)+
{
if(e.NewPageSize < 1)
+ e.Canceled = true;
} +
+ <%@ Page Language="VB" @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+
+ Protected Sub RadGrid1_SortCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridSortCommandEventArgs)
+ Response.Write("Sort")
+ End Sub
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1" AllowSorting="true"
+ runat="server" OnSortCommand="RadGrid1_SortCommand" >
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+
+ Protected Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
+ Response.Write("Update")
+ End Sub
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server" OnUpdateCommand="RadGrid1_UpdateCommand" >
+ <MasterTableView>
+ <Columns>
+ <radG:GridEditCommandColumn>
+ </radG:GridEditCommandColumn>
+ </Columns>
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+
+
+ Protected Sub RadGrid1_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
+ Response.Write("Insert")
+ End Sub
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server" OnInsertCommand="RadGrid1_InsertCommand" >
+ <MasterTableView CommandItemDisplay="TopAndBottom">
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ protected void RadGrid1_GroupsChanging(object source, Telerik.Web.UI.GridGroupsChangingEventArgs e)
+ {
+ //Expression is added (by drag/grop on group panel)
+
+ if (e.Action == GridGroupsChangingAction.Group)
+ {
+ if (e.Expression.GroupByFields[0].FieldName != "CustomerID")
+ {
+ GridGroupByField countryGroupField = new GridGroupByField();
+ countryGroupField.FieldName = "Country";
+ GridGroupByField cityGroupField = new GridGroupByField();
+ cityGroupField.FieldName = "City";
+
+ e.Expression.SelectFields.Clear();
+ e.Expression.SelectFields.Add(countryGroupField);
+ e.Expression.SelectFields.Add(cityGroupField);
+
+ e.Expression.GroupByFields.Clear();
+ e.Expression.GroupByFields.Add(countryGroupField);
+ e.Expression.GroupByFields.Add(cityGroupField);
+ }
+
+ }
+ }
+
+
+ Protected Sub RadGrid1_GroupsChanging(ByVal source As Object, ByVal e As Telerik.Web.UI.GridGroupsChangingEventArgs)
+ 'Expression is added (by drag/grop on group panel)
+ If (e.Action = GridGroupsChangingAction.Group) Then
+ If (e.Expression.GroupByFields(0).FieldName <> "CustomerID") Then
+ Dim countryGroupField As GridGroupByField = New GridGroupByField
+ countryGroupField.FieldName = "Country"
+ Dim cityGroupField As GridGroupByField = New GridGroupByField
+ cityGroupField.FieldName = "City"
+ e.Expression.SelectFields.Clear
+ e.Expression.SelectFields.Add(countryGroupField)
+ e.Expression.SelectFields.Add(cityGroupField)
+ e.Expression.GroupByFields.Clear
+ e.Expression.GroupByFields.Add(countryGroupField)
+ e.Expression.GroupByFields.Add(cityGroupField)
+ End If
+ End If
+ End Sub
+
+
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server">
+ <GroupingSettings ExpandTooltip="ExpandTooltip" />
+ <MasterTableView>
+ <GroupByExpressions>
+ <radG:GridGroupByExpression>
+ <SelectFields>
+ <radG:GridGroupByField FieldAlias="CompanyName" FieldName="CompanyName" ></radG:GridGroupByField>
+ </SelectFields>
+ <GroupByFields>
+ <radG:GridGroupByField FieldName="CompanyName" SortOrder="Descending"></radG:GridGroupByField>
+ </GroupByFields>
+ </radG:GridGroupByExpression>
+ </GroupByExpressions>
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<<see cref="NorthwindConnectionString">$ ConnectionStrings</see>>"
+ SelectCommand="SELECT [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server"
+ AllowSorting="true">
+ <SortingSettings SortToolTip="SortToolTip" SortedAscToolTip="SortedAscToolTip" SortedDescToolTip="SortedDescToolTip" />
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<<see cref="NorthwindConnectionString">$ ConnectionStrings</see>>"
+ SelectCommand="SELECT [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+
+
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ AutoGenerateColumns="false"
+ runat="server">
+ <ValidationSettings
+ EnableValidation="true"
+ CommandsToValidate="PefrormInsert" />
+ <MasterTableView CommandItemDisplay="TopAndBottom">
+ <Columns>
+ <radG:GridEditCommandColumn>
+ </radG:GridEditCommandColumn>
+ <radG:GridTemplateColumn HeaderText="ContactName" UniqueName="ContactName" DataField="ContactName">
+ <ItemTemplate>
+ <%# Eval("ContactName") <see cref="TextBox Text='<">>
+ </ItemTemplate>
+ <EditItemTemplate>
+ <asp</see># Bind("ContactName") %>' ID="TextBox1" runat="server"></asp:TextBox>
+ <asp:RequiredFieldValidator ControlToValidate="TextBox1" ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
+ </EditItemTemplate>
+ </radG:GridTemplateColumn>
+ </Columns>
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<<see cref="NorthwindConnectionString">$ ConnectionStrings</see>>"
+ SelectCommand="SELECT TOP 3 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server"
+ AllowPaging="true" >
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<<see cref="NorthwindConnectionString">$ ConnectionStrings</see>>"
+ SelectCommand="SELECT [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server"
+ AllowSorting="true">
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html >
+ <head id="Head1" runat="server">
+ <title>GridView ItemStyle and AlternatingItemStyle Example</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <h3>GridView ItemStyle and AlternatingItemStyle Example</h3>
+
+ <radG:RadGrid id="CustomersGridView"
+ datasourceid="CustomersSource"
+ autogeneratecolumns="true"
+ Skin=""
+ runat="server">
+
+ <itemstyle backcolor="LightCyan"
+ forecolor="DarkBlue"
+ font-italic="true"/>
+
+ <alternatingitemstyle backcolor="PaleTurquoise"
+ forecolor="DarkBlue"
+ font-italic="true"/>
+
+ </radG:RadGrid>
+
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:sqldatasource id="CustomersSource"
+ selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
+ connectionstring="<<see cref="NorthWindConnectionString">$ ConnectionStrings</see>>"
+ runat="server"/>
+
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server"
+ Skin="None" >
+ <GroupHeaderItemStyle BackColor="red" />
+ <MasterTableView>
+ <GroupByExpressions>
+ <radG:GridGroupByExpression>
+ <SelectFields>
+ <radG:GridGroupByField FieldAlias="CompanyName" FieldName="CompanyName" ></radG:GridGroupByField>
+ </SelectFields>
+ <GroupByFields>
+ <radG:GridGroupByField FieldName="CompanyName" SortOrder="Descending"></radG:GridGroupByField>
+ </GroupByFields>
+ </radG:GridGroupByExpression>
+ </GroupByExpressions>
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+ 
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server"
+ AutoGenerateColumns="true"
+ AllowSorting="true">
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<<see cref="NorthwindConnectionString">$ ConnectionStrings</see>>"
+ SelectCommand="SELECT [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+ + <radg:radgrid id="RadGrid1" runat="server"+
+ CssClass= "RadGrid" Width="100%" AutoGenerateColumns="False" PageSize="3" AllowSorting="True"
+ AllowMultiRowSelection= "False" AllowPaging="True" GridLines="None" AllowFilteringByColumn="true">
+ <PagerStyle Mode="NumericPages" CssClass="Pager"></PagerStyle>
+ <HeaderStyle CssClass="Header"></HeaderStyle>
+ <ItemStyle CssClass="Row"></ItemStyle>
+ <AlternatingItemStyle CssClass="AltRow"></AlternatingItemStyle>
+ <MasterTableView DataKeyNames="CustomerID" AllowMultiColumnSorting="True">
+ <DetailTables>
+ <radG:GridTableView DataKeyNames="OrderID" DataMember="Orders">
+ <ParentTableRelation>
+ <radG:GridRelationFields DetailKeyField="CustomerID" MasterKeyField="CustomerID" />
+ </ParentTableRelation>
<DetailTables>
+ <radG:GridTableView DataKeyNames="OrderID" DataMember="OrderDetails">
+ <ParentTableRelation>
+ <radG:GridRelationFields DetailKeyField="OrderID" MasterKeyField="OrderID" />
+ </ParentTableRelation>
+ <Columns>
+ <radG:GridBoundColumn SortExpression="UnitPrice" HeaderText="Unit Price" HeaderButtonType="TextButton"
+ DataField= "UnitPrice">
+ </radG:GridBoundColumn>
+ <radG:GridBoundColumn SortExpression="Quantity" HeaderText="Quantity" HeaderButtonType="TextButton"
+ DataField= "Quantity">
</radG:GridBoundColumn>
+ <radG:GridBoundColumn SortExpression="Discount" HeaderText="Discount" HeaderButtonType="TextButton"
+ DataField= "Discount">
</radG:GridBoundColumn>
+ </Columns>
<SortExpressions>
+ <radG:GridSortExpression FieldName="Quantity" SortOrder="Descending"></radG:GridSortExpression>
+ </SortExpressions>
<ItemStyle BackColor="#A7B986"></ItemStyle>
+ <HeaderStyle CssClass="Header1"></HeaderStyle>
+ <AlternatingItemStyle BackColor="#D9E8C4"></AlternatingItemStyle>
+ </radG:GridTableView>
+ </DetailTables>
+ <Columns>
+ <radG:GridBoundColumn SortExpression="OrderID" HeaderText="OrderID" HeaderButtonType="TextButton"
+ DataField= "OrderID">
</radG:GridBoundColumn>
+ <radG:GridBoundColumn SortExpression="OrderDate" HeaderText="Date Ordered" HeaderButtonType="TextButton"
+ DataField= "OrderDate">
</radG:GridBoundColumn>
+ <radG:GridBoundColumn SortExpression="EmployeeID" HeaderText="EmployeeID" HeaderButtonType="TextButton"
+ DataField= "EmployeeID">
</radG:GridBoundColumn>
+ </Columns>
<SortExpressions>
+ <radG:GridSortExpression FieldName="OrderDate"></radG:GridSortExpression>
+ </SortExpressions>
<ItemStyle Height="19px" BackColor="#FCEDB0"></ItemStyle>
+ <HeaderStyle CssClass="Header2" ForeColor="#ffffff"></HeaderStyle>
+ <AlternatingItemStyle Height="19px" BackColor="#D5B96A"></AlternatingItemStyle>
+ </radG:GridTableView>
</DetailTables>
+ <Columns>
+ <radG:GridBoundColumn SortExpression="CustomerID" HeaderText="CustomerID" HeaderButtonType="TextButton"
+ DataField= "CustomerID">
+ </radG:GridBoundColumn>
+ <radG:GridBoundColumn SortExpression="ContactName" HeaderText="Contact Name" HeaderButtonType="TextButton"
+ DataField= "ContactName">
+ </radG:GridBoundColumn>
+ <radG:GridBoundColumn SortExpression="CompanyName" HeaderText="Company" HeaderButtonType="TextButton"
+ DataField= "CompanyName">
+ </radG:GridBoundColumn>
</Columns>
+ <SortExpressions>
+ <radG:GridSortExpression FieldName="CompanyName"></radG:GridSortExpression>
+ </SortExpressions>
</MasterTableView>
+ <SelectedItemStyle ForeColor="White" BackColor="DarkBlue" CssClass=""></SelectedItemStyle>
+ </radg:radgrid> +
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server"
+ Skin="" >
+ <EditItemStyle BackColor="red" />
+ <MasterTableView>
+ <Columns>
+ <radG:GridEditCommandColumn>
+ </radG:GridEditCommandColumn>
+ </Columns>
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server"
+ Skin=""
+ ShowFooter="true" >
+ <FooterStyle BackColor="red" />
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server"
+ Skin="" >
+ <HeaderStyle BackColor="red" />
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server"
+ Skin=""
+ AllowFilteringByColumn="true">
+ <FilterItemStyle BackColor="red" />
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server"
+ Skin="">
+ <CommandItemStyle BackColor="red" />
+ <MasterTableView CommandItemDisplay="TopAndBottom">
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html >
+ <head id="Head1" runat="server">
+ <title>GridView ItemStyle And AlternatingItemStyle Example</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <h3>GridView ItemStyle And AlternatingItemStyle Example</h3>
+
+ <radG:RadGrid id="CustomersGridView"
+ datasourceid="CustomersSource"
+ autogeneratecolumns="true"
+ Skin=""
+ runat="server">
+
+ <itemstyle backcolor="LightCyan"
+ forecolor="DarkBlue"
+ font-italic="true"/>
+
+ <alternatingitemstyle backcolor="PaleTurquoise"
+ forecolor="DarkBlue"
+ font-italic="true"/>
+
+ </radG:RadGrid>
+
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:sqldatasource id="CustomersSource"
+ selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
+ connectionstring="<<see cref="NorthWindConnectionString">$ ConnectionStrings</see>>"
+ runat="server"/>
+
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+ protected void RadGrid1_PreRender(object sender, EventArgs e)
+ {
+ Label1.Text = RadGrid1.PageCount.ToString();
+ }
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ AllowPaging="true"
+ runat="server" OnPreRender="RadGrid1_PreRender">
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+
+ Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs)
+ Label1.Text = RadGrid1.PageCount.ToString()
+ End Sub
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ AllowPaging="true"
+ runat="server" OnPreRender="RadGrid1_PreRender" >
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></div>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" %>
+
+ <%@ Import Namespace="System.Data" <see cref="> <"/>@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml">
+
+ <script runat="server">
+
+ Function CreateDataSource() As ICollection
+ Dim dt As New DataTable()
+ Dim dr As DataRow
+
+ dt.Columns.Add(New DataColumn("IntegerValue", GetType(Int32)))
+ dt.Columns.Add(New DataColumn("StringValue", GetType(String)))
+ dt.Columns.Add(New DataColumn("DateTimeValue", GetType(String)))
+ dt.Columns.Add(New DataColumn("BoolValue", GetType(Boolean)))
+
+ Dim i As Integer
+ For i = 0 To 99
+ dr = dt.NewRow()
+
+ dr(0) = i
+ dr(1) = "Item " & i.ToString()
+ dr(2) = DateTime.Now.ToShortDateString()
+ If i Mod 2 <> 0 Then
+ dr(3) = True
+ Else
+ dr(3) = False
+ End If
+
+ dt.Rows.Add(dr)
+ Next i
+
+ Dim dv As New DataView(dt)
+ Return dv
+ End Function 'CreateDataSource
+
+ Sub ShowStats()
+ lblEnabled.Text = "AllowPaging is " & RadGrid1.AllowPaging
+ lblCurrentIndex.Text = "CurrentPageIndex is " & RadGrid1.CurrentPageIndex
+ lblPageCount.Text = "PageCount is " & RadGrid1.PageCount
+ lblPageSize.Text = "PageSize is " & RadGrid1.PageSize
+ End Sub 'ShowStats
+
+
+ Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
+ RadGrid1.DataSource = CreateDataSource()
+ ShowStats()
+ End Sub
+
+ Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
+ If CheckBox1.Checked Then
+ RadGrid1.PagerStyle.Mode = GridPagerMode.NumericPages
+ Else
+ RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrev
+ End If
+
+ RadGrid1.Rebind()
+ End Sub
+ </script>
+
+ <head id="Head1" runat="server">
+ <title>RadGrid Paging Example</title>
+ </head>
+ <body>
+ <h3>
+ RadGrid Paging Example</h3>
+ <form id="form1" runat="server">
+ <radG:RadGrid ID="RadGrid1" runat="server" AllowPaging="True">
+ <PagerStyle Mode="NumericPages" HorizontalAlign="Right"></PagerStyle>
+ <HeaderStyle BackColor="#aaaadd"></HeaderStyle>
+ <AlternatingItemStyle BackColor="#eeeeee"></AlternatingItemStyle>
+ </radG:RadGrid>
+ <br />
+ <asp:CheckBox ID="CheckBox1" runat="server" Text="Show numeric page navigation buttons"
+ AutoPostBack="true" />
+ <br />
+ <table style="background-color: #eeeeee; padding: 6">
+ <tr>
+ <td style="display: inline">
+ <asp:Label ID="lblEnabled" runat="server" /><br />
+ <asp:Label ID="lblCurrentIndex" runat="server" /><br />
+ <asp:Label ID="lblPageCount" runat="server" /><br />
+ <asp:Label ID="lblPageSize" runat="server" /><br />
+ </td>
+ </tr>
+ </table>
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" %>
+
+ <%@ Import Namespace="System.Data" <see cref="> <"/>@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml">
+
+ <script runat="server">
+ ICollection CreateDataSource()
+ {
+ DataTable dt = new DataTable();
+ DataRow dr;
+ dt.Columns.Add(new DataColumn("IntegerValue", typeof(Int32)));
+ dt.Columns.Add(new DataColumn("StringValue", typeof(string)));
+ dt.Columns.Add(new DataColumn("DateTimeValue", typeof(string)));
+ dt.Columns.Add(new DataColumn("BoolValue", typeof(bool)));
+ int i;
+ for (i = 0; (i <= 99); i++)
+ {
+ dr = dt.NewRow();
+ dr[0] = i;
+ dr[1] = ("Item " + i.ToString());
+ dr[2] = DateTime.Now.ToShortDateString();
+ if (((i % 2)
+ != 0))
+ {
+ dr[3] = true;
+ }
+ else
+ {
+ dr[3] = false;
+ }
+ dt.Rows.Add(dr);
+ }
+ DataView dv = new DataView(dt);
+ return dv;
+ }
+
+ // CreateDataSource
+ void ShowStats()
+ {
+ lblEnabled.Text = ("AllowPaging is " + RadGrid1.AllowPaging);
+ lblCurrentIndex.Text = ("CurrentPageIndex is " + RadGrid1.CurrentPageIndex);
+ lblPageCount.Text = ("PageCount is " + RadGrid1.PageCount);
+ lblPageSize.Text = ("PageSize is " + RadGrid1.PageSize);
+ }
+
+ // ShowStats
+ protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
+ {
+ RadGrid1.DataSource = CreateDataSource();
+ ShowStats();
+ }
+
+ protected void CheckBox1_CheckedChanged(object sender, System.EventArgs e)
+ {
+ if (CheckBox1.Checked)
+ {
+ RadGrid1.PagerStyle.Mode = GridPagerMode.NumericPages;
+ }
+ else
+ {
+ RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrev;
+ }
+ RadGrid1.Rebind();
+ }
+ </script>
+
+ <head id="Head1" runat="server">
+ <title>RadGrid Paging Example</title>
+ </head>
+ <body>
+ <h3>
+ RadGrid Paging Example</h3>
+ <form id="form1" runat="server">
+ <radG:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" OnNeedDataSource="RadGrid1_NeedDataSource">
+ <PagerStyle Mode="NumericPages" HorizontalAlign="Right"></PagerStyle>
+ <HeaderStyle BackColor="#aaaadd"></HeaderStyle>
+ <AlternatingItemStyle BackColor="#eeeeee"></AlternatingItemStyle>
+ </radG:RadGrid>
+ <br />
+ <asp:CheckBox ID="CheckBox1" runat="server" Text="Show numeric page navigation buttons"
+ AutoPostBack="true" OnCheckedChanged="CheckBox1_CheckedChanged" />
+ <br />
+ <table style="background-color: #eeeeee; padding: 6">
+ <tr>
+ <td style="display: inline">
+ <asp:Label ID="lblEnabled" runat="server" /><br />
+ <asp:Label ID="lblCurrentIndex" runat="server" /><br />
+ <asp:Label ID="lblPageCount" runat="server" /><br />
+ <asp:Label ID="lblPageSize" runat="server" /><br />
+ </td>
+ </tr>
+ </table>
+ </form>
+ </body>
+ </html>
+
+
+ private void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ RadGrid1.SelectedIndexes.Add(1, 0, 1, 0, 1);
+ //Index of 1, 0, 1, 0, 1 means:
+ //1 - item with index 1 in the MasterTabelView
+ //0 - detail table with index 0
+ //1 - item with index 1 (the second item) in the first detail table
+ //0 - 0 the third-level detail table
+ //1 - the item with index 1 in the third-level table
+ }
+ }
+
+
+ Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ If Not IsPostBack Then
+ RadGrid1.SelectedIndexes.Add(1, 0, 1, 0, 1)
+ 'Index of 1, 0, 1, 0, 1 means:
+ '1 - item With index 1 In the MasterTabelView
+ '0 - detail table With index 0
+ '1 - item With index 1 (the second item) In the first detail table
+ '0 - 0 the third-level detail table
+ '1 - the item With index 1 In the third-level table
+ End If
+ End Sub
+
+ + <CommandItemTemplate> ++
+ <asp:LinkButton ID="LinkButton1" Visible="<%# (!(RadGrid1.MasterTableView.IsItemInserted || RadGrid1.EditIndexes.Count >0 )) %>" ++
+ runat="server" CommandName="InitInsert">Add New</asp:LinkButton> ++
+ </CommandItemTemplate> ++
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+
+ Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
+
+ ' Display the primary key value of the selected row.
+ Label1.Text = "The primary key value of the selected row is " & _
+ RadGrid1.SelectedValue.ToString() & "."
+
+ End Sub
+
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml">
+ <head runat="server">
+ <title>RadGrid SelectedValue Example</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <h3>
+ RadGrid SelectedValue Example</h3>
+ <asp:Label ID="Label1" ForeColor="Red" runat="server" />
+ <radG:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1"
+ OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"
+ runat="server">
+ <MasterTableView DataKeyNames="CustomerID">
+ <Columns>
+ <radG:GridButtonColumn CommandName="Select" Text="Select" />
+ </Columns>
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource ID="SqlDataSource1" SelectCommand="SELECT * FROM [Customers]"
+ runat="server" ConnectionString="<<see cref="NorthwindConnectionString">$ ConnectionStrings</see>>" />
+ </form>
+ </body>
+ </html>
+
+
+
+
+ <%@ Page Language="C#" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+ <!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <script runat="server">
+ protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ // Display the primary key value of the selected row.
+ Label1.Text = "The primary key value of the selected row is " +
+ RadGrid1.SelectedValue.ToString() + ".";
+ }
+ </script>
+
+ <html xmlns="http://www.w3.org/1999/xhtml">
+ <head runat="server">
+ <title>RadGrid SelectedValue Example</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <h3>
+ RadGrid SelectedValue Example</h3>
+ <asp:Label ID="Label1" ForeColor="Red" runat="server" />
+ <radG:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"
+ runat="server">
+ <MasterTableView DataKeyNames="CustomerID">
+ <Columns>
+ <radG:GridButtonColumn CommandName="Select" Text="Select" />
+ </Columns>
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server And connects -->
+ <!-- To the Northwind sample database. Use an ASP.NET -->
+ <!-- expression To retrieve the connection String value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource ID="SqlDataSource1" SelectCommand="SELECT * FROM [Customers]"
+ runat="server" ConnectionString="<<see cref="NorthwindConnectionString">$ ConnectionStrings</see>>" />
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" %>
+
+ <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server"
+ Skin="">
+ <SelectedItemStyle BackColor="red" />
+ <MasterTableView>
+ <Columns>
+ <radG:GridButtonColumn
+ Text="Select"
+ UniqueName="Select"
+ CommandName="Select">
+ </radG:GridButtonColumn>
+ </Columns>
+ </MasterTableView>
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<$ ConnectionStrings >"
+ SelectCommand="SELECT TOP 5 [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ </div>
+ </form>
+ </body>
+ </html>
+
+ + <radG:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" ShowStatusBar="true" EnableAjax="true">+
<StatusBarSettings LoadingText="Loading... Please wait!" ReadyText="Online" />
</radG:RadGrid> +
+ < + radG:RadGrid ID="RadGrid1" DataSourceID="AccessDataSource1" AllowPaging="True" ShowFooter="True"+
runat="server" AutoGenerateColumns="False" AllowSorting="True" PageSize="3" Width="925px"
GridLines="None" CellPadding="0" Skin="Default" AllowMultiRowSelection="true">
<MasterTableView ShowFooter="True">
<RowIndicatorColumn Visible="False" UniqueName="RowIndicator">
<HeaderStyle Width="20px"></ + HeaderStyle>
</RowIndicatorColumn + >
<Columns + >
<radG:GridEditCommandColumn FooterText="EditCommand footer" UniqueName="EditCommandColumn"
HeaderText="Edit Command Column">
</radG:GridEditCommandColumn + >
<radG:GridClientSelectColumn UniqueName="CheckboxSelectColumn" HeaderText="CheckboxSelect column <br + />" />
<radG:GridBoundColumn FooterText="BoundColumn footer" UniqueName="CustomerID" SortExpression="CustomerID"
HeaderText="Bound<br/ + >Column" DataField="CustomerID">
</radG:GridBoundColumn + >
<radG:GridCheckBoxColumn FooterText="CheckBoxColumn footer" UniqueName="Bool" HeaderText="CheckBox< + br/>Column"
DataField="Bool">
</radG:GridCheckBoxColumn + >
<radG:GridDropDownColumn FooterText="DropDownColumn footer" UniqueName="DropDownListColumn"
ListTextField="ContactName" ListValueField="CustomerID" DataSourceID="AccessDataSource2"
HeaderText="DropDown< + br/>Column" DataField="CustomerID">
</radG:GridDropDownColumn + >
<radG:GridButtonColumn FooterText="PushButtonColumn< + br/>footer" DataTextFormatString="Select {0}"
ButtonType="PushButton" UniqueName="column" HeaderText="PushButton< + br/>Column"
CommandName="Select" DataTextField="CustomerID">
</radG:GridButtonColumn + >
<radG:GridButtonColumn FooterText="LinkButtonColumn footer" DataTextFormatString="Remove selection"
UniqueName="column1" HeaderText="LinkButton< + br/>Column" CommandName="Deselect"
DataTextField="CustomerID">
</radG:GridButtonColumn + >
<radG:GridHyperLinkColumn FooterText="HyperLinkColumn footer" DataTextFormatString="Search Google for '{0}'"
DataNavigateUrlField="CompanyName" UniqueName="CompanyName" DataNavigateUrlFormatString="http://www.google.com/search?hl=en&q={0}&btnG=Google+Search"
HeaderText="HyperLink< + br/>Column" DataTextField="CompanyName">
</radG:GridHyperLinkColumn + >
<radG:GridTemplateColumn UniqueName="TemplateColumn" SortExpression="CompanyName">
<FooterTemplate + >
<img src="Img/image.gif" alt="" style="vertical-align: middle" />
Template footer
</FooterTemplate + >
<HeaderTemplate + >
<table id="Table1" cellspacing="0" cellpadding="0" width="300" border="1">
<tr + >
<td colspan="2" align="center">
<b + >Contact details</b + ></td + >
</tr + >
<tr + >
<td style="width: 50%" align="center">
<asp:LinkButton CssClass="Button" Width="140" ID="btnContName" Text="Contact name"
Tooltip="Sort by ContactName" CommandName='Sort' CommandArgument='ContactName' runat="server" /></td>
<td style="width: 50%" align="center">
<asp:LinkButton CssClass="Button" Width="140" ID="btnContTitle" Text="Contact title"
Tooltip="Sort by ContactTitle" CommandName='Sort' CommandArgument='ContactTitle'
runat="server" /></td>
</tr + >
</table + >
</HeaderTemplate + >
<ItemTemplate + >
<table cellpadding="1" cellspacing="1" class="customTable">
<tr + >
<td style="width: 50%">
<%#Eval("ContactName") %>
</td + >
<td style="width: 50%">
<%#Eval("ContactTitle") %>
</td + >
</tr + >
<tr + >
<td colspan="2" align="center">
<a href='<%#"http://www.google.com/search?hl=en&q=" + DataBinder.Eval(Container.DataItem, "ContactName") + "&btnG=Google+Search"%>' >
<em + >Search Google for
<%#Eval("ContactName") %>
</em + ></a + >
</td + >
</tr + >
<tr + >
<td colspan="2" align="center">
<img src="Img/image.gif" alt="" />
</td + >
</tr + >
</table + >
</ItemTemplate + >
</radG:GridTemplateColumn + >
</Columns + >
</MasterTableView + >
<ClientSettings + >
<Selecting AllowRowSelect="true" />
</ClientSettings + >
</radG:RadGrid + > +
+ this.RadGrid1 = new RadGrid();
+
+ this.RadGrid1.NeedDataSource += new GridNeedDataSourceEventHandler(this.RadGrid1_NeedDataSource);
+
+ this.RadGrid1.AutoGenerateColumns = false;
+ this.RadGrid1.MasterTableView.DataMember = "Customers";
+
+ GridBoundColumn boundColumn;
+ boundColumn = new GridBoundColumn();
+ boundColumn.DataField = "CustomerID";
+ boundColumn.HeaderText = "CustomerID";
+ this.RadGrid1.MasterTableView.Columns.Add(boundColumn);
+
+ ....
+ //Add to page controls collection
+ this.PlaceHolder1.Controls.Add( RadGrid1 );
+
+
+ Me.RadGrid1 = New RadGrid
+
+ AddHandler RadGrid1.NeedDataSource, AddressOf Me.RadGrid1_NeedDataSource
+ AddHandler RadGrid1.DetailTableDataBind, AddressOf Me.RadGrid1_DetailTableDataBind
+
+ Me.RadGrid1.AutoGenerateColumns = False
+ Me.RadGrid1.MasterTableView.DataMember = "Customers"
+
+ Dim boundColumn As GridBoundColumn
+ boundColumn = New GridBoundColumn
+ boundColumn.DataField = "CustomerID"
+ boundColumn.HeaderText = "CustomerID"
+ Me.RadGrid1.MasterTableView.Columns.Add(boundColumn)
+
+
+ ....'Add to page controls collection
+ Me.PlaceHolder1.Controls.Add(RadGrid1)
+
+
+ <%@ Page Language="VB" <see cref="> <"/>@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+ <html xmlns="http://www.w3.org/1999/xhtml" >
+ <head runat="server">
+ <title>Untitled Page</title>
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <div>
+ <radG:RadGrid
+ DataSourceID="SqlDataSource1"
+ ID="RadGrid1"
+ runat="server">
+ </radG:RadGrid>
+ <!-- This example uses Microsoft SQL Server and connects -->
+ <!-- to the Northwind sample database. Use an ASP.NET -->
+ <!-- expression to retrieve the connection string value -->
+ <!-- from the Web.config file. -->
+ <asp:SqlDataSource
+ ID="SqlDataSource1"
+ runat="server"
+ ConnectionString="<<see cref="NorthwindConnectionString">$ ConnectionStrings</see>>"
+ SelectCommand="SELECT [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
+ </asp:SqlDataSource>
+ <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></div>
+ </form>
+ </body>
+ </html>
+
+
+ RadMenuItem item = new RadMenuItem();
+ item.Text = "News";
+ item.NavigateUrl = "~/News.aspx";
+
+ RadMenu1.Items.Add(item);
+
+
+ Dim item As New RadMenuItem()
+ item.Text = "News"
+ item.NavigateUrl = "~/News.aspx"
+
+ RadMenu1.Items.Add(item)
+
+
+ RadMenuItem item = new RadMenuItem("News");
+
+ RadMenu1.Items.Add(item);
+
+
+ Dim item As New RadMenuItem("News")
+
+ RadMenu1.Items.Add(item)
+
+
+ RadMenuItem item = new RadMenuItem("News", "~/News.aspx");
+
+ RadMenu1.Items.Add(item);
+
+
+ Dim item As New RadMenuItem("News", "~/News.aspx")
+
+ RadMenu1.Items.Add(item)
+
+
+ RadMenuItem item = RadMenu1.FindItemByText("Test");
+ item.Items[0].Text = "Example";
+ item.Items[0].NavigateUrl = "http://www.example.com";
+
+
+ Dim item As RadMenuItem = RadMenu1.FindItemByText("Test")
+ item.Items(0).Text = "Example"
+ item.Items(0).NavigateUrl = "http://www.example.com"
+
+
+ private void RadMenu1_MenuItemDataBound(object sender, Telerik.WebControls.ItemStripEventArgs e)
+ {
+ RadMenuItem item = e.Item;
+ DataRowView dataRow = (DataRowView) e.Item.DataItem;
+
+ item.ImageUrl = "image" + dataRow["ID"].ToString() + ".gif";
+ item.NavigateUrl = dataRow["URL"].ToString();
+ }
+
+
+ Sub RadMenu1_MenuItemDataBound(ByVal sender As Object, ByVal e As ItemStripEventArgs) Handles RadMenu1.MenuItemDataBound
+ Dim item As RadMenuItem = e.Item
+ Dim dataRow As DataRowView = CType(e.Item.DataItem, DataRowView)
+
+ item.ImageUrl = "image" + dataRow("ID").ToString() + ".gif"
+ item.NavigateUrl = dataRow("URL").ToString()
+ End Sub
+
+ ++<Items> +++<telerik:RadMenuItem Text="Date"> +++<Items> +++<telerik:RadMenuItem Text="SelectDate"> +++<ItemTemplate> +++<asp:Calendar runat="server" ID="Calendar1" + /> +</ItemTemplate> +</telerik:RadMenuItem> +</Items> +</telerik:RadMenuItem> +</Items> +
+ RadMenuItem newsItem = new RadMenuItem("News");
+ RadMenu1.Items.Add(newsItem);
+
+
+ Dim newsItem As RadMenuItem = New RadMenuItem("News")
+ RadMenu1.Items.Add(newsItem)
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadMenu1.FindItem(ItemWithEqualsTextAndValue);
+ }
+ private static bool ItemWithEqualsTextAndValue(RadMenuItem item)
+ {
+ if (item.Text == item.Value)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
+ RadMenu1.FindItem(ItemWithEqualsTextAndValue)
+ End Sub
+ Private Shared Function ItemWithEqualsTextAndValue(ByVal item As RadMenuItem) As Boolean
+ If item.Text = item.Value Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+
+ RadMenuItem[] items = new RadMenuItem[] { new RadMenuItem("First"), new RadMenuItem("Second"), new RadMenuItem("Third") };
+ RadMenu1.Items.AddRange(items);
+
+
+ Dim items() As RadMenuItem = {New RadMenuItem("First"), New RadMenuItem("Second"), New RadMenuItem("Third")}
+ RadMenu1.Items.AddRange(items)
+
+ string values
+ are equal.
+
+ @param value1 The left-hand side of the encoded {@link string#equals(Object)}.
+ @param value2 The right-hand side of the encoded {@link string#equals(Object)}.
+ @return true if the encoded strings are equal;
+ false otherwise.
+ @see #isDoubleMetaphoneEqual(string,string,bool)
+ string values
+ are equal, optionally using the alternate value.
+
+ @param value1 The left-hand side of the encoded {@link string#equals(Object)}.
+ @param value2 The right-hand side of the encoded {@link string#equals(Object)}.
+ @param alternate use the alternate value if true.
+ @return true if the encoded strings are equal;
+ false otherwise.
+ true if the value starts with any of 'GN', 'KN',
+ 'PN', 'WR' or 'PS'.
+ index if available, otherwise
+ it returns Character.MIN_VALUE so that there is some sort
+ of a default
+ value contains any of the criteria
+ starting
+ * at index start and matching up to length length
+
+ SpellChecker checker = new SpellChecker(Server.MapPath("~/RadControls/Spell/TDF"));
+
+ VB.NET
+
+
+ Dim checker As SpellChecker
+ checker = New SpellChecker(Server.MapPath("~/RadControls/Spell/TDF"))
+
+ using (SpellChecker checker = new SpellChecker(Server.MapPath("~/RadControls/Spell/TDF")))
+ {
+ checker.Text = text;
+ return checker.Errors;
+ }
+
+ VB.NET
+
+ Dim checker As SpellChecker
+ Try
+ checker = New SpellChecker(Server.MapPath("~/RadControls/Spell/TDF"))
+ checker.Text = text
+ Return checker.Errors
+ Finally
+ checker.Dispose()
+ End Try
+
+
+ spellChecker.DictionaryLanguage = "de-DE";
+
+ VB.NET
+
+ spellChecker.DictionaryLanguage = "de-DE"
+
+
+ SpellChecker checker = new SpellChecker(Server.MapPath("~/RadControls/Spell/TDF"));
+
+ VB.NET
+
+
+ Dim checker As SpellChecker
+ checker = New SpellChecker(Server.MapPath("~/RadControls/Spell/TDF"))
+
+ RadTreeNode node = new RadTreeNode();
+ node.Text = "News";
+ node.NavigateUrl = "~/News.aspx";
+
+ RadTreeView1.Nodes.Add(node);
+
+
+ Dim node As New RadTreeNode()
+ node.Text = "News"
+ node.NavigateUrl = "~/News.aspx"
+
+ RadTreeView1.Nodes.Add(node)
+
+
+ RadTreeNode node = new RadTreeNode("News");
+
+ RadTreeView1.Nodes.Add(node);
+
+
+ Dim node As New RadTreeNode("News")
+
+ RadTreeView1.Nodes.Add(node)
+
+
+ RadTreeNode node = new RadTreeNode("News", "NewsValue");
+
+ RadTreeView1.Nodes.Add(node);
+
+
+ Dim node As New RadTreeNode("News", "NewsValue")
+
+ RadTreeView1.Nodes.Add(node)
+
+
+ RadTreeNode node = new RadTreeNode("News", "NewsValue", "~/News.aspx");
+
+ RadTreeView1.Nodes.Add(node);
+
+
+ Dim node As New RadTreeNode("News", "NewsValue", "~/News.aspx")
+
+ RadTreeView1.Nodes.Add(node)
+
+
+ RadTreeNode node = RadTreeView1.Nodes[0];
+ node.Remove();
+
+
+ Dim node As RadTreeNode = RadTreeView1.Nodes(0)
+ node.Remove()
+
+
+ RadTreeNode node = RadTreeView1.FindNodeByText("Test");
+ node.Nodes[0].Text = "Example";
+ node.Nodes[0].NavigateUrl = "http://www.example.com";
+
+
+ Dim node As RadTreeNode = RadTreeView1.FindNodeByText("Test")
+ node.Nodes(0).Text = "Example"
+ node.Nodes(0).NavigateUrl = "http://www.example.com"
+
+
+ private void RadTreeView1_NodeDataBound(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
+ {
+ e.Node.ImageUrl = "image" + (string)DataBinder.Eval(e.Node.DataItem, "ID") + ".gif";
+ e.Node.NavigateUrl = (string)DataBinder.Eval(e.Node.DataItem, "URL");
+ }
+
+
+ Sub RadTreeView1_NodeDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs ) Handles RadTreeView1.NodeDataBound
+ e.Node.ImageUrl = "image" & DataBinder.Eval(e.Node.DataItem, "ID") & ".gif"
+ e.Node.NavigateUrl = CStr(DataBinder.Eval(e.Node.DataItem, "URL"))
+ End Sub
+
+
+ protected void RadTreeView1_NodeDataBound(object sender, RadTreeNodeEventArgs e)
+ {
+ //"NodeCategory" is the database column which provides data for the Category property.
+ e.Node.Category = DataBinder.Eval(e.Node.DataItem, "NodeCategory").ToString();
+ }
+
+
+ Protected Sub RadTreeView1_NodeDataBound(ByVal sender As Object, ByVal e As RadTreeNodeEventArgs) Handles RadTreeView1.NodeDataBound
+ ' "NodeCategory" is the database column which provides data for the Category property.
+ e.Node.Category = DataBinder.Eval(e.Node.DataItem, "NodeCategory")
+ End Sub
+
+
+ RadTreeNode newsNode = new RadTreeNode("News");
+ RadTreeView1.Nodes.Add(newsNode);
+
+
+ Dim newsNode As RadTreeNode = New RadTreeNode("News")
+ RadTreeView1.Nodes.Add(newsNode)
+
+
+ RadTreeNode[] nodes = new RadTreeNode[] { new RadTreeNode("First"), new RadTreeNode("Second"), new RadTreeNode("Third") };
+ RadTreeView1.Nodes.AddRange(nodes);
+
+
+ Dim nodes() As RadTreeNode = {New RadTreeNode("First"), New RadTreeNode("Second"), New RadTreeNode("Third")}
+ RadTreeView1.Nodes.AddRange(nodes)
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadTreeView1.FindNode(NodeWithEqualsTextAndValue);
+ }
+ private static bool NodeWithEqualsTextAndValue(RadTreeNode node)
+ {
+ if (node.Text == node.Value)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
+ RadTreeView1.FindNode(NodeWithEqualsTextAndValue)
+ End Sub
+ Private Shared Function NodeWithEqualsTextAndValue(ByVal node As RadTreeNode) As Boolean
+ If node.Text = node.Value Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadTreeView RadTreeView1 = new RadTreeView();
+ RadTreeView1.ID = "RadTreeView1";
+
+ if (!Page.IsPostBack)
+ {
+ //RadTreeView persist its nodes in ViewState (if EnableViewState is true).
+ //Hence nodes should be created only on initial load.
+
+ RadTreeNode sportNode = new RadTreeNode("Sport");
+ RadTreeView1.Nodes.Add(sportNode);
+
+ RadTreeNode newsNode = new RadTreeNode("News");
+ RadTreeView1.Nodes.Add(newsNode);
+ }
+
+ PlaceHolder1.Controls.Add(RadTreeView1);
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ Dim RadTreeView1 As RadTreeView = New RadTreeView()
+ RadTreeView1.ID = "RadTreeView1"
+
+ If Not Page.IsPostBack Then
+ 'RadTreeView persist its nodes in ViewState (if EnableViewState is true).
+ 'Hence nodes should be created only on initial load.
+
+ Dim sportNode As RadTreeNode = New RadTreeNode("Sport")
+ RadTreeView1.Nodes.Add(sportNode)
+
+ Dim newsNode As RadTreeNode = New RadTreeNode("News")
+ RadTreeView1.Nodes.Add(newsNode)
+ End If
+
+ PlaceHolder1.Controls.Add(RadTreeView1)
+ End Sub
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadTreeView1.FindNode(NodeWithEqualsTextAndValue);
+ }
+ private static bool NodeWithEqualsTextAndValue(RadTreeNode node)
+ {
+ if (node.Text == node.Value)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
+ RadTreeView1.FindNode(NodeWithEqualsTextAndValue)
+ End Sub
+ Private Shared Function NodeWithEqualsTextAndValue(ByVal node As RadTreeNode) As Boolean
+ If node.Text = node.Value Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+
+ foreach (ClientOperation<RadTreeNode> operation in RadTreeView1.ClientChanges)
+ {
+ RadTreeNode node = operation.Item;
+
+ switch (operation.Type)
+ {
+ case ClientOperationType.Insert:
+ //A node has been inserted - operation.Item contains the inserted node
+ break;
+ case ClientOperationType.Remove:
+ //A node has been inserted - operation.Item contains the removed node.
+ //Keep in mind the node has been removed from the treeview.
+ break;
+ case ClientOperationType.Update:
+ UpdateClientOperation<RadTreeNode> update = operation as UpdateClientOperation<RadTreeNode>
+ //The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
+ break;
+ case ClientOperationType.Clear:
+ //All children of have been removed - operation.Item contains the parent node whose children have been removed. If operation.Item is null then the root nodes have been removed.
+ break;
+ }
+ }
+
+
+ For Each operation As ClientOperation(Of RadTreeNode) In RadTreeView1.ClientChanges
+ Dim node As RadTreeNode = operation.Item
+ Select Case operation.Type
+ Case ClientOperationType.Insert
+ 'A node has been inserted - operation.Item contains the inserted node
+ Exit Select
+ Case ClientOperationType.Remove
+ 'A node has been inserted - operation.Item contains the removed node.
+ 'Keep in mind the node has been removed from the treeview.
+ Exit Select
+ Case ClientOperationType.Update
+ Dim update As UpdateClientOperation(Of RadTreeNode) = TryCast(operation, UpdateClientOperation(Of RadTreeNode))
+ 'The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
+ Exit Select
+ Case ClientOperationType.Clear
+ 'All children of have been removed - operation.Item contains the parent node whose children have been removed. If operation.Item is Nothing then the root nodes have been removed.
+ Exist Select
+ End Select
+ Next
+
+
+ Protected Sub ShowCheckedNodes(ByVal sender As Object, ByVal e As System.EventArgs)
+ Dim message As String = String.Empty
+ Dim node As RadTreeNode
+ For Each node In RadTree1.CheckedNodes
+ message += node.FullPath
+ Next node
+ nodes.Text = message
+ End Sub
+
+
+ protected void ShowCheckedNodes(object sender, System.EventArgs e)
+ {
+ string message = string.Empty;
+ foreach (RadTreeNode node in RadTree1.CheckedNodes)
+ {
+ message += node.FullPath + "<br/>";
+ }
+ nodes.Text = message;
+ }
+
+
+ <radT:RadTreeView
+ ID="RadTree1"
+ runat="server"
+ OnNodeClick="NodeClick"
+ />
+
+ Protected Sub NodeClick(ByVal sender As Object, ByVal NodeEventArgs As RadTreeNodeEventArgs)
+ info.Text = String.Empty
+ Dim NodeClicked As RadTreeNode = NodeEventArgs.NodeClicked
+ info.Text = NodeClicked.Text
+ End Sub
+
+
+ <radT:RadTreeView
+ ID="RadTree1"
+ runat="server"
+ OnNodeClick="NodeClick"
+ />
+
+ protected void NodeClick(object sender, RadTreeNodeEventArgs NodeEventArgs)
+ {
+ info.Text = string.Empty;
+ RadTreeNode NodeClicked = NodeEventArgs.NodeClicked;
+ info.Text = NodeClicked.Text;
+ }
+
+
+ Protected Sub LoadingMessagePositionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
+ Select Case LoadingMessagePos.SelectedItem.Value
+ Case "Before"
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.BeforeNodeText
+ RadTree1.LoadingMessage = "(loading ..)"
+ Case "After"
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.AfterNodeText
+ RadTree1.LoadingMessage = "(loading ...)"
+ Case "Below"
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.BelowNodeText
+ RadTree1.LoadingMessage = "(loading ...)"
+ Case "None"
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.None
+ End Select
+ End Sub
+
+
+ protected void LoadingMessagePositionChanged(object sender, System.EventArgs e)
+ {
+ switch (LoadingMessagePos.SelectedItem.Value)
+ {
+ case "Before" :
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.BeforeNodeText;
+ RadTree1.LoadingMessage = "(loading ..)";
+ break;
+ case "After" :
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.AfterNodeText;
+ RadTree1.LoadingMessage = "(loading ...)";
+ break;
+ case "Below" :
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.BelowNodeText;
+ RadTree1.LoadingMessage = "(loading ...)";
+ break;
+ case "None" :
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.None;
+ break;
+ }
+ }
+
+
+ RadTreeView1.Nodes[0].Text = "Example";
+ RadTreeView1.Nodes[0].NavigateUrl = "http://www.example.com";
+
+
+ RadTreeView1.Nodes(0).Text = "Example"
+ RadTreeView1.Nodes(0).NavigateUrl = "http://www.example.com"
+
+
+ Protected Sub LoadingMessagePositionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
+ Select Case LoadingMessagePos.SelectedItem.Value
+ Case "Before"
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.BeforeNodeText
+ RadTree1.LoadingMessage = "(loading ..)"
+ Case "After"
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.AfterNodeText
+ RadTree1.LoadingMessage = "(loading ...)"
+ Case "Below"
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.BelowNodeText
+ RadTree1.LoadingMessage = "(loading ...)"
+ Case "None"
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.None
+ End Select
+ End Sub
+
+
+ protected void LoadingMessagePositionChanged(object sender, System.EventArgs e)
+ {
+ switch (LoadingMessagePos.SelectedItem.Value)
+ {
+ case "Before" :
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.BeforeNodeText;
+ RadTree1.LoadingMessage = "(loading ...)";
+ break;
+ case "After" :
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.AfterNodeText;
+ RadTree1.LoadingMessage = "(loading ...)";
+ break;
+ case "Below" :
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.BelowNodeText;
+ RadTree1.LoadingMessage = "(loading ...)";
+ break;
+ case "None" :
+ RadTree1.LoadingStatusPosition = TreeViewLoadingStatusPosition.None;
+ break;
+ }
+ }
+
+
+ <radT:RadTreeView
+ ID="RadTree1"
+ Runat="server"
+ AllowNodeEditing="True"
+ OnNodeEdit="HandleNodeEdit"
+ />
+
+ Protected Sub HandleNodeEdit(ByVal sender As Object, ByVal NodeEvents As RadTreeNodeEventArgs)
+ Dim nodeEdited As RadTreeNode = NodeEvents.NodeEdited
+ Dim newText As String = NodeEvents.NewText
+
+ nodeEdited.Text = newText
+ End Sub
+
+
+ <radT:RadTreeView
+ ID="RadTree1"
+ Runat="server"
+ AllowNodeEditing="True"
+ OnNodeEdit="HandleNodeEdit"
+ />
+
+ protected void HandleNodeEdit(object sender, RadTreeNodeEventArgs NodeEvents)
+ {
+ RadTreeNode nodeEdited = NodeEvents.NodeEdited;
+ string newText = NodeEvents.NewText;
+
+ nodeEdited.Text = newText;
+ }
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" %>
+ <%@ Register TagPrefix="Telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
+
+ <html>
+ <body>
+ <form id="form1" runat="server">
+ <Telerik:RadScriptManager ID="RadScriptManager1" runat="server"></Telerik:RadScriptManager>
+ <br />
+ <Telerik:RadTreeView ID="RadTreeView1" runat="server">
+ <ContextMenus>
+ <Telerik:RadTreeViewContextMenu ID="ContextMenu1">
+ <nodes>
+ <Telerik:RadTreeNode Text="Menu1Item1"></Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Menu1Item2"></Telerik:RadTreeNode>
+ </nodes>
+ </Telerik:RadTreeViewContextMenu>
+ <Telerik:RadTreeViewContextMenu Skin="Outlook" ID="ContextMenu2">
+ <nodes>
+ <Telerik:RadTreeNode Text="Menu2Item1"></Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Menu2Item2"></Telerik:RadTreeNode>
+ </nodes>
+ </Telerik:RadTreeViewContextMenu>
+ </ContextMenus>
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node1" ContextMenuID="ContextMenu2">
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node11" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node12" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node2" ContextMenuID="ContextMenu2">
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node21" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node22" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeView>
+
+ </form>
+ </body>
+ </html>
+
+
+ [ScriptService]
+ public class WebServiceName : WebService
+ {
+ [WebMethod]
+ public RadTreeNodeData[] WebServiceMethodName(RadTreeNodeData item, object context)
+ {
+ // We cannot use a dictionary as a parameter, because it is only supported by script services.
+ // The context object should be cast to a dictionary at runtime.
+ IDictionary<string, object> contextDictionary = (IDictionary<string, object>) context;
+
+ //...
+ }
+ }
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadTreeView1.ExpandAnimation.Type = AnimationType.Linear;
+ RadTreeView1.ExpandAnimation.Duration = 300;
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ RadTreeView1.ExpandAnimation.Type = AnimationType.Linear
+ RadTreeView1.ExpandAnimation.Duration = 300
+ End Sub
+
+
+
+
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadTreeView1.CollapseAnimation.Type = AnimationType.Linear;
+ RadTreeView1.CollapseAnimation.Duration = 300;
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ RadTreeView1.CollapseAnimation.Type = AnimationType.Linear
+ RadTreeView1.CollapseAnimation.Duration = 300
+ End Sub
+
+
+ protected void RadTreeView1_NodeClick(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
+ {
+ Response.Write("Clicked node is " + e.Node.Text);
+ }
+
+
+ Sub RadTreeView1_NodeClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles RadTreeView1.NodeClick
+ Response.Write("Clicked node is " & e.Node.Text)
+ End Sub
+
+
+ protected void RadTreeView1_NodeDataBound(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
+ {
+ e.Node.ImageUrl = "image" + (string)DataBinder.Eval(e.Node.DataItem, "ID") + ".gif";
+ e.Node.NavigateUrl = (string)DataBinder.Eval(e.Node.DataItem, "URL");
+ }
+
+
+ Sub RadTreeView1_NodeDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles RadTreeView1.NodeDataBound
+ e.Node.ImageUrl = "image" & DataBinder.Eval(e.Node.DataItem, "ID") & ".gif"
+ e.Node.NavigateUrl = CStr(DataBinder.Eval(e.Node.DataItem, "URL"))
+ End Sub
+
+
+ protected void RadTreeView1_NodeCreated(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
+ {
+ e.Node.ToolTip = e.Node.Text;
+ }
+
+
+ Sub RadTreeView1_NodeCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles RadTreeView1.NodeCreated
+ e.Node.ToolTip = e.Node.Text
+ End Sub
+
+
+ protected void RadTreeView1_NodeExpanded(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
+ {
+ RadTreeNode nodeCreatedOnDemand = new RadTreeNode("Node created on demand");
+ e.Node.Nodes.Add(nodeCreatedOnDemand);
+ }
+
+
+ Sub RadTreeView1_NodeExpanded(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles RadTreeView1.NodeExpanded
+ Dim nodeCreatedOnDemand As RadTreeNode = New RadTreeNode("Node created on demand")
+ e.Node.Nodes.Add(nodeCreatedOnDemand)
+ End Sub
+
+
+ protected void RadTreeView1_NodeDrop(object sender, RadTreeNodeDragDropEventArgs e)
+ {
+ foreach (RadTreeNode sourceNode in e.DraggedNodes)
+ {
+ if (!sourceNode.IsAncestorOf(e.DestDragNode))
+ {
+ sourceNode.Remove();
+ e.DestDragNode.Nodes.Add(sourceNode);
+ }
+ }
+ }
+
+
+ Protected Sub RadTreeView1_NodeDrop(ByVal sender As Object, ByVal e As RadTreeNodeDragDropEventArgs) Handles RadTreeView1.NodeDrop
+ For Each sourceNode As RadTreeNode In e.DraggedNodes
+ If Not sourceNode.IsAncestorOf(e.DestDragNode) Then
+ sourceNode.Remove()
+ e.DestDragNode.Nodes.Add(sourceNode)
+ End If
+ Next
+ End Sub
+
+
+ protected void RadTreeView1_NodeEdit(object sender, RadTreeNodeEditEventArgs e)
+ {
+ RadTreeNode nodeEdited = e.Node;
+ string newText = e.Text;
+ nodeEdited.Text = newText;
+ }
+
+
+ Protected Sub HandleNodeEdit(ByVal sender As Object, ByVal e As RadTreeNodeEditEventArgs) Handles RadTreeView1.NodeEdit
+ Dim nodeEdited As RadTreeNode = e.Node
+ Dim newText As String = e.Text
+ nodeEdited.Text = newText
+ End Sub
+
+
+ RadEditor1.CssFiles = New String(2) {"~/styles/1.css", "~/styles/2.css"}
+
+
+ RadEditor1.CssFiles = new string[2] {"~/styles/1.css", "~/styles/2.css"};
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
+ RadEditor1.Colors.Add("Red")
+ RadEditor1.Colors.Add("Green")
+ RadEditor1.Colors.Add("Blue")
+ End Sub
+
+
+ private void Page_Load(object sender, EventArgs e)
+ {
+ RadEditor1.Colors.Add("Red");
+ RadEditor1.Colors.Add("Green");
+ RadEditor1.Colors.Add("Blue");
+ }
+
+
+ Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ For i As Integer = 65 To 90
+ RadEditor1.Symbols.Add(Convert.ToChar(i))
+ Next
+ End Sub
+
+
+ private void Page_Load(object sender, EventArgs e)
+ {
+ for (int i=65; i<=90; i++)
+ {
+ RadEditor1.Symbols.Add(Convert.ToChar(i));
+ }
+ }
+
+
+ Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ 'Add the root
+ RadEditor1.Links.Add("Telerik", "http://www.telerik.com")
+ 'Add the Products node And its children
+ RadEditor1.Links("Telerik").Add("Products", "http://www.telerik.com/products")
+ RadEditor1.Links("Telerik")("Products").Add("RadControls", "http://www.telerik.com/radcontrols")
+ RadEditor1.Links("Telerik")("Products").Add("RadEditor", "http://www.telerik.com/RadEditor")
+ RadEditor1.Links("Telerik")("Products")("RadEditor").Add("QSF", "http://www.telerik.com/demos/aspnet/Editor/Examples/Default/DefaultCS.aspx")
+ 'Add Purchase, Support And Client.Net nodes
+ RadEditor1.Links("Telerik").Add("Purchase", "http://www.telerik.com/purchase")
+ RadEditor1.Links("Telerik").Add("Support", "http://www.telerik.com/support")
+ RadEditor1.Links("Telerik").Add("Client.Net", "http://www.telerik.com/clientnet")
+ End Sub
+
+
+ private void Page_Load(object sender, EventArgs e)
+ {
+ //Add the root
+ RadEditor1.Links.Add("Telerik", "http://www.telerik.com");
+ //Add the Products node and its children
+ RadEditor1.Links["Telerik"].Add("Products", "http://www.telerik.com/products");
+ RadEditor1.Links["Telerik"]["Products"].Add("RadControls", "http://www.telerik.com/radcontrols");
+ RadEditor1.Links["Telerik"]["Products"].Add("RadEditor", "http://www.telerik.com/RadEditor");
+ RadEditor1.Links["Telerik"]["Products"]["RadEditor"].Add("QSF", "http://www.telerik.com/demos/aspnet/Editor/Examples/Default/DefaultCS.aspx");
+ //Add Purchase, Support and Client.Net nodes
+ RadEditor1.Links["Telerik"].Add("Purchase", "http://www.telerik.com/purchase");
+ RadEditor1.Links["Telerik"].Add("Support", "http://www.telerik.com/support");
+ RadEditor1.Links["Telerik"].Add("Client.Net", "http://www.telerik.com/clientnet");
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
+ RadEditor1.FontSizes.Add(2)
+ RadEditor1.FontSizes.Add(3)
+ RadEditor1.FontSizes.Add(4)
+ RadEditor1.FontSizes.Add(5)
+ RadEditor1.FontSizes.Add(6)
+ RadEditor1.FontSizes.Add(7)
+ End Sub
+
+
+ private void Page_Load(object sender, EventArgs e)
+ {
+ RadEditor1.FontSizes.Add(2);
+ RadEditor1.FontSizes.Add(3);
+ RadEditor1.FontSizes.Add(4);
+ RadEditor1.FontSizes.Add(5);
+ RadEditor1.FontSizes.Add(6);
+ RadEditor1.FontSizes.Add(7);
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
+ RadEditor1.FontNames.Add("Arial")
+ RadEditor1.FontNames.Add("Arial Narrow")
+ RadEditor1.FontNames.Add("Comic Sans MS")
+ RadEditor1.FontNames.Add("Courier New")
+ RadEditor1.FontNames.Add("Tahoma")
+ RadEditor1.FontNames.Add("Times New Roman")
+ RadEditor1.FontNames.Add("Verdana")
+ End Sub
+
+
+ private void Page_Load(object sender, EventArgs e)
+ {
+ RadEditor1.FontNames.Add("Arial");
+ RadEditor1.FontNames.Add("Arial Narrow");
+ RadEditor1.FontNames.Add("Comic Sans MS");
+ RadEditor1.FontNames.Add("Courier New");
+ RadEditor1.FontNames.Add("Tahoma");
+ RadEditor1.FontNames.Add("Times New Roman");
+ RadEditor1.FontNames.Add("Verdana");
+ }
+
+
+ Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ 'Add clear formatting
+ RadEditor1.Paragraphs.Add("Clear Formatting", "body")
+ 'Add the standard paragraph styles
+ RadEditor1.Paragraphs.Add("Heading 1", "<h1>")
+ RadEditor1.Paragraphs.Add("Heading 2", "<h2>")
+ RadEditor1.Paragraphs.Add("Heading 3", "<h3>")
+ 'Add paragraph style With block Format And css Class
+ RadEditor1.Paragraphs.Add("Heading 2 Bordered", "<h2 class=\"bordered\">")
+ End Sub
+
+
+ private void Page_Load(object sender, EventArgs e)
+ {
+ //Add clear formatting
+ RadEditor1.Paragraphs.Add("Clear Formatting", "body");
+ //Add the standard paragraph styles
+ RadEditor1.Paragraphs.Add("Heading 1", "<h1>");
+ RadEditor1.Paragraphs.Add("Heading 2", "<h2>");
+ RadEditor1.Paragraphs.Add("Heading 3", "<h3>");
+ //Add paragraph style with block format and css class
+ RadEditor1.Paragraphs.Add("Heading 2 Bordered", "<h2 class=\"bordered\">");
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
+ RadEditor1.RealFontSizes.Add("8pt")
+ RadEditor1.RealFontSizes.Add("9pt")
+ RadEditor1.RealFontSizes.Add("11pt")
+ RadEditor1.RealFontSizes.Add("13pt")
+ End Sub
+
+
+ private void Page_Load(object sender, EventArgs e)
+ {
+ RadEditor1.RealFontSizes.Add("8pt")
+ RadEditor1.RealFontSizes.Add("9pt")
+ RadEditor1.RealFontSizes.Add("11pt")
+ RadEditor1.RealFontSizes.Add("13pt")
+ }
+
+
+ Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ RadEditor1.Languages.Add("en-US", "English");
+ RadEditor1.Languages.Add("fr-FR", "French");
+ RadEditor1.Languages.Add("de-DE", "German");
+ End Sub
+
+
+ private void Page_Load(object sender, EventArgs e)
+ {
+ RadEditor1.Languages.Add("en-US", "English");
+ RadEditor1.Languages.Add("fr-FR", "French");
+ RadEditor1.Languages.Add("de-DE", "German");
+ }
+
+
+ Private Sub btnSave_Click(sender As Object, e As System.EventArgs)
+ 'HtmlEncode the content of the editor to display the HTML tags
+ LabelContent.Text = Server.HtmlEncode(RadEditor1.Content);
+ LabelText.Text = Server.HtmlEncode(RadEditor1.Text);
+ End Sub
+
+
+ private void btnSave_Click(object sender, System.EventArgs e)
+ {
+ //HtmlEncode the content of the editor to display the HTML tags
+ LabelContent.Text = Server.HtmlEncode(RadEditor1.Content);
+ LabelText.Text = Server.HtmlEncode(RadEditor1.Text);
+ }
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ DigitMaskPart digitPart = new DigitMaskPart();
+ RadMaskedTextBox1.MaskParts.Add(digitPart);
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ Dim digitPart As New DigitMaskPart()
+ RadMaskedTextBox1.MaskParts.Add(digitPart)
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ EnumerationMaskPart enumPart = new EnumerationMaskPart();
+ enumPart.Items.Add("Mon");
+ enumPart.Items.Add("Two");
+ enumPart.Items.Add("Wed");
+ enumPart.Items.Add("Thu");
+ enumPart.Items.Add("Fri");
+ enumPart.Items.Add("Sat");
+ enumPart.Items.Add("Sun");
+
+ RadMaskedTextBox1.MaskParts.Add(enumPart);
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ Dim enumPart As New EnumerationMaskPart
+ enumPart.Items.Add("Mon")
+ enumPart.Items.Add("Two")
+ enumPart.Items.Add("Wed")
+ enumPart.Items.Add("Thu")
+ enumPart.Items.Add("Fri")
+ enumPart.Items.Add("Sat")
+ enumPart.Items.Add("Sun")
+
+ RadMaskedTextBox1.MaskParts.Add(enumPart)
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ FreeMaskPart freePart = new FreeMaskPart();
+ RadMaskedTextBox1.MaskParts.Add(freePart);
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ Dim fixedPart As New FreeMaskPart()
+ RadMaskedTextBox1.MaskParts.Add(fixedPart)
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ LiteralMaskPart literalPart = new LiteralMaskPart();
+ literalPart.Text = "(";
+ RadMaskedTextBox1.MaskParts.Add(literalPart);
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ Dim literalPart As New LiteralMaskPart()
+ RadMaskedTextBox1.MaskParts.Add(literalPart)
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ LowerMaskPart lowerPart = new LowerMaskPart();
+ RadMaskedTextBox1.MaskParts.Add(lowerPart);
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ Dim lowerPart As New LowerMaskPart()
+ RadMaskedTextBox1.MaskParts.Add(lowerPart)
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ NumericRangeMaskPart rangePart = new NumericRangeMaskPart();
+ rangePart.LowerLimit = 0;
+ rangePart.UpperLimit = 255;
+ RadMaskedTextBox1.MaskParts.Add(rangePart);
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ Dim rangePart As New NumericRangeMaskPart()
+ rangePart.LowerLimit = 0
+ rangePart.UpperLimit = 255
+ RadMaskedTextBox1.MaskParts.Add(rangePart)
+ End Sub
+
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ UpperMaskPart upperPart = new UpperMaskPart();
+ RadMaskedTextBox1.MaskParts.Add(upperPart);
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ Dim upperPart As New UpperMaskPart()
+ RadMaskedTextBox1.MaskParts.Add(upperPart)
+ End Sub
+
+ + </%@ Page Language="C#" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<radI:RadTextBox Text="-1" EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server">
<NegativeStyle BackColor="red" />
</radI:RadTextBox>
</form>
</body>
</html> +
+ </%@ Page Language="C#" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
System.Data.DataTable table = new System.Data.DataTable();
table.Columns.Add("num");
+
System.Data.DataRow row = table.NewRow();
row["num"] = (double)12.56;
table.Rows.Add(row);
+
row = table.NewRow();
row["num"] = (int)12;
table.Rows.Add(row);
+
row = table.NewRow();
row["num"] = DBNull.Value;
table.Rows.Add(row);
+
row = table.NewRow();
row["num"] = "33";
table.Rows.Add(row);
+
row = table.NewRow();
table.Rows.Add(row);
+
Repeater1.DataSource = table;
Repeater1.DataBind();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Repeater runat="server" ID="Repeater1">
<ItemTemplate>
<radI:RadNumericTextBox DbValue='</%# Bind("num") /%>'
ID="RadNumericTextBox1" runat="server">
</radI:RadNumericTextBox>
</ItemTemplate>
</asp:Repeater>
</form>
</body>
</html> +
+ </%@ Page Language="VB" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
<!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim table As System.Data.DataTable = New System.Data.DataTable
table.Columns.Add("num")
Dim row As System.Data.DataRow = table.NewRow
row("num") = CType(12.56,Double)
table.Rows.Add(row)
row = table.NewRow
row("num") = CType(12,Integer)
table.Rows.Add(row)
row = table.NewRow
row("num") = DBNull.Value
table.Rows.Add(row)
row = table.NewRow
row("num") = "33"
table.Rows.Add(row)
row = table.NewRow
table.Rows.Add(row)
Repeater1.DataSource = table
Repeater1.DataBind
End Sub
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Repeater runat="server" ID="Repeater1">
<ItemTemplate>
<radI:RadNumericTextBox DbValue='</%# Bind("num") /%>'
ID="RadNumericTextBox1" runat="server">
</radI:RadNumericTextBox>
</ItemTemplate>
</asp:Repeater>
</form>
</body>
</html> +
+ </%@ Page Language="C#" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
+
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script language="javascript" type="text/javascript">
function Click(sender)
{
alert("click");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<radI:RadTextBox ShowButton="true" ID="RadNumericTextBox1" runat="server">
<ClientEvents OnButtonClick="Click" />
<ButtonTemplate>
<input type="button" value="click here" />
</ButtonTemplate>
</radI:RadTextBox>
</form>
</body>
</html> +
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ RadNumericTextBox.Culture = new CultureInfo("en-US");
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ RadNumericTextBox1.Culture = New CultureInfo("en-US")
+ End Sub
+
+
+ <%@ Page Language="VB" AutoEventWireup="True" %>
+
+ <%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html>
+ <head>
+ <title>MultiLine RadTextBox Example </title>
+
+ <script runat="server">
+
+ Protected Sub SubmitButton_Click(sender As Object, e As EventArgs )
+
+ Message.Text = "Thank you for your comment: <br />" + Comment.Text
+
+ End Sub
+
+ Protected Sub Check_Change(sender As Object, e As EventArgs )
+
+ Comment.Wrap = WrapCheckBox.Checked
+ Comment.ReadOnly = ReadOnlyCheckBox.Checked
+
+ End Sub
+
+ </script>
+
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <h3>
+ MultiLine RadTextBox Example
+ </h3>
+ Please enter a comment and click the submit button.
+ <br />
+ <br />
+ <radI:RadTextBox ID="Comment" TextMode="MultiLine" Columns="50" Rows="5" runat="server" />
+ <br />
+ <asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Comment"
+ ErrorMessage="Please enter a comment.<br />" Display="Dynamic" runat="server" />
+ <asp:CheckBox ID="WrapCheckBox" Text="Wrap Text" Checked="True" AutoPostBack="True"
+ OnCheckedChanged="Check_Change" runat="server" />
+
+ <asp:CheckBox ID="ReadOnlyCheckBox" Text="ReadOnly" Checked="False" AutoPostBack="True"
+ OnCheckedChanged="Check_Change" runat="server" />
+
+ <asp:Button ID="SubmitButton" Text="Submit" OnClick="SubmitButton_Click" runat="server" />
+ <hr />
+ <asp:Label ID="Message" runat="server" />
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" AutoEventWireup="True" %>
+
+ <%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" %>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html>
+ <head>
+ <title>MultiLine RadTextBox Example </title>
+
+ <script runat="server">
+
+ protected void SubmitButton_Click(Object sender, EventArgs e)
+ {
+
+ Message.Text = "Thank you for your comment: <br />" + Comment.Text;
+
+ }
+
+ protected void Check_Change(Object sender, EventArgs e)
+ {
+
+ Comment.Wrap = WrapCheckBox.Checked;
+ Comment.ReadOnly = ReadOnlyCheckBox.Checked;
+
+ }
+
+ </script>
+
+ </head>
+ <body>
+ <form id="form1" runat="server">
+ <h3>
+ MultiLine RadTextBox Example
+ </h3>
+ Please enter a comment and click the submit button.
+ <br />
+ <br />
+ <radI:RadTextBox ID="Comment" TextMode="MultiLine" Columns="50" Rows="5" runat="server" />
+ <br />
+ <asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Comment"
+ ErrorMessage="Please enter a comment.<br />" Display="Dynamic" runat="server" />
+ <asp:CheckBox ID="WrapCheckBox" Text="Wrap Text" Checked="True" AutoPostBack="True"
+ OnCheckedChanged="Check_Change" runat="server" />
+
+ <asp:CheckBox ID="ReadOnlyCheckBox" Text="ReadOnly" Checked="False" AutoPostBack="True"
+ OnCheckedChanged="Check_Change" runat="server" />
+
+ <asp:Button ID="SubmitButton" Text="Submit" OnClick="SubmitButton_Click" runat="server" />
+ <hr />
+ <asp:Label ID="Message" runat="server" />
+ </form>
+ </body>
+ </html>
+
+ + </%@ Page Language="C#" /%>+
+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html>
<head id="Head1" runat="server">
<title>AutoCompleteType example</title>
</head>
<body>
+ <form id="form1" runat="server">
<!-- You need to enable the AutoComplete feature on -->
+ <!-- a browser that supports it (such as Internet -->
<!-- Explorer 5.0 and later) for this sample to -->
+ <!-- work. The AutoComplete lists are created after -->
<!-- the Submit button is clicked. -->
+ <h3>
AutoCompleteType example</h3>
Enter values in the text boxes and click the Submit
<br />
+ button.
<br />
<br />
<!-- The following TextBox controls have different -->
+ <!-- categories assigned to their AutoCompleteType -->
<!-- properties. -->
+ First Name:<br />
<radI:RadTextBox ID="FirstNameTextBox" AutoCompleteType="FirstName" runat="server" />
<br />
+ Last Name:<br />
<radI:RadTextBox ID="LastNameTextBox" AutoCompleteType="LastName" runat="server" />
<br />
+ Email:<br />
<radI:RadTextBox ID="EmailTextBox" AutoCompleteType="Email" runat="server" />
<br />
+ <!-- The following TextBox controls have the same -->
<!-- categories assigned to their AutoCompleteType -->
+ <!-- properties. They share the same AutoComplete -->
<!-- list. -->
Phone Line #1:<br />
+ <radI:RadTextBox ID="Phone1TextBox" AutoCompleteType="HomePhone" runat="server" />
<br />
Phone Line #2:<br />
+ <radI:RadTextBox ID="Phone2TextBox" AutoCompleteType="HomePhone" runat="server" />
<br />
+ <!-- The following TextBox control has its -->
<!-- AutoCompleteType property set to -->
+ <!-- AutoCompleteType.None. All TextBox controls -->
+ <!-- with the same ID across different pages share -->
<!-- the same AutoComplete list. -->
Category:<br />
+ <radI:RadTextBox ID="CategoryTextBox" AutoCompleteType="None" runat="server" />
<br />
<!-- The following TextBox control has the -->
+ <!-- AutoComplete feature disabled. -->
Comments:<br />
<radI:RadTextBox ID="CommentsTextBox" AutoCompleteType="Disabled" runat="server" />
+ <br />
<br />
<br />
<asp:Button ID="SubmitButton" Text="Submit" runat="Server" />
</form>
</body>
</html>
+
+ </%@ Page Language="VB" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head id="Head1" runat="server">
+ <title>AutoCompleteType example</title>
</head>
<body>
<form id="form1" runat="server">
<!-- You need to enable the AutoComplete feature on -->
+ <!-- a browser that supports it (such as Internet -->
<!-- Explorer 5.0 and later) for this sample to -->
<!-- work. The AutoComplete lists are created after -->
+ <!-- the Submit button is clicked. -->
<h3>
AutoCompleteType example</h3>
Enter values in the text boxes and click the Submit
<br />
+ button.
<br />
<br />
<!-- The following TextBox controls have different -->
<!-- categories assigned to their AutoCompleteType -->
+ <!-- properties. -->
First Name:<br />
<radI:RadTextBox ID="FirstNameTextBox" AutoCompleteType="FirstName" runat="server" />
<br />
+ Last Name:<br />
<radI:RadTextBox ID="LastNameTextBox" AutoCompleteType="LastName" runat="server" />
<br />
Email:<br />
+ <radI:RadTextBox ID="EmailTextBox" AutoCompleteType="Email" runat="server" />
<br />
<!-- The following TextBox controls have the same -->
+ <!-- categories assigned to their AutoCompleteType -->
<!-- properties. They share the same AutoComplete -->
<!-- list. -->
Phone Line #1:<br />
+ <radI:RadTextBox ID="Phone1TextBox" AutoCompleteType="HomePhone" runat="server" />
<br />
Phone Line #2:<br />
<radI:RadTextBox ID="Phone2TextBox" AutoCompleteType="HomePhone" runat="server" />
+ <br />
<!-- The following TextBox control has its -->
<!-- AutoCompleteType property set to -->
<!-- AutoCompleteType.None. All TextBox controls -->
<!-- with the same ID across different pages share -->
+ <!-- the same AutoComplete list. -->
Category:<br />
<radI:RadTextBox ID="CategoryTextBox" AutoCompleteType="None" runat="server" />
<br />
<!-- The following TextBox control has the -->
+ <!-- AutoComplete feature disabled. -->
Comments:<br />
<radI:RadTextBox ID="CommentsTextBox" AutoCompleteType="Disabled" runat="server" />
<br />
<br />
<br />
<asp:Button ID="SubmitButton" Text="Submit" runat="Server" />
</form>
</body>
</html> +
+ </%@ Page Language="C#" AutoEventWireup="True" /%>+
+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>MultiLine TextBox Example </title>
+
<script runat="server">
protected void SubmitButton_Click(Object sender, EventArgs e)
{
Message.Text = "Thank you for your comment: <br />" + Comment.Text;
}
+
protected void Check_Change(Object sender, EventArgs e)
{
Comment.Wrap = WrapCheckBox.Checked;
Comment.ReadOnly = ReadOnlyCheckBox.Checked;
}
+
</script>
+
</head>
<body>
<form id="form1" runat="server">
<h3>
MultiLine TextBox Example
</h3>
Please enter a comment and click the submit button.
<br />
<br />
+ <radI:RadTextBox ID="Comment" TextMode="MultiLine" Columns="50" Rows="5" runat="server" />
<br />
<asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Comment"
ErrorMessage="Please enter a comment.<br />" Display="Dynamic" runat="server" />
+ <asp:CheckBox ID="WrapCheckBox" Text="Wrap Text" Checked="True" AutoPostBack="True"
OnCheckedChanged="Check_Change" runat="server" />
+
<asp:CheckBox ID="ReadOnlyCheckBox" Text="ReadOnly" Checked="False" AutoPostBack="True"
OnCheckedChanged="Check_Change" runat="server" />
+
<asp:Button ID="SubmitButton" Text="Submit" OnClick="SubmitButton_Click" runat="server" />
<hr />
<asp:Label ID="Message" runat="server" />
</form>
</body>
</html> +
+ </%@ Page Language="VB" AutoEventWireup="True" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>MultiLine RadTextBox Example </title>
<script runat="server">
Protected Sub SubmitButton_Click(sender As Object, e As EventArgs )
+ Message.Text = "Thank you for your comment: <br />" + Comment.Text
End Sub
Protected Sub Check_Change(sender As Object, e As EventArgs )
Comment.Wrap = WrapCheckBox.Checked
Comment.ReadOnly = ReadOnlyCheckBox.Checked
End Sub
</script>
</head>
<body>
+ <form id="form1" runat="server">
<h3>
MultiLine RadTextBox Example
</h3>
Please enter a comment and click the submit button.
<br />
<br />
<radI:RadTextBox ID="Comment" TextMode="MultiLine" Columns="50" Rows="5" runat="server" />
+ <br />
<asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Comment"
ErrorMessage="Please enter a comment.<br />" Display="Dynamic" runat="server" />
<asp:CheckBox ID="WrapCheckBox" Text="Wrap Text" Checked="True" AutoPostBack="True"
OnCheckedChanged="Check_Change" runat="server" />
+ <asp:CheckBox ID="ReadOnlyCheckBox" Text="ReadOnly" Checked="False" AutoPostBack="True"
OnCheckedChanged="Check_Change" runat="server" />
<asp:Button ID="SubmitButton" Text="Submit" OnClick="SubmitButton_Click" runat="server" />
<hr />
<asp:Label ID="Message" runat="server" />
+ </form>
</body>
</html> +
+ </%@ Page Language="C#" AutoEventWireup="True" /%>+
+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>RadTextBox Example </title>
+
<script runat="server">
+
protected void AddButton_Click(Object sender, EventArgs e)
{
int Answer;
+
Answer = Convert.ToInt32(Value1.Text) + Convert.ToInt32(Value2.Text);
+
AnswerMessage.Text = Answer.ToString();
+
}
+
</script>
+
</head>
<body>
<form id="form1" runat="server">
<h3>
RadTextBox Example
</h3>
+
<table>
<tr>
<td colspan="5">
Enter integer values into the text boxes.
<br />
+ Click the Add button to add the two values.
<br />
Click the Reset button to reset the text boxes.
</td>
</tr>
<tr>
<td colspan="5">
+
</td>
</tr>
<tr align="center">
<td>
<radI:RadTextBox ID="Value1" Columns="2" MaxLength="3" Text="1" runat="server" />
</td>
+ <td>
+
</td>
<td>
<radI:RadTextBox ID="Value2" Columns="2" MaxLength="3" Text="1" runat="server" />
</td>
<td>
=
</td>
+ <td>
<asp:Label ID="AnswerMessage" runat="server" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Value1"
+ ErrorMessage="Please enter a value.<br />" Display="Dynamic" runat="server" />
<asp:RangeValidator ID="Value1RangeValidator" ControlToValidate="Value1" Type="Integer"
MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
+ Display="Dynamic" runat="server" />
</td>
<td colspan="2">
<asp:RequiredFieldValidator ID="Value2RequiredValidator" ControlToValidate="Value2"
ErrorMessage="Please enter a value.<br />" Display="Dynamic" runat="server" />
+ <asp:RangeValidator ID="Value2RangeValidator" ControlToValidate="Value2" Type="Integer"
MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
Display="Dynamic" runat="server" />
</td>
+ <td>
 
</td>
</tr>
<tr align="center">
<td colspan="4">
<asp:Button ID="AddButton" Text="Add" OnClick="AddButton_Click" runat="server" />
</td>
<td>
+
</td>
</tr>
</table>
</form>
</body>
</html>
+
+ </%@ Page Language="VB" AutoEventWireup="True" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
+ <title>TextBox Example </title>
<script runat="server">
Protected Sub AddButton_Click(sender As Object, e As EventArgs)
Dim Answer As Integer
Answer = Convert.ToInt32(Value1.Text) + Convert.ToInt32(Value2.Text)
AnswerMessage.Text = Answer.ToString()
End Sub
+ </script>
</head>
<body>
<form id="form1" runat="server">
<h3>
RadTextBox Example
</h3>
<table>
<tr>
<td colspan="5">
Enter integer values into the text boxes.
+ <br />
Click the Add button to add the two values.
<br />
Click the Reset button to reset the text boxes.
</td>
</tr>
<tr>
<td colspan="5">
</td>
+ </tr>
<tr align="center">
<td>
<radI:RadTextBox ID="Value1" Columns="2" MaxLength="3" Text="1" runat="server" />
</td>
<td>
+
</td>
<td>
+ <radI:RadTextBox ID="Value2" Columns="2" MaxLength="3" Text="1" runat="server" />
</td>
<td>
=
</td>
<td>
<asp:Label ID="AnswerMessage" runat="server" />
</td>
+ </tr>
<tr>
<td colspan="2">
<asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Value1"
ErrorMessage="Please enter a value.<br />" Display="Dynamic" runat="server" />
+ <asp:RangeValidator ID="Value1RangeValidator" ControlToValidate="Value1" Type="Integer"
MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
Display="Dynamic" runat="server" />
</td>
+ <td colspan="2">
<asp:RequiredFieldValidator ID="Value2RequiredValidator" ControlToValidate="Value2"
ErrorMessage="Please enter a value.<br />" Display="Dynamic" runat="server" />
<asp:RangeValidator ID="Value2RangeValidator" ControlToValidate="Value2" Type="Integer"
+ MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"
Display="Dynamic" runat="server" />
</td>
<td>
 
</td>
</tr>
+ <tr align="center">
<td colspan="4">
<asp:Button ID="AddButton" Text="Add" OnClick="AddButton_Click" runat="server" />
</td>
<td>
</td>
</tr>
</table>
</form>
</body>
</html> +
+ </%@ Page Language="C#" AutoEventWireup="True" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>MultiLine RadTextBox Example </title>
+
<script runat="server">
+
protected void SubmitButton_Click(Object sender, EventArgs e)
{
+
Message.Text = "Thank you for your comment: <br />" + Comment.Text;
+
}
+
protected void Check_Change(Object sender, EventArgs e)
{
+
Comment.Wrap = WrapCheckBox.Checked;
Comment.ReadOnly = ReadOnlyCheckBox.Checked;
+
}
+
</script>
+
</head>
<body>
<form id="form1" runat="server">
<h3>
MultiLine RadTextBox Example
</h3>
+ Please enter a comment and click the submit button.
<br />
<br />
<radI:RadTextBox ID="Comment" TextMode="MultiLine" Columns="50" Rows="5" runat="server" />
<br />
+ <asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Comment"
ErrorMessage="Please enter a comment.<br />" Display="Dynamic" runat="server" />
+ <asp:CheckBox ID="WrapCheckBox" Text="Wrap Text" Checked="True" AutoPostBack="True"
OnCheckedChanged="Check_Change" runat="server" />
+
<asp:CheckBox ID="ReadOnlyCheckBox" Text="ReadOnly" Checked="False" AutoPostBack="True"
OnCheckedChanged="Check_Change" runat="server" />
+
<asp:Button ID="SubmitButton" Text="Submit" OnClick="SubmitButton_Click" runat="server" />
<hr />
<asp:Label ID="Message" runat="server" />
</form>
</body>
</html>
+
+ </%@ Page Language="VB" AutoEventWireup="True" /%>+
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>MultiLine RadTextBox Example </title>
<script runat="server">
+ Protected Sub SubmitButton_Click(sender As Object, e As EventArgs )
Message.Text = "Thank you for your comment: <br />" + Comment.Text
End Sub
Protected Sub Check_Change(sender As Object, e As EventArgs )
+ Comment.Wrap = WrapCheckBox.Checked
Comment.ReadOnly = ReadOnlyCheckBox.Checked
End Sub
</script>
</head>
<body>
<form id="form1" runat="server">
<h3>
+ MultiLine RadTextBox Example
</h3>
Please enter a comment and click the submit button.
<br />
<br />
<radI:RadTextBox ID="Comment" TextMode="MultiLine" Columns="50" Rows="5" runat="server" />
+ <br />
<asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Comment"
ErrorMessage="Please enter a comment.<br />" Display="Dynamic" runat="server" />
+ <asp:CheckBox ID="WrapCheckBox" Text="Wrap Text" Checked="True" AutoPostBack="True"
+ OnCheckedChanged="Check_Change" runat="server" />
<asp:CheckBox ID="ReadOnlyCheckBox" Text="ReadOnly" Checked="False" AutoPostBack="True"
OnCheckedChanged="Check_Change" runat="server" />
+ <asp:Button ID="SubmitButton" Text="Submit" OnClick="SubmitButton_Click" runat="server" />
<hr />
<asp:Label ID="Message" runat="server" />
</form>
</body>
</html> +
+ Appointment appointment = RadScheduler1.Appointments[0];
+ Label1.Text = RadScheduler1.UtcToDisplay(appointment.Start).ToString()
+
+
+ Dim appointment As Appointment = RadScheduler1.Appointments(0)
+ Label1.Text = RadScheduler1.UtcToDisplay(appointment.Start).ToString()
+
+
+ Appointment appointment = RadScheduler1.Appointments[0];
+ DateTime startInClientFormat = DateTime.Parse(TextBox1.Text);
+ appointment.Start = RadScheduler1.DisplayToUtc(startInClientFormat);
+ RadScheduler1.Update(appointment);
+
+
+ Dim appointment As Appointment = RadScheduler1.Appointments(0)
+ Dim startInClientFormat As DateTime = DateTime.Parse(TextBox1.Text)
+ appointment.Start = RadScheduler1.DisplayToUtc(startInClientFormat)
+ RadScheduler1.Update(appointment)
+
+
+ Appointment occurrence = RadScheduler1.Appointments[0];
+ Appointment recurrenceException = RadScheduler1.PrepareToEdit(occurrence, false);
+
+ recurrenceException.Subject = "This is a recurrence exception";
+
+ RadScheduler1.UpdateAppointment(recurrenceException);
+
+
+ Dim occurrence As Appointment = RadScheduler1.Appointments(0)
+ Dim recurrenceException as Appointment = RadScheduler1.PrepareToEdit(occurrence, False)
+
+ recurrenceException.Subject = "This is a recurrence exception"
+
+ RadScheduler1.UpdateAppointment(recurrenceException)
+
+
+ Appointment occurrence = RadScheduler1.Appointments[0];
+ Appointment recurrenceException = RadScheduler1.PrepareToEdit(occurrence, false);
+
+ Appointment modifiedAppointment = recurrenceException.Clone();
+ modifiedAppointment.Subject = "This is a recurrence exception";
+
+ RadScheduler1.UpdateAppointment(modifiedAppointment, recurrenceException);
+
+
+ Dim occurrence As Appointment = RadScheduler1.Appointments(0)
+ Dim recurrenceException as Appointment = RadScheduler1.PrepareToEdit(occurrence, False)
+
+ Dim modifiedAppointment = recurrenceException.Clone()
+ modifiedAppointment.Subject = "This is a recurrence exception"
+
+ RadScheduler1.UpdateAppointment(modifiedAppointment, recurrenceException)
+
+
+ Appointment occurrence = RadScheduler1.Appointments[0];
+ Appointment recurrenceException = RadScheduler1.PrepareToEdit(occurrence, false);
+
+ recurrenceException.Subject = "This is a recurrence exception";
+
+ RadScheduler1.UpdateAppointment(recurrenceException);
+
+
+ Dim occurrence As Appointment = RadScheduler1.Appointments(0)
+ Dim recurrenceException as Appointment = RadScheduler1.PrepareToEdit(occurrence, False)
+
+ recurrenceException.Subject = "This is a recurrence exception"
+
+ RadScheduler1.UpdateAppointment(recurrenceException)
+
+
+ void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
+ {
+ if (e.CommandName == "Delete")
+ {
+ Delete(e.Container.Appointment);
+ }
+ }
+
+
+ Sub RadScheduler1_AppointmentCommand(sender As Object, e As AppointmentCommandEventArgs)
+ If e.CommandName = "Delete" Then
+ Delete(e.Container.Appointment)
+ End If
+ End Sub
+
+
+ void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
+ {
+ if (e.Appointment.Subject == String.Empty)
+ {
+ e.Cancel = true;
+ }
+ }
+
+
+ Sub RadScheduler1_AppointmentInsert(sender As Object, e As SchedulerCancelEventArgs)
+ If e.Appointment.Subject = String.Empty Then
+ e.Cancel = True
+ End If
+ End Sub
+
+
+ void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
+ {
+ e.ModifiedAppointment.End = e.ModifiedAppointment.End.AddHours(1);
+ }
+
+
+ Sub RadScheduler1_AppointmentUpdate(sender As Object, e As AppointmentUpdateEventArgs)
+ e.ModifiedAppointment.End = e.ModifiedAppointment.End.AddHours(1)
+ End Sub
+
+
+ void RadScheduler1_AppointmentDelete(object sender, SchedulerCancelEventArgs e)
+ {
+ if (e.Appointment.Attributes["ReadOnly"] == "true")
+ {
+ e.Cancel = true;
+ }
+ }
+
+
+ Sub RadScheduler1_AppointmentDelete(sender As Object, e As SchedulerCancelEventArgs)
+ If e.Appointment.Attributes("ReadOnly") = "true" Then
+ e.Cancel = True
+ End If
+ End Sub
+
+
+ void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
+ {
+ Label testLabel = (Label) e.Container.FindControl("Test");
+ testLabel.Text = "Test";
+ }
+
+
+ Sub RadScheduler1_AppointmentCreated(sender As Object, e As AppointmentCreatedEventArgs)
+ Dim testLabel As Label = CType(e.Container.FindControl("Test"), Label)
+ testLabel.Text = "Test"
+ End Sub
+
+
+ void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
+ {
+ e.Appointment.Start = e.Appointment.Start.AddHours(1);
+ }
+
+
+ Sub RadScheduler1_AppointmentDataBound(sender As Object, e As SchedulerEventArgs)
+ e.Appointment.Start = e.Appointment.Start.AddHours(1)
+ End Sub
+
+
+ void RadScheduler1_AppointmentClick(object sender, SchedulerEventArgs e)
+ {
+ Response.Redirect("Page.aspx);
+ }
+
+
+ Sub RadScheduler1_AppointmentClick(sender As Object, e As SchedulerEventArgs)
+ Response.Redirect("Page.aspx)
+ End Sub
+
+
+ void RadScheduler1_NavigationCommand(object sender, SchedulerNavigationCommandEventArgs e)
+ {
+ if (e.Command == SchedulerNavigationCommand.NavigateToNextPeriod)
+ {
+ e.Cancel = true;
+ }
+ }
+
+
+ Sub RadScheduler1_NavigationCommand(sender As Object, e As SchedulerNavigationCommandEventArgs)
+ If e.Command = SchedulerNavigationCommand.NavigateToNextPeriod Then
+ e.Cancel = True
+ End If
+ End Sub
+
+
+ void RadScheduler1_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)
+ {
+ Label1.Text = RadScheduler1.SelectedDate;
+ }
+
+
+ Sub RadScheduler1_NavigationComplete(sender As Object, e As SchedulerNavigationCompleteEventArgs)
+ Label1.Text = RadScheduler1.SelectedDate
+ End Sub
+
+
+ void RadScheduler1_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
+ {
+ if (e.Mode == SchedulerFormMode.Insert)
+ {
+ e.Cancel = true;
+ }
+ }
+
+
+ Sub RadScheduler1_FormCreating(sender As Object, e As SchedulerFormCreatingEventArgs)
+ If e.Mode = SchedulerFormMode.Insert Then
+ e.Cancel = True
+ End If
+ End Sub
+
+
+ void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
+ {
+ if (e.Container.Mode == SchedulerFormMode.Insert)
+ {
+ Label startDate = (Label) e.Container.FindControl("StartDate");
+ startDate.Text = e.Container.Appointment.Start;
+ }
+ }
+
+
+ Sub RadScheduler1_FormCreated(sender As Object, e As SchedulerFormCreatedEventArgs)
+ If e.Container.Mode = SchedulerFormMode.Insert Then
+ Dim startDate As Label = CType(e.Container.FindControl("StartDate"), Label)
+ startDate.Text = e.Container.Appointment.Start
+ End If
+ End Sub
+
+
+ void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
+ {
+ if (e.Container.Mode == SchedulerFormMode.Insert)
+ {
+ TextBox startDate = (TextBox) e.Container.FindControl("StartDate");
+ if (startDate.Text == String.Empty)
+ {
+ e.Cancel = true;
+ }
+ }
+ }
+
+
+ Sub RadScheduler1_FormCreated(sender As Object, e As SchedulerFormCreatedEventArgs)
+ If e.Container.Mode = SchedulerFormMode.Insert Then
+ Dim startDate As TextBox = CType(e.Container.FindControl("StartDate"), TextBox)
+ If startDate.Text = String.Empty Then
+ e.Cancel = true
+ End If
+ End If
+ End Sub
+
+
+ void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
+ {
+ e.TimeSlot.CssClass = "holidayTimeSlot";
+ }
+
+
+ Sub RadScheduler1_TimeSlotCreated(sender As Object, e As TimeSlotCreatedEventArgs)
+ e.TimeSlot.CssClass = "holidayTimeSlot"
+ End Sub
+
+
+ void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
+ {
+ e.Container.Controls.Add(new LiteralControl("Test"));
+ }
+
+
+ Sub RadScheduler1_TimeSlotCreated(sender As Object, e As TimeSlotCreatedEventArgs)
+ e.Container.Controls.Add(new LiteralControl("Test"))
+ End Sub
+
+
+ void RadScheduler1_RecurrenceExceptionCreated(object sender, RecurrenceExceptionCreatedEventArgs e)
+ {
+ e.Cancel = true;
+ }
+
+
+ Sub RadScheduler1_RecurrenceExceptionCreated(sender As Object, e As RecurrenceExceptionCreatedEventArgs)
+ e.Cancel = true
+ End Sub
+
+
+ void RadScheduler1_ResourcesPopulating(object sender, ResourcesPopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ }
+
+
+ Sub RadScheduler1_ResourcesPopulating(sender As Object, e As ResourcesPopulatingEventArgs)
+ e.Cancel = true
+ End Sub
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class DailyRecurrenceRuleExample1
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 10;
+
+ // Creates a recurrence rule to repeat the appointment every two days.
+ DailyRecurrenceRule rrule = new DailyRecurrenceRule(2, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek);
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 6/1/2007 3:30:00 PM (Friday)
+ 2: 6/3/2007 3:30:00 PM (Sunday)
+ 3: 6/5/2007 3:30:00 PM (Tuesday)
+ 4: 6/7/2007 3:30:00 PM (Thursday)
+ 5: 6/9/2007 3:30:00 PM (Saturday)
+ 6: 6/11/2007 3:30:00 PM (Monday)
+ 7: 6/13/2007 3:30:00 PM (Wednesday)
+ 8: 6/15/2007 3:30:00 PM (Friday)
+ 9: 6/17/2007 3:30:00 PM (Sunday)
+ 10: 6/19/2007 3:30:00 PM (Tuesday)
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class DailyRecurrenceRuleExample1
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 10
+
+ ' Creates a recurrence rule to repeat the appointment every two days.
+ Dim rrule As New DailyRecurrenceRule(2, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek)
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/1/2007 3:30:00 PM (Friday)
+ ' 2: 6/3/2007 3:30:00 PM (Sunday)
+ ' 3: 6/5/2007 3:30:00 PM (Tuesday)
+ ' 4: 6/7/2007 3:30:00 PM (Thursday)
+ ' 5: 6/9/2007 3:30:00 PM (Saturday)
+ ' 6: 6/11/2007 3:30:00 PM (Monday)
+ ' 7: 6/13/2007 3:30:00 PM (Wednesday)
+ ' 8: 6/15/2007 3:30:00 PM (Friday)
+ ' 9: 6/17/2007 3:30:00 PM (Sunday)
+ '10: 6/19/2007 3:30:00 PM (Tuesday)
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class ParsingExample
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 10;
+
+ // Creates a recurrence rule to repeat the appointment every 2 hours.
+ HourlyRecurrenceRule rrule = new HourlyRecurrenceRule(2, range);
+
+ // Prints the string representation of the recurrence rule:
+ string rruleAsString = rrule.ToString();
+ Console.WriteLine("Recurrence rule:\n\n{0}\n", rruleAsString);
+
+ // The string representation can be stored in a database, etc.
+ // ...
+
+ // Then it can be reconstructed using TryParse method:
+ RecurrenceRule parsedRule;
+ RecurrenceRule.TryParse(rruleAsString, out parsedRule);
+ Console.WriteLine("After parsing (should be the same):\n\n{0}", parsedRule);
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Recurrence rule:
+
+ DTSTART:20070601T123000Z
+ DTEND:20070601T130000Z
+ RRULE:FREQ=HOURLY;COUNT=10;INTERVAL=2;
+
+
+ After parsing (should be the same):
+
+ DTSTART:20070601T123000Z
+ DTEND:20070601T130000Z
+ RRULE:FREQ=HOURLY;COUNT=10;INTERVAL=2;
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class ParsingExample
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 10
+
+ ' Creates a recurrence rule to repeat the appointment every 2 hours.
+ Dim rrule As New HourlyRecurrenceRule(2, range)
+
+ ' Prints the string representation of the recurrence rule:
+ Dim rruleAsString As String = rrule.ToString()
+ Console.WriteLine("Recurrence rule:" & Chr(10) & "" & Chr(10) & "{0}" & Chr(10) & "", rruleAsString)
+
+ ' The string representation can be stored in a database, etc.
+ ' ...
+
+ ' Then it can be reconstructed using TryParse method:
+ Dim parsedRule As RecurrenceRule
+ RecurrenceRule.TryParse(rruleAsString, parsedRule)
+ Console.WriteLine("After parsing (should be the same):" & Chr(10) & "" & Chr(10) & "{0}", parsedRule)
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Recurrence rule:
+ '
+ 'DTSTART:20070601T123000Z
+ 'DTEND:20070601T130000Z
+ 'RRULE:FREQ=HOURLY;COUNT=10;INTERVAL=2;
+ '
+ '
+ 'After parsing (should be the same):
+ '
+ 'DTSTART:20070601T123000Z
+ 'DTEND:20070601T130000Z
+ 'RRULE:FREQ=HOURLY;COUNT=10;INTERVAL=2;
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class EffectiveRangeExample
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 10;
+
+ // Creates a recurrence rule to repeat the appointment every 2 hours.
+ HourlyRecurrenceRule rrule = new HourlyRecurrenceRule(2, range);
+
+ // Limits the effective range.
+ rrule.SetEffectiveRange(Convert.ToDateTime("6/1/2007 5:00 PM"), Convert.ToDateTime("6/1/2007 8:00 PM"));
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime());
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 6/1/2007 5:30:00 PM
+ 2: 6/1/2007 7:30:00 PM
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class EffectiveRangeExample
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 10
+
+ ' Creates a recurrence rule to repeat the appointment every 2 hours.
+ Dim rrule As New HourlyRecurrenceRule(2, range)
+
+ ' Limits the effective range.
+ rrule.SetEffectiveRange(Convert.ToDateTime("6/1/2007 5:00 PM"), Convert.ToDateTime("6/1/2007 8:00 PM"))
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/1/2007 5:30:00 PM
+ ' 2: 6/1/2007 7:30:00 PM
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class ParsingExample
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 10;
+
+ // Creates a recurrence rule to repeat the appointment every 2 hours.
+ HourlyRecurrenceRule rrule = new HourlyRecurrenceRule(2, range);
+
+ // Prints the string representation of the recurrence rule:
+ string rruleAsString = rrule.ToString();
+ Console.WriteLine("Recurrence rule:\n\n{0}\n", rruleAsString);
+
+ // The string representation can be stored in a database, etc.
+ // ...
+
+ // Then it can be reconstructed using TryParse method:
+ RecurrenceRule parsedRule;
+ RecurrenceRule.TryParse(rruleAsString, out parsedRule);
+ Console.WriteLine("After parsing (should be the same):\n\n{0}", parsedRule);
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Recurrence rule:
+
+ DTSTART:20070601T123000Z
+ DTEND:20070601T130000Z
+ RRULE:FREQ=HOURLY;COUNT=10;INTERVAL=2;
+
+
+ After parsing (should be the same):
+
+ DTSTART:20070601T123000Z
+ DTEND:20070601T130000Z
+ RRULE:FREQ=HOURLY;COUNT=10;INTERVAL=2;
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class ParsingExample
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 10
+
+ ' Creates a recurrence rule to repeat the appointment every 2 hours.
+ Dim rrule As New HourlyRecurrenceRule(2, range)
+
+ ' Prints the string representation of the recurrence rule:
+ Dim rruleAsString As String = rrule.ToString()
+ Console.WriteLine("Recurrence rule:" & Chr(10) & "" & Chr(10) & "{0}" & Chr(10) & "", rruleAsString)
+
+ ' The string representation can be stored in a database, etc.
+ ' ...
+
+ ' Then it can be reconstructed using TryParse method:
+ Dim parsedRule As RecurrenceRule
+ RecurrenceRule.TryParse(rruleAsString, parsedRule)
+ Console.WriteLine("After parsing (should be the same):" & Chr(10) & "" & Chr(10) & "{0}", parsedRule)
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Recurrence rule:
+ '
+ 'DTSTART:20070601T123000Z
+ 'DTEND:20070601T130000Z
+ 'RRULE:FREQ=HOURLY;COUNT=10;INTERVAL=2;
+ '
+ '
+ 'After parsing (should be the same):
+ '
+ 'DTSTART:20070601T123000Z
+ 'DTEND:20070601T130000Z
+ 'RRULE:FREQ=HOURLY;COUNT=10;INTERVAL=2;
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class HourlyRecurrenceRuleExample
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 10;
+
+ // Creates a recurrence rule to repeat the appointment every 2 hours.
+ HourlyRecurrenceRule rrule = new HourlyRecurrenceRule(2, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime());
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 6/1/2007 3:30:00 PM
+ 2: 6/1/2007 5:30:00 PM
+ 3: 6/1/2007 7:30:00 PM
+ 4: 6/1/2007 9:30:00 PM
+ 5: 6/1/2007 11:30:00 PM
+ 6: 6/2/2007 1:30:00 AM
+ 7: 6/2/2007 3:30:00 AM
+ 8: 6/2/2007 5:30:00 AM
+ 9: 6/2/2007 7:30:00 AM
+ 10: 6/2/2007 9:30:00 AM
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class HourlyRecurrenceRuleExample
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 10
+
+ ' Creates a recurrence rule to repeat the appointment every 2 hours.
+ Dim rrule As New HourlyRecurrenceRule(2, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/1/2007 3:30:00 PM
+ ' 2: 6/1/2007 5:30:00 PM
+ ' 3: 6/1/2007 7:30:00 PM
+ ' 4: 6/1/2007 9:30:00 PM
+ ' 5: 6/1/2007 11:30:00 PM
+ ' 6: 6/2/2007 1:30:00 AM
+ ' 7: 6/2/2007 3:30:00 AM
+ ' 8: 6/2/2007 5:30:00 AM
+ ' 9: 6/2/2007 7:30:00 AM
+ '10: 6/2/2007 9:30:00 AM
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class RecurrenceExceptionsExample
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 10;
+
+ // Creates a recurrence rule to repeat the appointment every 2 hours.
+ HourlyRecurrenceRule rrule = new HourlyRecurrenceRule(2, range);
+
+ // Creates a recurrence exception for 5:30 PM (local time).
+ // Note that exception dates must be in universal time.
+ rrule.Exceptions.Add(Convert.ToDateTime("6/1/2007 5:30 PM").ToUniversalTime());
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime());
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 6/1/2007 3:30:00 PM
+ 2: 6/1/2007 7:30:00 PM
+ 3: 6/1/2007 9:30:00 PM
+ 4: 6/1/2007 11:30:00 PM
+ 5: 6/2/2007 1:30:00 AM
+ 6: 6/2/2007 3:30:00 AM
+ 7: 6/2/2007 5:30:00 AM
+ 8: 6/2/2007 7:30:00 AM
+ 9: 6/2/2007 9:30:00 AM
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class RecurrenceExceptionsExample
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 10
+
+ ' Creates a recurrence rule to repeat the appointment every 2 hours.
+ Dim rrule As New HourlyRecurrenceRule(2, range)
+
+ ' Creates a recurrence exception for 5:30 PM (local time).
+ ' Note that exception dates must be in universal time.
+ rrule.Exceptions.Add(Convert.ToDateTime("6/1/2007 5:30 PM").ToUniversalTime())
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/1/2007 3:30:00 PM
+ ' 2: 6/1/2007 7:30:00 PM
+ ' 3: 6/1/2007 9:30:00 PM
+ ' 4: 6/1/2007 11:30:00 PM
+ ' 5: 6/2/2007 1:30:00 AM
+ ' 6: 6/2/2007 3:30:00 AM
+ ' 7: 6/2/2007 5:30:00 AM
+ ' 8: 6/2/2007 7:30:00 AM
+ ' 9: 6/2/2007 9:30:00 AM
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class DailyRecurrenceRuleExample1
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 10;
+
+ // Creates a recurrence rule to repeat the appointment every two days.
+ DailyRecurrenceRule rrule = new DailyRecurrenceRule(2, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek);
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 6/1/2007 3:30:00 PM (Friday)
+ 2: 6/3/2007 3:30:00 PM (Sunday)
+ 3: 6/5/2007 3:30:00 PM (Tuesday)
+ 4: 6/7/2007 3:30:00 PM (Thursday)
+ 5: 6/9/2007 3:30:00 PM (Saturday)
+ 6: 6/11/2007 3:30:00 PM (Monday)
+ 7: 6/13/2007 3:30:00 PM (Wednesday)
+ 8: 6/15/2007 3:30:00 PM (Friday)
+ 9: 6/17/2007 3:30:00 PM (Sunday)
+ 10: 6/19/2007 3:30:00 PM (Tuesday)
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class DailyRecurrenceRuleExample1
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 10
+
+ ' Creates a recurrence rule to repeat the appointment every two days.
+ Dim rrule As New DailyRecurrenceRule(2, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek)
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/1/2007 3:30:00 PM (Friday)
+ ' 2: 6/3/2007 3:30:00 PM (Sunday)
+ ' 3: 6/5/2007 3:30:00 PM (Tuesday)
+ ' 4: 6/7/2007 3:30:00 PM (Thursday)
+ ' 5: 6/9/2007 3:30:00 PM (Saturday)
+ ' 6: 6/11/2007 3:30:00 PM (Monday)
+ ' 7: 6/13/2007 3:30:00 PM (Wednesday)
+ ' 8: 6/15/2007 3:30:00 PM (Friday)
+ ' 9: 6/17/2007 3:30:00 PM (Sunday)
+ '10: 6/19/2007 3:30:00 PM (Tuesday)
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class DailyRecurrenceRuleExample2
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 10;
+
+ // Creates a recurrence rule to repeat the appointment every week day.
+ DailyRecurrenceRule rrule = new DailyRecurrenceRule(RecurrenceDay.WeekDays, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek);
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 6/1/2007 3:30:00 PM (Friday)
+ 2: 6/4/2007 3:30:00 PM (Monday)
+ 3: 6/5/2007 3:30:00 PM (Tuesday)
+ 4: 6/6/2007 3:30:00 PM (Wednesday)
+ 5: 6/7/2007 3:30:00 PM (Thursday)
+ 6: 6/8/2007 3:30:00 PM (Friday)
+ 7: 6/11/2007 3:30:00 PM (Monday)
+ 8: 6/12/2007 3:30:00 PM (Tuesday)
+ 9: 6/13/2007 3:30:00 PM (Wednesday)
+ 10: 6/14/2007 3:30:00 PM (Thursday)
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class DailyRecurrenceRuleExample2
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 10
+
+ ' Creates a recurrence rule to repeat the appointment every week day.
+ Dim rrule As New DailyRecurrenceRule(RecurrenceDay.WeekDays, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek)
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/1/2007 3:30:00 PM (Friday)
+ ' 2: 6/4/2007 3:30:00 PM (Monday)
+ ' 3: 6/5/2007 3:30:00 PM (Tuesday)
+ ' 4: 6/6/2007 3:30:00 PM (Wednesday)
+ ' 5: 6/7/2007 3:30:00 PM (Thursday)
+ ' 6: 6/8/2007 3:30:00 PM (Friday)
+ ' 7: 6/11/2007 3:30:00 PM (Monday)
+ ' 8: 6/12/2007 3:30:00 PM (Tuesday)
+ ' 9: 6/13/2007 3:30:00 PM (Wednesday)
+ '10: 6/14/2007 3:30:00 PM (Thursday)
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class HourlyRecurrenceRuleExample
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 10;
+
+ // Creates a recurrence rule to repeat the appointment every 2 hours.
+ HourlyRecurrenceRule rrule = new HourlyRecurrenceRule(2, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime());
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 6/1/2007 3:30:00 PM
+ 2: 6/1/2007 5:30:00 PM
+ 3: 6/1/2007 7:30:00 PM
+ 4: 6/1/2007 9:30:00 PM
+ 5: 6/1/2007 11:30:00 PM
+ 6: 6/2/2007 1:30:00 AM
+ 7: 6/2/2007 3:30:00 AM
+ 8: 6/2/2007 5:30:00 AM
+ 9: 6/2/2007 7:30:00 AM
+ 10: 6/2/2007 9:30:00 AM
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class HourlyRecurrenceRuleExample
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 10
+
+ ' Creates a recurrence rule to repeat the appointment every 2 hours.
+ Dim rrule As New HourlyRecurrenceRule(2, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/1/2007 3:30:00 PM
+ ' 2: 6/1/2007 5:30:00 PM
+ ' 3: 6/1/2007 7:30:00 PM
+ ' 4: 6/1/2007 9:30:00 PM
+ ' 5: 6/1/2007 11:30:00 PM
+ ' 6: 6/2/2007 1:30:00 AM
+ ' 7: 6/2/2007 3:30:00 AM
+ ' 8: 6/2/2007 5:30:00 AM
+ ' 9: 6/2/2007 7:30:00 AM
+ '10: 6/2/2007 9:30:00 AM
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class MonthlyRecurrenceRuleExample1
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 5;
+
+ // Creates a recurrence rule to repeat the appointment on the 5th day of every month.
+ MonthlyRecurrenceRule rrule = new MonthlyRecurrenceRule(5, 1, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime());
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 6/5/2007 3:30:00 PM
+ 2: 7/5/2007 3:30:00 PM
+ 3: 8/5/2007 3:30:00 PM
+ 4: 9/5/2007 3:30:00 PM
+ 5: 10/5/2007 3:30:00 PM
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class MonthlyRecurrenceRuleExample1
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 5
+
+ ' Creates a recurrence rule to repeat the appointment on the 5th day of every month.
+ Dim rrule As New MonthlyRecurrenceRule(5, 1, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/5/2007 3:30:00 PM
+ ' 2: 7/5/2007 3:30:00 PM
+ ' 3: 8/5/2007 3:30:00 PM
+ ' 4: 9/5/2007 3:30:00 PM
+ ' 5: 10/5/2007 3:30:00 PM
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class MonthlyRecurrenceRuleExample1
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 5;
+
+ // Creates a recurrence rule to repeat the appointment on the 5th day of every month.
+ MonthlyRecurrenceRule rrule = new MonthlyRecurrenceRule(5, 1, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime());
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 6/5/2007 3:30:00 PM
+ 2: 7/5/2007 3:30:00 PM
+ 3: 8/5/2007 3:30:00 PM
+ 4: 9/5/2007 3:30:00 PM
+ 5: 10/5/2007 3:30:00 PM
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class MonthlyRecurrenceRuleExample1
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 5
+
+ ' Creates a recurrence rule to repeat the appointment on the 5th day of every month.
+ Dim rrule As New MonthlyRecurrenceRule(5, 1, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/5/2007 3:30:00 PM
+ ' 2: 7/5/2007 3:30:00 PM
+ ' 3: 8/5/2007 3:30:00 PM
+ ' 4: 9/5/2007 3:30:00 PM
+ ' 5: 10/5/2007 3:30:00 PM
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class MonthlyRecurrenceRuleExample2
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 5;
+
+ // Creates a recurrence rule to repeat the appointment on the last monday of every two months.
+ MonthlyRecurrenceRule rrule = new MonthlyRecurrenceRule(-1, RecurrenceDay.Monday, 2, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime());
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 6/25/2007 3:30:00 PM
+ 2: 8/27/2007 3:30:00 PM
+ 3: 10/29/2007 2:30:00 PM
+ 4: 12/31/2007 2:30:00 PM
+ 5: 2/25/2008 2:30:00 PM
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class MonthlyRecurrenceRuleExample2
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 5
+
+ ' Creates a recurrence rule to repeat the appointment on the last monday of every two months.
+ Dim rrule As New MonthlyRecurrenceRule(-1, RecurrenceDay.Monday, 2, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/25/2007 3:30:00 PM
+ ' 2: 8/27/2007 3:30:00 PM
+ ' 3: 10/29/2007 2:30:00 PM
+ ' 4: 12/31/2007 2:30:00 PM
+ ' 5: 2/25/2008 2:30:00 PM
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class RecurrenceDayExample
+ {
+ static void Main()
+ {
+ // Selects Friday, Saturday and Sunday.
+ RecurrenceDay dayMask = RecurrenceDay.Friday | RecurrenceDay.WeekendDays;
+ PrintSelectedDays(dayMask);
+
+ // Selects all days, except Thursday.
+ dayMask = RecurrenceDay.EveryDay ^ RecurrenceDay.Thursday;
+ PrintSelectedDays(dayMask);
+ }
+
+ static void PrintSelectedDays(RecurrenceDay dayMask)
+ {
+ Console.WriteLine("Value: {0,3} - {1}", (int) dayMask, dayMask);
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Value: 112 - Friday, WeekendDays
+ Value: 119 - Monday, Tuesday, Wednesday, Friday, WeekendDays
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class RecurrenceDayExample
+ Shared Sub Main()
+ ' Selects Friday, Saturday and Sunday.
+ Dim dayMask As RecurrenceDay = RecurrenceDay.Friday Or RecurrenceDay.WeekendDays
+ PrintSelectedDays(dayMask)
+
+ ' Selects all days, except Thursday.
+ dayMask = RecurrenceDay.EveryDay Xor RecurrenceDay.Thursday
+ PrintSelectedDays(dayMask)
+ End Sub
+
+ Shared Sub PrintSelectedDays(ByVal dayMask As RecurrenceDay)
+ Console.WriteLine("Value: {0,3} - {1}", DirectCast(dayMask, Integer), dayMask)
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Value: 112 - Friday, WeekendDays
+ 'Value: 119 - Monday, Tuesday, Wednesday, Friday, WeekendDays
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class RecurrencePatternExample
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 10;
+
+ // Creates a recurrence rule for the appointment.
+ DailyRecurrenceRule rrule = new DailyRecurrenceRule(1, range);
+
+ // Displays the relevant parts of the generated pattern:
+ Console.WriteLine("The active recurrence pattern is:");
+ Console.WriteLine(" Frequency: {0}", rrule.Pattern.Frequency);
+ Console.WriteLine(" Interval: {0}", rrule.Pattern.Interval);
+ Console.WriteLine(" Days of week: {0}\n", rrule.Pattern.DaysOfWeekMask);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime());
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ The active recurrence pattern is:
+ Frequency: Daily
+ Interval: 1
+ Days of week: EveryDay
+
+ Appointment occurrs at the following times:
+ 1: 6/1/2007 3:30:00 PM
+ 2: 6/2/2007 3:30:00 PM
+ 3: 6/3/2007 3:30:00 PM
+ 4: 6/4/2007 3:30:00 PM
+ 5: 6/5/2007 3:30:00 PM
+ 6: 6/6/2007 3:30:00 PM
+ 7: 6/7/2007 3:30:00 PM
+ 8: 6/8/2007 3:30:00 PM
+ 9: 6/9/2007 3:30:00 PM
+ 10: 6/10/2007 3:30:00 PM
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class RecurrencePatternExample
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 10
+
+ ' Creates a recurrence rule for the appointment.
+ Dim rrule As New DailyRecurrenceRule(1, range)
+
+ ' Displays the relevant parts of the generated pattern:
+ Console.WriteLine("The active recurrence pattern is:")
+ Console.WriteLine(" Frequency: {0}", rrule.Pattern.Frequency)
+ Console.WriteLine(" Interval: {0}", rrule.Pattern.Interval)
+ Console.WriteLine(" Days of week: {0}" & Chr(10) & "", rrule.Pattern.DaysOfWeekMask)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'The active recurrence pattern is:
+ ' Frequency: Daily
+ ' Interval: 1
+ ' Days of week: EveryDay
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/1/2007 3:30:00 PM
+ ' 2: 6/2/2007 3:30:00 PM
+ ' 3: 6/3/2007 3:30:00 PM
+ ' 4: 6/4/2007 3:30:00 PM
+ ' 5: 6/5/2007 3:30:00 PM
+ ' 6: 6/6/2007 3:30:00 PM
+ ' 7: 6/7/2007 3:30:00 PM
+ ' 8: 6/8/2007 3:30:00 PM
+ ' 9: 6/9/2007 3:30:00 PM
+ '10: 6/10/2007 3:30:00 PM
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class RecurrenceRangeExample
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 10;
+
+ // Creates a daily recurrence rule for the appointment.
+ DailyRecurrenceRule rrule = new DailyRecurrenceRule(1, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime());
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 6/1/2007 3:30:00 PM
+ 2: 6/2/2007 3:30:00 PM
+ 3: 6/3/2007 3:30:00 PM
+ 4: 6/4/2007 3:30:00 PM
+ 5: 6/5/2007 3:30:00 PM
+ 6: 6/6/2007 3:30:00 PM
+ 7: 6/7/2007 3:30:00 PM
+ 8: 6/8/2007 3:30:00 PM
+ 9: 6/9/2007 3:30:00 PM
+ 10: 6/10/2007 3:30:00 PM
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class RecurrenceRangeExample
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 10
+
+ ' Creates a daily recurrence rule for the appointment.
+ Dim rrule As New DailyRecurrenceRule(1, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/1/2007 3:30:00 PM
+ ' 2: 6/2/2007 3:30:00 PM
+ ' 3: 6/3/2007 3:30:00 PM
+ ' 4: 6/4/2007 3:30:00 PM
+ ' 5: 6/5/2007 3:30:00 PM
+ ' 6: 6/6/2007 3:30:00 PM
+ ' 7: 6/7/2007 3:30:00 PM
+ ' 8: 6/8/2007 3:30:00 PM
+ ' 9: 6/9/2007 3:30:00 PM
+ '10: 6/10/2007 3:30:00 PM
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class WeeklyRecurrenceRuleExample
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
+ Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 10;
+
+ // Creates a recurrence rule to repeat the appointment every two weeks on Mondays and Tuesdays.
+ RecurrenceDay mask = RecurrenceDay.Monday | RecurrenceDay.Tuesday;
+ WeeklyRecurrenceRule rrule = new WeeklyRecurrenceRule(2, mask, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek);
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 6/4/2007 3:30:00 PM (Monday)
+ 2: 6/5/2007 3:30:00 PM (Tuesday)
+ 3: 6/18/2007 3:30:00 PM (Monday)
+ 4: 6/19/2007 3:30:00 PM (Tuesday)
+ 5: 7/2/2007 3:30:00 PM (Monday)
+ 6: 7/3/2007 3:30:00 PM (Tuesday)
+ 7: 7/16/2007 3:30:00 PM (Monday)
+ 8: 7/17/2007 3:30:00 PM (Tuesday)
+ 9: 7/30/2007 3:30:00 PM (Monday)
+ 10: 7/31/2007 3:30:00 PM (Tuesday)
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class WeeklyRecurrenceRuleExample
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 10
+
+ ' Creates a recurrence rule to repeat the appointment every two weeks on Mondays and Tuesdays.
+ Dim mask As RecurrenceDay = RecurrenceDay.Monday Or RecurrenceDay.Tuesday
+ Dim rrule As New WeeklyRecurrenceRule(2, mask, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek)
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 6/4/2007 3:30:00 PM (Monday)
+ ' 2: 6/5/2007 3:30:00 PM (Tuesday)
+ ' 3: 6/18/2007 3:30:00 PM (Monday)
+ ' 4: 6/19/2007 3:30:00 PM (Tuesday)
+ ' 5: 7/2/2007 3:30:00 PM (Monday)
+ ' 6: 7/3/2007 3:30:00 PM (Tuesday)
+ ' 7: 7/16/2007 3:30:00 PM (Monday)
+ ' 8: 7/17/2007 3:30:00 PM (Tuesday)
+ ' 9: 7/30/2007 3:30:00 PM (Monday)
+ '10: 7/31/2007 3:30:00 PM (Tuesday)
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class YearlyRecurrenceRuleExample1
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 4/1/2007 10:00 AM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("4/1/2007 10:00 AM"),
+ Convert.ToDateTime("4/1/2007 10:30 AM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 5;
+
+ // Creates a recurrence rule to repeat the appointment on the 1th of April each year.
+ YearlyRecurrenceRule rrule = new YearlyRecurrenceRule(RecurrenceMonth.April, 1, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime());
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 4/1/2007 10:00:00 AM
+ 2: 4/1/2008 10:00:00 AM
+ 3: 4/1/2009 10:00:00 AM
+ 4: 4/1/2010 10:00:00 AM
+ 5: 4/1/2011 10:00:00 AM
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class YearlyRecurrenceRuleExample1
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 4/1/2007 10:00 AM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("4/1/2007 10:00 AM"), Convert.ToDateTime("4/1/2007 10:30 AM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 5
+
+ ' Creates a recurrence rule to repeat the appointment on the 1th of April each year.
+ Dim rrule As New YearlyRecurrenceRule(RecurrenceMonth.April, 1, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 4/1/2007 10:00:00 AM
+ ' 2: 4/1/2008 10:00:00 AM
+ ' 3: 4/1/2009 10:00:00 AM
+ ' 4: 4/1/2010 10:00:00 AM
+ ' 5: 4/1/2011 10:00:00 AM
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class YearlyRecurrenceRuleExample1
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 4/1/2007 10:00 AM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("4/1/2007 10:00 AM"),
+ Convert.ToDateTime("4/1/2007 10:30 AM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 5;
+
+ // Creates a recurrence rule to repeat the appointment on the 1th of April each year.
+ YearlyRecurrenceRule rrule = new YearlyRecurrenceRule(RecurrenceMonth.April, 1, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime());
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 4/1/2007 10:00:00 AM
+ 2: 4/1/2008 10:00:00 AM
+ 3: 4/1/2009 10:00:00 AM
+ 4: 4/1/2010 10:00:00 AM
+ 5: 4/1/2011 10:00:00 AM
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class YearlyRecurrenceRuleExample1
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 4/1/2007 10:00 AM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("4/1/2007 10:00 AM"), Convert.ToDateTime("4/1/2007 10:30 AM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 5
+
+ ' Creates a recurrence rule to repeat the appointment on the 1th of April each year.
+ Dim rrule As New YearlyRecurrenceRule(RecurrenceMonth.April, 1, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 4/1/2007 10:00:00 AM
+ ' 2: 4/1/2008 10:00:00 AM
+ ' 3: 4/1/2009 10:00:00 AM
+ ' 4: 4/1/2010 10:00:00 AM
+ ' 5: 4/1/2011 10:00:00 AM
+ '
+
+
+ using System;
+ using Telerik.Web.UI;
+
+ namespace RecurrenceExamples
+ {
+ class YearlyRecurrenceRuleExample2
+ {
+ static void Main()
+ {
+ // Creates a sample appointment that starts at 4/1/2007 10:00 AM (local time) and lasts half an hour.
+ Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("4/1/2007 10:00 AM"),
+ Convert.ToDateTime("4/1/2007 10:30 AM"), "Sample appointment");
+
+ // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ RecurrenceRange range = new RecurrenceRange();
+ range.Start = recurringAppointment.Start;
+ range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
+ range.MaxOccurrences = 5;
+
+ // Creates a recurrence rule to repeat the appointment on the second monday of April each year.
+ YearlyRecurrenceRule rrule = new YearlyRecurrenceRule(2, RecurrenceMonth.April, RecurrenceDay.Monday, range);
+
+ Console.WriteLine("Appointment occurrs at the following times: ");
+ int ix = 0;
+ foreach (DateTime occurrence in rrule.Occurrences)
+ {
+ ix = ix + 1;
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime());
+ }
+ }
+ }
+ }
+
+ /*
+ This example produces the following results:
+
+ Appointment occurrs at the following times:
+ 1: 4/9/2007 10:00:00 AM
+ 2: 4/14/2008 10:00:00 AM
+ 3: 4/13/2009 10:00:00 AM
+ 4: 4/12/2010 10:00:00 AM
+ 5: 4/11/2011 10:00:00 AM
+ */
+
+
+ Imports System
+ Imports Telerik.Web.UI
+
+ Namespace RecurrenceExamples
+ Class YearlyRecurrenceRuleExample2
+ Shared Sub Main()
+ ' Creates a sample appointment that starts at 4/1/2007 10:00 AM (local time) and lasts half an hour.
+ Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("4/1/2007 10:00 AM"), Convert.ToDateTime("4/1/2007 10:30 AM"), "Sample appointment")
+
+ ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
+ Dim range As New RecurrenceRange()
+ range.Start = recurringAppointment.Start
+ range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
+ range.MaxOccurrences = 5
+
+ ' Creates a recurrence rule to repeat the appointment on the second monday of April each year.
+ Dim rrule As New YearlyRecurrenceRule(2, RecurrenceMonth.April, RecurrenceDay.Monday, range)
+
+ Console.WriteLine("Appointment occurrs at the following times: ")
+ Dim ix As Integer = 0
+ For Each occurrence As DateTime In rrule.Occurrences
+ ix = ix + 1
+ Console.WriteLine("{0,2}: {1}", ix, occurrence.ToLocalTime())
+ Next
+ End Sub
+ End Class
+ End Namespace
+
+ '
+ 'This example produces the following results:
+ '
+ 'Appointment occurrs at the following times:
+ ' 1: 4/9/2007 10:00:00 AM
+ ' 2: 4/14/2008 10:00:00 AM
+ ' 3: 4/13/2009 10:00:00 AM
+ ' 4: 4/12/2010 10:00:00 AM
+ ' 5: 4/11/2011 10:00:00 AM
+ '
+
+ + Url: http://www.myserver.com/myapp/mydirectory/myfile + Result: /myapp/mydirectory/myfile +
++ Url: www.myserver.com/myapp/mydirectory/myfile + Result: /myapp/mydirectory/myfile +
++ If you want to specify multiple permissions, use the following syntax: +
++ Dim permissions As PathPermissions = PathPermissions.Read Or PathPermissions.Upload Or PathPermissions.Delete ++
+ [ScriptService]
+ public class WebServiceName : WebService
+ {
+ [WebMethod]
+ public string WebServiceMethodName(object context)
+ {
+ // We cannot use a dictionary as a parameter, because it is only supported by script services.
+ // The context object should be cast to a dictionary at runtime.
+ IDictionary<string, object> contextDictionary = (IDictionary<string, object>) context;
+
+ //...
+ }
+ }
+
+
+ <httpRuntime maxRequestLength="1000" />
+
+
+ <httpRuntime maxRequestLength="1000" />
+
+
+ Dim Loop1 As Integer
+ Dim TempFileName As String
+ Dim MyFileCollection As UploadedFileCollection = RadUpload1.UploadedFiles
+
+ For Loop1 = 0 To MyFileCollection.Count - 1
+ ' Create a new file name.
+ TempFileName = "C:\TempFiles\File_" & CStr(Loop1)
+ ' Save the file.
+ MyFileCollection(Loop1).SaveAs(TempFileName)
+ Next Loop1
+
+
+ String TempFileName;
+ UploadedFileCollection MyFileCollection = RadUpload1.UploadedFiles;
+
+ for (int Loop1 = 0; Loop1 < MyFileCollection.Count; Loop1++)
+ {
+ // Create a new file name.
+ TempFileName = "C:\\TempFiles\\File_" + Loop1.ToString();
+ // Save the file.
+ MyFileCollection[Loop1].SaveAs(TempFileName);
+ }
+
+
+ Dim Loop1 As Integer
+ Dim TempFileName As String
+ Dim ShouldOverwrite As Boolean = True
+ Dim MyFileCollection As UploadedFileCollection = RadUpload1.UploadedFiles
+
+ For Loop1 = 0 To MyFileCollection.Count - 1
+ ' Create a new file name.
+ TempFileName = "C:\TempFiles\File_" & CStr(Loop1)
+ ' Save the file.
+ MyFileCollection(Loop1).SaveAs(TempFileName, ShouldOverwrite)
+ Next Loop1
+
+
+ String TempFileName;
+ bool ShouldOverwrite = true;
+ UploadedFileCollection MyFileCollection = RadUpload1.UploadedFiles;
+
+ for (int Loop1 = 0; Loop1 < MyFileCollection.Count; Loop1++)
+ {
+ // Create a new file name.
+ TempFileName = "C:\\TempFiles\\File_" + Loop1.ToString();
+ // Save the file.
+ MyFileCollection[Loop1].SaveAs(TempFileName, ShouldOverwrite);
+ }
+
+
+ bool isValid = true;
+ if (file.ContentLength > MaxFileSize)
+ {
+ isValid = false;
+ }
+
+
+ Dim isValid As Boolean = True;
+ If file.ContentLength > MaxFileSize Then
+ isValid = False;
+ End If
+
+
+ Dim Loop1 As Integer
+ Dim MyFileCollection As UploadedFileCollection = RadUpload1.UploadedFiles
+
+ For Loop1 = 0 To MyFileCollection.Count - 1
+ If MyFileCollection(Loop1).ContentType = "video/mpeg" Then
+ '...
+ End If
+ Next Loop1
+
+
+ UploadedFileCollection MyFileCollection = RadUpload1.UploadedFiles;
+
+ for (int Loop1 = 0; Loop1 < MyFileCollection.Count; Loop1++)
+ {
+ if (MyFileCollection[Loop1].ContentType == "video/mpeg")
+ {
+ //...
+ }
+ }
+
+
+ UploadedFile MyUploadedFile = RadUpload1.UploadedFiles[0];
+ string MyFileName = MyUploadedFile.FileName;
+
+
+ Dim MyUploadedFile As UploadedFile = RadUpload1.UploadedFiles(0)
+ Dim MyFileName As String = MyUploadedFile.FileName
+
+
+ <radU:RadUpload Language="es-Es" ... />
+
+
+ <radU:RadUpload Language="es-Es" ... />
+
+
+ <radU:RadProgressArea OnClientProgressUpdating="myOnClientProgressUpdating" ... />
+ ...
+ <script>
+ function myOnClientProgressUpdating()
+ {
+ alert("The progress will be updated");
+ }
+ </script>
+
+
+ <radU:RadProgressArea OnClientProgressUpdating="myOnClientProgressUpdating" ... />
+ ...
+ <script>
+ function myOnClientProgressUpdating()
+ {
+ alert("The progress will be updated");
+ }
+ </script>
+
+
+ RadProgressArea1.Localization["CancelButton"] = "Cancel";
+ RadProgressArea1.Localization["ElapsedTime"] = "Elapsed time: ";
+ RadProgressArea1.Localization["EstimatedTime"] = "Estimated time: ";
+ RadProgressArea1.Localization["TransferSpeed"] = "Speed: ";
+ RadProgressArea1.Localization["CurrentFileName"] = "Uploading file: ";
+ RadProgressArea1.Localization["Uploaded"] = "Uploaded ";
+ RadProgressArea1.Localization["UploadedFiles"] = "Uploaded files: ";
+ RadProgressArea1.Localization["Total"] = "Total ";
+ RadProgressArea1.Localization["TotalFiles"] = "Total files: ";
+
+
+ RadProgressArea1.Localization("CancelButton") = "Cancel"
+ RadProgressArea1.Localization("ElapsedTime") = "Elapsed time: "
+ RadProgressArea1.Localization("EstimatedTime") = "Estimated time: "
+ RadProgressArea1.Localization("TransferSpeed") = "Speed: "
+ RadProgressArea1.Localization("CurrentFileName") = "Uploading file: "
+ RadProgressArea1.Localization("Uploaded") = "Uploaded "
+ RadProgressArea1.Localization("UploadedFiles") = "Uploaded files: "
+ RadProgressArea1.Localization("Total") = "Total "
+ RadProgressArea1.Localization("TotalFiles") = "Total files: "
+
+
+ Button1.PostBackUrl = RadProgressManager1.ApplyUniquePageIdentifier(Request.Url.PathAndQuery)
+
+
+ Button1.PostBackUrl = RadProgressManager1.ApplyUniquePageIdentifier(Request.Url.PathAndQuery);
+
+
+ Private Sub RadUpload1_ValidatingFile(ByVal sender As Object, ByVal e As WebControls.ValidateFileEventArgs) Handles RadUpload1.ValidatingFile
+ If e.UploadedFile.GetExtension.ToLower = ".zip" Then
+ Dim maxZipFileSize As Integer = 10000000 '~10MB
+ If e.UploadedFile.ContentLength > maxZipFileSize Then
+ e.IsValid = False
+ End If
+ 'The zip files are not validated for file size, extension and mime type
+ e.SkipInternalValidation = True
+ End If
+ End Sub
+
+
+ private void RadUpload1_ValidatingFile(object sender, ValidateFileEventArgs e)
+ {
+ if (e.UploadedFile.GetExtension().ToLower() == ".zip")
+ {
+ int maxZipFileSize = 10000000; //~10MB
+ if (e.UploadedFile.ContentLength > maxZipFileSize)
+ {
+ e.IsValid = false;
+ }
+ //The zip files are not validated for file size, extension and content type
+ e.SkipInternalValidation = true;
+ }
+ }
+
+
+ Private Sub RadUpload1_FileExists(ByVal sender As Object, ByVal e As WebControls.UploadedFileEventArgs) Handles RadUpload1.FileExists
+ Dim TheFile As Telerik.WebControls.UploadedFile = e.UploadedFile
+
+ TheFile.SaveAs(Path.Combine(RadUpload1.TargetFolder, TheFile.GetNameWithoutExtension() + "1" + TheFile.GetExtension()), true)
+ End Sub
+
+
+ private void RadUpload1_FileExists(object sender, Telerik.WebControls.UploadedFileEventArgs e)
+ {
+ Telerik.WebControls.UploadedFile TheFile = e.UploadedFile;
+
+ TheFile.SaveAs(Path.Combine(RadUpload1.TargetFolder, TheFile.GetNameWithoutExtension() + "1" + TheFile.GetExtension()), true);
+ }
+
+
+ Dim allowedFileExtensions As String() = New String(2) {".zip", ".doc", ".config"}
+ RadUpload1.AllowedFileExtensions = allowedFileExtensions
+
+
+ string[] allowedFileExtensions = new string[3] {".zip", ".doc", ".config"};
+ RadUpload1.AllowedFileExtensions = allowedFileExtensions;
+
+
+ ' For example you can Get these from your web.config file
+ Dim commaSeparatedMimeTypes As String = "application/octet-stream,application/msword,video/mpeg"
+
+ Dim allowedMimeTypes As String() = commaSeparatedMimeTypes.Split(",")
+ RadUpload1.AllowedMimeTypes = allowedMimeTypes
+
+
+ // For example you can get these from your web.config file
+ string commaSeparatedMimeTypes = "application/octet-stream,application/msword,video/mpeg";
+
+ string[] allowedMimeTypes = commaSeparatedMimeTypes.Split(',');
+ RadUpload1.AllowedMimeTypes = allowedMimeTypes;
+
+
+ RadUpload1.ControlObjectsVisibility = Telerik.WebControls.ControlObjectsVisibility.AddButton Or _
+ Telerik.WebControls.ControlObjectsVisibility.RemoveButtons
+
+
+ RadUpload1.ControlObjectsVisibility = Telerik.WebControls.ControlObjectsVisibility.AddButton |
+ Telerik.WebControls.ControlObjectsVisibility.RemoveButtons;
+
+
+ <radU:RadUpload OnClientAdding="myOnClientAdding" ... />
+ ...
+ <script>
+ function myOnClientAdding()
+ {
+ alert("You just added a new file input.");
+ }
+ </script>
+
+
+ <radU:RadUpload OnClientAdding="myOnClientAdding" ... />
+ ...
+ <script>
+ function myOnClientAdding()
+ {
+ alert("You just added a new file input.");
+ }
+ </script>
+
+
+ <radU:RadUpload OnClientAdded="myOnClientAdded" ... />
+ ...
+ <script>
+ function myOnClientAdded()
+ {
+ alert("You just added a new file input.");
+ }
+ </script>
+
+
+ <radU:RadUpload OnClientAdded="myOnClientAdded" ... />
+ ...
+ <script>
+ function myOnClientAdded()
+ {
+ alert("You just added a new file input.");
+ }
+ </script>
+
+
+ <radU:RadUpload OnClientDeleting="myOnClientDeleting" ... />
+ <script language="javascript">
+ function myOnClientDeleting()
+ {
+ return prompt("Are you sure?");
+ }
+ </script>
+
+
+ <radU:RadUpload OnClientDeleting="myOnClientDeleting" ... />
+ <script language="javascript">
+ function myOnClientDeleting()
+ {
+ Return prompt("Are you sure?");
+ }
+ </script>
+
+
+ <radU:RadUpload OnClientClearing="myOnClientClearing" ... />
+ ...
+ <script>
+ function myOnClientClearing()
+ {
+ return confirm("Are you sure you want to clear this input?");
+ }
+ </script>
+
+
+ <radU:RadUpload OnClientClearing="myOnClientClearing" ... />
+ ...
+ <script>
+ function myOnClientClearing()
+ {
+ Return confirm("Are you sure you want to clear this input?");
+ }
+ </script>
+
+
+ <radU:RadUpload OnClientDeletingSelected="myOnClientDeletingSelected" ... />
+
+ <script>
+ function myOnClientDeletingSelected()
+ {
+ var mustCancel = confirm("Are you sure?");
+ return mustCancel;
+ }
+ </script>
+
+
+ <radU:RadUpload OnClientDeletingSelected="myOnClientDeletingSelected" ... />
+
+ <script>
+ function myOnClientDeletingSelected()
+ {
+ var mustCancel = confirm("Are you sure?");
+ return mustCancel;
+ }
+ </script>
+
+
+ For Each file As Telerik.WebControls.UploadedFile In RadUpload1.UploadedFiles
+ file.SaveAs(Path.Combine("c:\my files\", file.GetName()), True)
+ Next
+
+
+ foreach (Telerik.WebControls.UploadedFile file in RadUpload1.UploadedFiles)
+ {
+ file.SaveAs(Path.Combine(@"c:\my files\", file.GetName()), true);
+ }
+
+
+ Dim MyUploadedFile As UploadedFile = RadUpload1.UploadedFiles(0)
+ Dim MyFileName As String = UploadedFile.FileName
+
+
+ HttpPostedFile MyUploadedFile = RadUpload1.UploadedFiles[0];
+ String MyFileName = MyUploadedFile.FileName;
+
+
+ DataTable data = new DataTable();
+ data.Columns.Add("MyID");
+ data.Columns.Add("MyValue");
+
+ data.Rows.Add(new object[] {"1", "ticker item text 1"});
+ data.Rows.Add(new object[] {"2", "ticker item text 2"});
+
+ RadTicker1.DataSource = data;
+ RadTicker1.DataTextField = "MyValue"; //"MyValue" column provides values for the Text property of databound ticker items
+ RadTicker1.DataBind();
+
+
+ Dim data As new DataTable();
+ data.Columns.Add("MyID")
+ data.Columns.Add("MyValue")
+
+ data.Rows.Add(New Object() {"1", "ticker item text 1"})
+ data.Rows.Add(New Object() {"2", "ticker item text 2"})
+
+ RadTicker1.DataSource = data
+ RadTicker1.DataTextField = "MyValue" '"MyValue" column provides values for the Text property of databound ticker items
+ RadTicker1.DataBind()
+
+
+ [ScriptService]
+ public class WebServiceName : WebService
+ {
+ [WebMethod]
+ public RadRotatorItemData[] WebServiceMethodName(int itemIndex, int itemCount)
+ {
+ List<RadRotatorItemData> result = new List<RadRotatorItemData>();
+ RadRotatorItemData item;
+ for (int i = 0; i < itemCount; i++)
+ {
+ item = new RadRotatorItemData();
+ item.Html = "test "+(itemIndex+i);
+ result.Add(item);
+ }
+ return result.ToArray();
+ }
+ }
+
+
+ XmlSchedulerProvider provider = new XmlSchedulerProvider(Server.MapPath("~/App_Data/data.xml"), true);
+ WebServiceAppointmentController controller = new WebServiceAppointmentController(provider);
+
+
+ Dim provider As New XmlSchedulerProvider(Server.MapPath("~/App_Data/data.xml"), True)
+ Dim controller As New WebServiceAppointmentController(provider)
+
+
+ [WebMethod]
+ public IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo)
+ {
+ return Controller.GetAppointments(schedulerInfo);
+ }
+
+
+ <WebMethod> _
+ Public Function GetAppointments(schedulerInfo As SchedulerInfo) As IEnumerable(Of AppointmentData)
+ Return Controller.GetAppointments(schedulerInfo)
+ End Function
+
+
+ [WebMethod]
+ public IEnumerable<AppointmentData> InsertAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData)
+ {
+ return Controller.InsertAppointment(schedulerInfo, appointmentData);
+ }
+
+
+ <WebMethod> _
+ Public Function InsertAppointment(schedulerInfo As SchedulerInfo, appointmentData As AppointmentData) As IEnumerable(Of AppointmentData)
+ Return Controller.InsertAppointment(schedulerInfo, appointmentData)
+ End Function
+
+
+ [WebMethod]
+ public IEnumerable<AppointmentData> UpdateAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData)
+ {
+ return Controller.UpdateAppointment(schedulerInfo, appointmentData);
+ }
+
+
+ <WebMethod> _
+ Public Function UpdateAppointment(schedulerInfo As SchedulerInfo, appointmentData As AppointmentData) As IEnumerable(Of AppointmentData)
+ Return Controller.UpdateAppointment(schedulerInfo, appointmentData)
+ End Function
+
+
+ [WebMethod]
+ public IEnumerable<AppointmentData> CreateRecurrenceException(SchedulerInfo schedulerInfo, AppointmentData recurrenceExceptionData)
+ {
+ return Controller.CreateRecurrenceException(schedulerInfo, recurrenceExceptionData);
+ }
+
+
+ <WebMethod> _
+ Public Function CreateRecurrenceException(schedulerInfo As SchedulerInfo, recurrenceExceptionData As AppointmentData) As IEnumerable(Of AppointmentData)
+ Return Controller.CreateRecurrenceException(schedulerInfo, recurrenceExceptionData)
+ End Function
+
+
+ [WebMethod]
+ public IEnumerable<AppointmentData> RemoveRecurrenceExceptions(SchedulerInfo schedulerInfo, AppointmentData masterAppointmentData)
+ {
+ return Controller.RemoveRecurrenceExceptions(schedulerInfo, masterAppointmentData);
+ }
+
+
+ <WebMethod> _
+ Public Function RemoveRecurrenceExceptions(schedulerInfo As SchedulerInfo, masterAppointmentData As AppointmentData) As IEnumerable(Of AppointmentData)
+ Return Controller.RemoveRecurrenceExceptions(schedulerInfo, masterAppointmentData)
+ End Function
+
+
+ [WebMethod]
+ public IEnumerable<AppointmentData> DeleteAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData, bool deleteSeries)
+ {
+ return Controller.DeleteAppointment(schedulerInfo, masterAppointmentData, deleteSeries);
+ }
+
+
+ <WebMethod> _
+ Public Function DeleteAppointment(schedulerInfo As SchedulerInfo, appointmentData As AppointmentData, deleteSeries As Bool) As IEnumerable(Of AppointmentData)
+ Return Controller.DeleteAppointment(schedulerInfo, masterAppointmentData, deleteSeries)
+ End Function
+
+
+ protected void Page_Load(object sender, System.EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ PageView view = new RadPageView();
+ view.ID = "dynamicPageView";
+ RadMultiPage1.PageViews.Add(view);
+ }
+ }
+
+ protected void RadMultiPage1_PageViewCreated(object sender, Telerik.Web.UI.RadMultiPageEventArgs e)
+ {
+ Label l = new Label();
+ l.ID = "dynamicLabel";
+ l.Text = "Programatically created label";
+ e.PageView.Controls.Add(l);
+ }
+
+
+ Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
+ If Not Page.IsPostBack Then
+ Dim view As PageView = New RadPageView()
+ view.ID = "dynamicPageView"
+ RadMultiPage1.PageViews.Add(view)
+ End If
+ End Sub
+
+ Protected Sub RadMultiPage1_PageViewCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMultiPageEventArgs) Handles RadMultiPage1.PageViewCreated
+ Dim l As New Label()
+ l.ID = "dynamicLabel"
+ l.Text = "Programatically created label"
+ e.PageView.Controls.Add(l)
+ End Sub
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadTabStrip RadTabStrip1 = new RadTabStrip();
+ RadTabStrip1.ID = "RadTabStrip1";
+
+ if (!Page.IsPostBack)
+ {
+ //RadTabStrip persist its tab in ViewState (if EnableViewState is true).
+ //Hence tabs should be created only on initial load.
+
+ RadTab sportTab = new RadTab("Sport");
+ RadTabStrip1.Tabs.Add(sportTab);
+
+ RadTab newsTab = new RadTab("News");
+ RadTabStrip1.Tabs.Add(newsTab);
+ }
+
+ PlaceHolder1.Controls.Add(RadTabStrip1);
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ Dim RadTabStrip1 As RadTabStrip = New RadTabStrip()
+ RadTabStrip1.ID = "RadTabStrip1"
+
+ If Not Page.IsPostBack Then
+ 'RadTabStrip persist its tab in ViewState (if EnableViewState is true).
+ 'Hence tabs should be created only on initial load.
+
+ Dim sportTab As RadTab = New RadTab("Sport")
+ RadTabStrip1.Tabs.Add(sportTab)
+
+ Dim newsTab As RadTab = New RadTab("News")
+ RadTabStrip1.Tabs.Add(newsTab)
+ End If
+
+ PlaceHolder1.Controls.Add(RadTabStrip1)
+ End Sub
+
+
+ private void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ RadTabStrip1.LoadContentFile("~/Data.xml");
+ }
+ }
+
+
+ Private Sub Page_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+ If Not Page.IsPostBack Then
+ RadTabStrip1.LoadContentFile("~/Data.xml")
+ End If
+ End Sub
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadTabStrip1.FindTab(ItemWithEqualsTextAndValue);
+ }
+ private static bool ItemWithEqualsTextAndValue(RadTab tab)
+ {
+ if (tab.Text == tab.Value)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
+ RadTabStrip1.FindTab(ItemWithEqualsTextAndValue)
+ End Sub
+ Private Shared Function ItemWithEqualsTextAndValue(ByVal tab As RadTab) As Boolean
+ If tab.Text = tab.Value Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+
+ foreach (ClientOperation<RadTab> operation in RadTabStrip1.ClientChanges)
+ {
+ RadTab tab = operation.Item;
+
+ switch (operation.Type)
+ {
+ case ClientOperationType.Insert:
+ //An tab has been inserted - operation.Item contains the inserted tab
+ break;
+ case ClientOperationType.Remove:
+ //An tab has been inserted - operation.Item contains the removed tab.
+ //Keep in mind the tab has been removed from the tabstrip.
+ break;
+ case ClientOperationType.Update:
+ UpdateClientOperation<RadTab> update = operation as UpdateClientOperation<RadTab>
+ //The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
+ break;
+ case ClientOperationType.Clear:
+ //All children of have been removed - operation.Item contains the parent tab whose children have been removed. If operation.Item is null then the root tabs have been removed.
+ break;
+ }
+ }
+
+
+ For Each operation As ClientOperation(Of RadTab) In RadTabStrip1.ClientChanges
+ Dim tab As RadTab = operation.Item
+ Select Case operation.Type
+ Case ClientOperationType.Insert
+ 'A tab has been inserted - operation.Item contains the inserted tab
+ Exit Select
+ Case ClientOperationType.Remove
+ 'A tab has been inserted - operation.Item contains the removed tab.
+ 'Keep in mind the tab has been removed from the tabstrip.
+ Exit Select
+ Case ClientOperationType.Update
+ Dim update As UpdateClientOperation(Of RadTab) = TryCast(operation, UpdateClientOperation(Of RadTab))
+ 'The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
+ Exit Select
+ Case ClientOperationType.Clear
+ 'All children of have been removed - operation.Item contains the parent tab whose children have been removed. If operation.Item is Nothing then the root tabs have been removed.
+ Exist Select
+ End Select
+ Next
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ RadTab newsTab = new RadTab("News");
+ RadTabStrip1.Tabs.Add(newsTab);
+
+ RadTabStrip1.SelectedIndex = 0; //This will select the "News" tab
+
+ RadTab cnnTab = new RadTab("CNN");
+ newsTab.Tabs.Add(cnnTab);
+
+ RadTab nbcTab = new RadTab("NBC");
+ newsTab.Tabs.Add(nbcTab);
+
+ newsTab.SelectedIndex = 1; //This will select the "NBC" child tab of the "News" tab
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ If Not Page.IsPostBack Then
+ Dim newsTab As RadTab = New RadTab("News")
+ RadTabStrip1.Tabs.Add(newsTab)
+
+ RadTabStrip1.SelectedIndex = 0 'This will select the "News" tab
+
+ Dim cnnTab As RadTab = New RadTab("CNN")
+ newsTab.Tabs.Add(cnnTab)
+
+ Dim nbcTab As RadTab = New RadTab("NBC")
+ newsTab.Tabs.Add(nbcTab)
+
+ newsTab.SelectedIndex = 1 'This will select the "NBC" child tab of the "News" tab
+ End If
+ End Sub
+
+
+ RadTabStrip1.Tabs[0].Text = "Example";
+ RadTabStrip1.Tabs[0].NavigateUrl = "http://www.example.com";
+
+
+ RadTabStrip1.Tabs(0).Text = "Example"
+ RadTabStrip1.Tabs(0).NavigateUrl = "http://www.example.com"
+
+
+ <telerik:RadTabStrip runat="server" ID="RadTabStrip1">
+ <TabTemplate>
+ <%# DataBinder.Eval(Container, "Text") %>
+ <img style="margin-left: 10px" src="Images/delete.gif" alt="delete"/>
+ </TabTemplate>
+ <Tabs>
+ <telerik:RadTab Text="Products">
+ </telerik:RadTab>
+ <telerik:RadTab Text="Services">
+ </telerik:RadTab>
+ <telerik:RadTab Text="Corporate">
+ </telerik:RadTab>
+ </Tabs>
+ </telerik:RadTabStrip>
+
+
+ protected void Page_Load(object sender, System.EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ //Required to evaluate the databinding expressions inside the template (<%# DataBinder.Eval)%>
+ RadTabStrip1.DataBind();
+ }
+ }
+
+
+ Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
+ If Not Page.IsPostBack Then
+ RadTabStrip1.DataBind()
+ End If
+ End Sub
+
+
+ DataTable data = new DataTable();
+ data.Columns.Add("MyText");
+
+ data.Rows.Add(new object[] {"Tab Text 1"});
+ data.Rows.Add(new object[] {"Tab Text 2"});
+
+ RadTabStrip1.DataSource = data;
+ RadTabStrip1.DataTextField = "MyText"; //"MyText" column provides values for the Text property of databound tabs
+ RadTabStrip1.DataBind();
+
+
+ Dim data As new DataTable();
+ data.Columns.Add("MyText")
+
+ data.Rows.Add(New Object() {"Tab Text 1"})
+ data.Rows.Add(New Object() {"Tab Text 2"})
+
+ RadTabStrip1.DataSource = data
+ RadTabStrip1.DataTextField = "MyText" '"MyText" column provides values for the Text property of databound tabs
+ RadTabStrip1.DataBind()
+
+
+ DataTable data = new DataTable();
+ data.Columns.Add("MyText");
+ data.Columns.Add("MyValue");
+
+ data.Rows.Add(new object[] {"Tab Text 1", "Tab Value 1"});
+ data.Rows.Add(new object[] {"Tab Text 2", "Tab Value 2"});
+
+ RadTabStrip1.DataSource = data;
+ RadTabStrip1.DataTextField = "MyText"; //"MyText" column provides values for the Text property of databound tabs
+ RadTabStrip1.DataValueField = "MyValue"; //"MyValue" column provides values for the Value property of databound tabs
+ RadTabStrip1.DataBind();
+
+
+ Dim data As new DataTable();
+ data.Columns.Add("MyText")
+ data.Columns.Add("MyValue")
+
+ data.Rows.Add(New Object() {"Tab Text 1", "Tab Value 1"})
+ data.Rows.Add(New Object() {"Tab Text 2", "Tab Value 2"})
+
+ RadTabStrip1.DataSource = data
+ RadTabStrip1.DataTextField = "MyText" '"MyText" column provides values for the Text property of databound tabs
+ RadTabStrip1.DataValueField = "MyValue" '"MyValue" column provides values for the Value property of databound tabs
+ RadTabStrip1.DataBind()
+
+
+ DataTable data = new DataTable();
+ data.Columns.Add("MyText");
+ data.Columns.Add("MyUrl");
+
+ data.Rows.Add(new object[] {"Tab Text 1", "http://www.example.com/page1.aspx"});
+ data.Rows.Add(new object[] {"Tab Text 2", "http://www.example.com/page2.aspx"});
+
+ RadTabStrip1.DataSource = data;
+ RadTabStrip1.DataTextField = "MyText"; //"MyText" column provides values for the Text property of databound tabs
+ RadTabStrip1.DataNavigateUrlField = "MyUrl"; //"MyUrl" column provides values for the NavigateUrl property of databound tabs
+ RadTabStrip1.DataBind();
+
+
+ Dim data As new DataTable();
+ data.Columns.Add("MyText")
+ data.Columns.Add("MyUrl")
+
+ data.Rows.Add(New Object() {"Tab Text 1", "http://www.example.com/page1.aspx"})
+ data.Rows.Add(New Object() {"Tab Text 2", "http://www.example.com/page2.aspx"})
+
+ RadTabStrip1.DataSource = data
+ RadTabStrip1.DataTextField = "MyText" '"MyText" column provides values for the Text property of databound tabs
+ RadTabStrip1.DataValueField = "MyUrl" '"MyUrl" column provides values for the NavigateUrl property of databound tabs
+ RadTabStrip1.DataBind()
+
+
+ DataTable data = new DataTable();
+ data.Columns.Add("MyText");
+ data.Columns.Add("MyID", typeof(int));
+ data.Columns.Add("MyParentID", typeof(int));
+
+ data.Rows.Add(new object[] {"Root Tab 1", 1, null});
+ data.Rows.Add(new object[] {"Child Tab 1.1", 3, 1});
+ data.Rows.Add(new object[] {"Root Tab 2", 2, null});
+ data.Rows.Add(new object[] {"Child Tab 2.1", 4, 2});
+
+ RadTabStrip1.DataSource = data;
+ RadTabStrip1.DataTextField = "MyText"; //"MyText" column provides values for the Text property of databound tabs
+ RadTabStrip1.DataFieldID = "MyID"; //"MyID" column provides values for the "child" column in the relation.
+ RadTabStrip1.DataFieldParentID = "MyParentID"; //"MyParentID" column provides values for the "parent" column in the relation.
+ RadTabStrip1.DataBind();
+
+
+ Dim data As New DataTable()
+ data.Columns.Add("MyText")
+ data.Columns.Add("MyID", GetType(Integer))
+ data.Columns.Add("MyParentID", GetType(Integer))
+
+ data.Rows.Add(New Object() {"Root Tab 1", 1, Nothing})
+ data.Rows.Add(New Object() {"Child Tab 1.1", 3, 1})
+ data.Rows.Add(New Object() {"Root Tab 2", 2, Nothing})
+ data.Rows.Add(New Object() {"Child Tab 2.1", 4, 2})
+
+ RadTabStrip1.DataSource = data
+ RadTabStrip1.DataTextField = "MyText" '"MyText" column provides values for the Text property of databound tabs
+ RadTabStrip1.DataFieldID = "MyID" '"MyID" column provides values for the "child" column in the relation.
+ RadTabStrip1.DataFieldParentID = "MyParentID" '"MyParentID" column provides values for the "parent" column in the relation.
+ RadTabStrip1.DataBind()
+
+
+ DataTable data = new DataTable();
+ data.Columns.Add("MyText");
+ data.Columns.Add("MyID", typeof(int));
+ data.Columns.Add("MyParentID", typeof(int));
+
+ data.Rows.Add(new object[] {"Root Tab 1", 1, null});
+ data.Rows.Add(new object[] {"Child Tab 1.1", 3, 1});
+ data.Rows.Add(new object[] {"Root Tab 2", 2, null});
+ data.Rows.Add(new object[] {"Child Tab 2.1", 4, 2});
+
+ RadTabStrip1.DataSource = data;
+ RadTabStrip1.DataTextField = "MyText"; //"MyText" column provides values for the Text property of databound tabs
+ RadTabStrip1.DataFieldID = "MyID"; //"MyID" column provides values for the "child" column in the relation.
+ RadTabStrip1.DataFieldParentID = "MyParentID"; //"MyParentID" column provides values for the "parent" column in the relation.
+ RadTabStrip1.DataBind();
+
+
+ Dim data As New DataTable()
+ data.Columns.Add("MyText")
+ data.Columns.Add("MyID", GetType(Integer))
+ data.Columns.Add("MyParentID", GetType(Integer))
+
+ data.Rows.Add(New Object() {"Root Tab 1", 1, Nothing})
+ data.Rows.Add(New Object() {"Child Tab 1.1", 3, 1})
+ data.Rows.Add(New Object() {"Root Tab 2", 2, Nothing})
+ data.Rows.Add(New Object() {"Child Tab 2.1", 4, 2})
+
+ RadTabStrip1.DataSource = data
+ RadTabStrip1.DataTextField = "MyText" '"MyText" column provides values for the Text property of databound tabs
+ RadTabStrip1.DataFieldID = "MyID" '"MyID" column provides values for the "child" column in the relation.
+ RadTabStrip1.DataFieldParentID = "MyParentID" '"MyParentID" column provides values for the "parent" column in the relation.
+ RadTabStrip1.DataBind()
+
+
+ protected void RadTabStrip1_TabCreated(object sender, Telerik.Web.UI.RadTabStripEventArgs e)
+ {
+ e.Tab.ToolTip = e.Tab.Text;
+ }
+
+
+ Sub RadTabStrip1_TabCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles RadTabStrip1.TabCreated
+ e.Tab.ToolTip = e.Tab.Text
+ End Sub
+
+
+ protected void RadTabStrip1_TabDataBound(object sender, Telerik.Web.UI.RadTabStripEventArgs e)
+ {
+ e.Tab.ImageUrl = "image" + (string)DataBinder.Eval(e.Tab.DataItem, "ID") + ".gif";
+ e.Tab.NavigateUrl = (string)DataBinder.Eval(e.Tab.DataItem, "URL");
+ }
+
+
+ Sub RadTabStrip1_TabDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles RadTabStrip1.TabDataBound
+ e.Tab.ImageUrl = "image" & DataBinder.Eval(e.Tab.DataItem, "ID") & ".gif"
+ e.Tab.NavigateUrl = CStr(DataBinder.Eval(e.Tab.DataItem, "URL"))
+ End Sub
+
+
+ protected void RadTabStrip1_TabClick(object sender, Telerik.Web.UI.RadTabStripEventArgs e)
+ {
+ Response.Write("Clicked tab is " + e.Tab.Text);
+ }
+
+
+ Sub RadTabStrip1_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles RadTabStrip1.TabClick
+ Response.Write("Clicked tab is " & e.Tab.Text)
+ End Sub
+
+
+ RadTab tab = new RadTab();
+ tab.Text = "News";
+ tab.NavigateUrl = "~/News.aspx";
+
+ RadTabStrip1.Tabs.Add(tab);
+
+
+ Dim tab As New RadTab()
+ tab.Text = "News"
+ tab.NavigateUrl = "~/News.aspx"
+
+ RadTabStrip1.Tabs.Add(tab)
+
+
+ RadTab tab = new RadTab("News");
+
+ RadTabStrip1.Tabs.Add(tab);
+
+
+ Dim tab As New RadTab("News")
+
+ RadTabStrip1.Tabs.Add(tab)
+
+
+ RadTab tab = new RadTab("News", "NewsTabValue");
+
+ RadTabStrip1.Tabs.Add(tab);
+
+
+ Dim tab As New RadTab("News", "NewsTabValue")
+
+ RadTabStrip1.Tabs.Add(tab)
+
+
+ RadTab currentTab = RadTabStrip1.FindTabByUrl(Request.Url.PathAndQuery);
+ if (currentTab != null)
+ {
+ currentTab.SelectParents();
+ }
+
+
+ Dim currentTab as RadTab = RadTabStrip1.FindTabByUrl(Request.Url.PathAndQuery)
+
+ If Not currentTab Is Nothing Then
+ currentTab.SelectParents()
+ End If
+
+
+ <telerik:RadTabStrip ID="RadTabStrip1" runat="server">
+ <Tabs>
+ <telerik:RadTab>
+ <TabTemplate>
+ Tab 1 <img src="Images/tabIcon.gif" alt="" />
+ </TabTemplate>
+ </telerik:RadTab>
+ </Tabs>
+ </telerik:RadTabStrip>
+
+
+ private void RadTabStrip1_TabDataBound(object sender, Telerik.Web.UI.RadTabStripEventArgs e)
+ {
+ e.Tab.ImageUrl = "image" + (string)DataBinder.Eval(e.Tab.DataItem, "ID") + ".gif";
+ e.Tab.NavigateUrl = (string)DataBinder.Eval(e.Tab.DataItem, "URL");
+ }
+
+
+ Sub RadTabStrip1_TabDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles RadTabStrip1.TabDataBound
+ e.Tab.ImageUrl = "image" & DataBinder.Eval(e.Tab.DataItem, "ID") & ".gif"
+ e.Tab.NavigateUrl = CStr(DataBinder.Eval(e.Tab.DataItem, "URL"))
+ End Sub
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ RadTab newsTab = new RadTab("News");
+ RadTabStrip1.Tabs.Add(newsTab);
+
+ RadTabStrip1.SelectedIndex = 0; //This will select the "News" tab
+
+ RadTab cnnTab = new RadTab("CNN");
+ newsTab.Tabs.Add(cnnTab);
+
+ RadTab nbcTab = new RadTab("NBC");
+ newsTab.Tabs.Add(nbcTab);
+
+ newsTab.SelectedIndex = 1; //This will select the "NBC" child tab of the "News" tab
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ If Not Page.IsPostBack Then
+ Dim newsTab As RadTab = New RadTab("News")
+ RadTabStrip1.Tabs.Add(newsTab)
+
+ RadTabStrip1.SelectedIndex = 0 'This will select the "News" tab
+
+ Dim cnnTab As RadTab = New RadTab("CNN")
+ newsTab.Tabs.Add(cnnTab)
+
+ Dim nbcTab As RadTab = New RadTab("NBC")
+ newsTab.Tabs.Add(nbcTab)
+
+ newsTab.SelectedIndex = 1 'This will select the "NBC" child tab of the "News" tab
+ End If
+ End Sub
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ if (RadTabStrip1.SelectedIndex >= 0)
+ {
+ RadTab selected = RadTabStrip1.InnermostSelectedTab;
+ IRadTabContainer owner = selected.Owner;
+ string breadCrumbTrail = string.Empty;
+ while (owner != null)
+ {
+ breadCrumbTrail = " > " + owner.SelectedTab.Text + breadCrumbTrail;
+ owner = owner.Owner;
+ }
+ Label1.Text = breadCrumbTrail;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ If RadTabStrip1.SelectedIndex >= 0 Then
+ Dim selected As RadTab = RadTabStrip1.InnermostSelectedTab
+ Dim owner As IRadTabContainer = selected.Owner
+ Dim breadCrumbTrail As String = String.Empty
+ While Not owner Is Nothing
+ breadCrumbTrail = " > " & owner.SelectedTab.Text & breadCrumbTrail
+ owner = owner.Owner
+ End While
+ Label1.Text = breadCrumbTrail
+ End If
+ End Sub
+
+
+ RadTabStrip1.Tabs[0].Tabs[0].Text = "Example";
+ RadTabStrip1.Tabs[0].Tabs[0].NavigateUrl = "http://www.example.com";
+
+
+ RadTabStrip1.Tabs(0).Tabs(0).Text = "Example"
+ RadTabStrip1.Tabs(0).Tabs(0).NavigateUrl = "http://www.example.com"
+
+
+ RadTab newsTab = new RadTab("News");
+ RadTabStrip1.Tabs.Add(newsTab);
+
+
+ Dim newsTab As RadTab = New RadTab("News")
+ RadTabStrip1.Tabs.Add(newsTab)
+
+
+ RadTab[] tabs = new RadTab[] { new RadTab("First"), new RadTab("Second"), new RadTab("Third") };
+ RadTabStrip1.Tabs.AddRange(tabs);
+
+
+ Dim tabs() As RadTab = {New RadTab("First"), New RadTab("Second"), New RadTab("Third")}
+ RadTabStrip1.Tabs.AddRange(tabs)
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadTabStrip1.FindTab(ItemWithEqualsTextAndValue);
+ }
+ private static bool ItemWithEqualsTextAndValue(RadTab tab)
+ {
+ if (tab.Text == tab.Value)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
+ RadTabStrip1.FindTab(ItemWithEqualsTextAndValue)
+ End Sub
+ Private Shared Function ItemWithEqualsTextAndValue(ByVal tab As RadTab) As Boolean
+ If tab.Text = tab.Value Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+
+ RadToolBarButton button = new RadToolBarButton();
+ button.Text = "Create New";
+ button.CommandName = "CreateNew";
+ button.ImageUrl = "~/ToolBarImages/CreateNew.gif";
+
+ RadToolBar1.Items.Add(button);
+
+
+ Dim button As New RadToolBarButton()
+ button.Text = "Create New"
+ button.CommandName = "CreateNew"
+ button.ImageUrl = "~/ToolBarImages/CreateNew.gif"
+
+ RadToolBar1.Items.Add(button)
+
+
+ RadToolBarButton button = new RadToolBarButton("Create New");
+ button.CommandName = "CreateNew";
+ button.ImageUrl = "~/ToolBarImages/CreateNew.gif";
+
+ RadToolBar1.Items.Add(button);
+
+
+ Dim button As New RadToolBarButton("Create New")
+ button.CommandName = "CreateNew"
+ button.ImageUrl = "~/ToolBarImages/CreateNew.gif"
+
+ RadToolBar1.Items.Add(button)
+
+
+ RadToolBarButton alighLeftButton = new RadToolBarButton("Left", false, "Alignment");
+ alighLeftButton.CommandName = "AlignLeft";
+ alighLeftButton.ImageUrl = "~/ToolBarImages/AlignLeft.gif";
+ RadToolBar1.Items.Add(alighLeftButton);
+
+ RadToolBarButton alignCenterButton = new RadToolBarButton("Center", false, "Alignment");
+ alignCenterButton.CommandName = "AlignCenter";
+ alignCenterButton.ImageUrl = "~/ToolBarImages/AlignCenter.gif";
+ RadToolBar1.Items.Add(alignCenterButton);
+
+ RadToolBarButton alignRightButton = new RadToolBarButton("Right", false, "Alignment");
+ alignRightButton.CommandName = "AlignRight";
+ alignRightButton.ImageUrl = "~/ToolBarImages/AlignRight.gif";
+ RadToolBar1.Items.Add(alignRightButton);
+
+
+ Dim alighLeftButton As RadToolBarButton = New RadToolBarButton("Left", False, "Alignment")
+ alighLeftButton.CommandName = "AlignLeft"
+ alighLeftButton.ImageUrl = "~/ToolBarImages/AlignLeft.gif"
+ RadToolBar1.Items.Add(alighLeftButton)
+
+ Dim alignCenterButton As RadToolBarButton = New RadToolBarButton("Center", False, "Alignment")
+ alignCenterButton.CommandName = "AlignCenter"
+ alignCenterButton.ImageUrl = "~/ToolBarImages/AlignCenter.gif"
+ RadToolBar1.Items.Add(alignCenterButton)
+
+ Dim alignRightButton As RadToolBarButton = New RadToolBarButton("Right", False, "Alignment")
+ alignRightButton.CommandName = "AlignRight"
+ alignRightButton.ImageUrl = "~/ToolBarImages/AlignRight.gif"
+ RadToolBar1.Items.Add(alignRightButton)
+
+
+ private void RadToolBar1_ButtonDataBound(object sender, Telerik.Web.UI.RadToolBarButtonEventArgs e)
+ {
+ e.Button.ImageUrl = "image" + (string)DataBinder.Eval(e.Button.DataItem, "ID") + ".gif";
+ e.Button.NavigateUrl = (string)DataBinder.Eval(e.Button.DataItem, "URL");
+ }
+
+
+ Sub RadToolBar1_ButtonDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarButtonEventArgs) Handles RadToolBar1.ButtonDataBound
+ e.Button.ImageUrl = "image" & DataBinder.Eval(e.Button.DataItem, "ID") & ".gif"
+ e.Button.NavigateUrl = CStr(DataBinder.Eval(e.Button.DataItem, "URL"))
+ End Sub
+
+ ++<Items> +++<telerik:RadToolBarDropDown Text="Date"> +++<Items> +<telerik:RadToolBarButton Text="Date"> +++<ItemTemplate> +++<asp:Calendar runat="server" ID="Calendar1" + /> +</ItemTemplate> +</telerik:RadToolBarDropButton> +</Items> +</telerik:RadToolBarDropDown> +</Items> +
+ RadToolBarDropDown dropdown = new RadToolBarDropDown();
+ dropdown.Text = "Manage";
+ dropdown.ImageUrl = "~/ToolbarImages/Manage.gif";
+
+ RadToolBar1.Items.Add(dropdown);
+
+
+ Dim dropdown As New RadToolBarDropDown()
+ dropdown.Text = "Manage"
+ dropdown.ImageUrl = "~/ToolbarImages/Manage.gif"
+
+ RadToolBar1.Items.Add(dropdown)
+
+
+ RadToolBarDropDown dropdown = new RadToolBarDropDown("Manage");
+
+ RadToolBar1.Items.Add(dropdown);
+
+
+ Dim dropdown As New RadToolBarDropDown("Manage")
+
+ RadToolBar1.Items.Add(dropdown)
+
+
+ manageDropDown.Buttons[0].Text = "Users";
+ manageDropDown.Buttons[0].ImageUrl = "~/ToolbarImages/ManageUsers.gif";
+
+
+ manageDropDown.Buttons[0].Text = "Users"
+ manageDropDown.Buttons[0].ImageUrl = "~/ToolbarImages/ManageUsers.gif"
+
+
+ RadToolBarSplitButton splitButton = new RadToolBarSplitButton();
+ splitButton.Text = "News";
+ splitButton.ImageUrl = "~/News.gif";
+
+ RadToolBar1.Items.Add(splitButton);
+
+
+ Dim splitButton As New RadToolBarSplitButton()
+ splitButton.Text = "News"
+ splitButton.ImageUrl = "~/News.gif"
+
+ RadToolBar1.Items.Add(splitButton)
+
+
+ RadToolBarSplitButton splitButton = new RadToolBarSplitButton("News");
+
+ RadToolBar1.Items.Add(splitButton);
+
+
+ Dim splitButton As New RadToolBarSplitButton("News")
+
+ RadToolBar1.Items.Add(splitButton)
+
+
+ registerPurchaseSplitButton.Buttons[0].Text = "Cache Purchase";
+ registerPurchaseSplitButton.Buttons[0].ImageUrl = "~/ToolBarImages/RegisterCachePurchase.gif";
+
+ registerPurchaseSplitButton.Buttons[1].Text = "Check Purchase";
+ registerPurchaseSplitButton.Buttons[1].ImageUrl = "~/ToolBarImages/RegisterCheckPurchase.gif";
+
+
+ registerPurchaseSplitButton.Buttons[0].Text = "Cache Purchase"
+ registerPurchaseSplitButton.Buttons[0].ImageUrl = "~/ToolBarImages/RegisterCachePurchase.gif"
+
+ registerPurchaseSplitButton.Buttons[1].Text = "Check Purchase"
+ registerPurchaseSplitButton.Buttons[1].ImageUrl = "~/ToolBarImages/RegisterCheckPurchase.gif"
+
+ ++<Items> +++<telerik:RadToolBarDropDown Text="Date"> +++<Items> +++<ItemTemplate> +++<asp:Calendar runat="server" ID="Calendar1" + /> +</ItemTemplate> +</Items> +</telerik:RadToolBarDropDown> +</Items> +
+ private void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ RadToolBar1.LoadContentFile("~/ToolBarData.xml");
+ }
+ }
+
+
+ Private Sub Page_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+ If Not Page.IsPostBack Then
+ RadToolBar1.LoadContentFile("~/ToolBarData.xml")
+ End If
+ End Sub
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadToolBar1.FindItem(ItemWithEqualsTextAndValue);
+ }
+ private static bool ItemWithEqualsTextAndValue(RadToolBarItem item)
+ {
+ if (item.Text == item.Value)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
+ RadToolBar1.FindItem(ItemWithEqualsTextAndValue)
+ End Sub
+ Private Shared Function ItemWithEqualsTextAndValue(ByVal item As RadToolBarItem) As Boolean
+ If item.Text = item.Value Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+
+ foreach (ClientOperation<RadToolBarItem> operation in RadToolBar1.ClientChanges)
+ {
+ RadToolBarItem item = operation.Item;
+
+ switch (operation.Type)
+ {
+ case ClientOperationType.Insert:
+ //An item has been inserted - operation.Item contains the inserted item
+ break;
+ case ClientOperationType.Remove:
+ //An item has been inserted - operation.Item contains the removed item.
+ //Keep in mind the item has been removed from the toolbar.
+ break;
+ case ClientOperationType.Update:
+ UpdateClientOperation<RadToolBarItem> update = operation as UpdateClientOperation<RadToolBarItem>
+ //The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
+ break;
+ case ClientOperationType.Clear:
+ //All children of have been removed - operation.Item contains the parent item whose children have been removed. If operation.Item is null then the root items have been removed.
+ break;
+ }
+ }
+
+
+ For Each operation As ClientOperation(Of RadToolBarItem) In RadToolBar1.ClientChanges
+ Dim item As RadToolBarItem = operation.Item
+ Select Case operation.Type
+ Case ClientOperationType.Insert
+ 'An item has been inserted - operation.Item contains the inserted item
+ Exit Select
+ Case ClientOperationType.Remove
+ 'An item has been inserted - operation.Item contains the removed item.
+ 'Keep in mind the item has been removed from the toolbar.
+ Exit Select
+ Case ClientOperationType.Update
+ Dim update As UpdateClientOperation(Of RadToolBarItem) = TryCast(operation, UpdateClientOperation(Of RadToolBarItem))
+ 'The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
+ Exit Select
+ Case ClientOperationType.Clear
+ 'All children of have been removed - operation.Item contains the parent item whose children have been removed. If operation.Item is Nothing then the root items have been removed.
+ Exist Select
+ End Select
+ Next
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadToolBar1.ExpandAnimation.Type = AnimationType.Linear;
+ RadToolBar1.ExpandAnimation.Duration = 300;
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ RadToolBar1.ExpandAnimation.Type = AnimationType.Linear
+ RadToolBar1.ExpandAnimation.Duration = 300
+ End Sub
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadToolBar1.CollapseAnimation.Type = AnimationType.Linear;
+ RadToolBar1.CollapseAnimation.Duration = 300;
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ RadToolBar1.CollapseAnimation.Type = AnimationType.Linear
+ RadToolBar1.CollapseAnimation.Duration = 300
+ End Sub
+
+
+ protected void RadToolBar1_ItemCreated(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
+ {
+ e.Item.ToolTip = e.Item.Text;
+ }
+
+
+ Sub RadToolBar1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarEventArgs) Handles RadToolBar1.ItemCreated
+ e.Item.ToolTip = e.Item.Text
+ End Sub
+
+
+ protected void RadToolBar1_ButtonDataBound(object sender, Telerik.Web.UI.RadToolBarButtonEventArgs e)
+ {
+ e.Button.ImageUrl = "~/ToolBarImages/tool" + (string)DataBinder.Eval(e.Button.DataItem, "Text") + ".gif";
+ e.Button.NavigateUrl = (string)DataBinder.Eval(e.Button.DataItem, "URL");
+ }
+
+
+ Sub RadToolBar1_ButtonDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarButtonEventArgs) Handles RadToolBar1.ButtonDataBound
+ e.Button.ImageUrl = "~/ToolBarImages/tool" & CStr(DataBinder.Eval(e.Button.DataItem, "Text")) & ".gif"
+ e.Button.NavigateUrl = CStr(DataBinder.Eval(e.Button.DataItem, "URL"))
+ End Sub
+
+
+ protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarButtonEventArgs e)
+ {
+ Label1.Text = "Clicked button is " + e.Item.Text;
+ }
+
+
+ Sub RadToolBar1_ButtonClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarButtonEventArgs) Handles RadToolBar1.ButtonClick
+ Label1.Text = "Clicked button is " & e.Item.Text;
+ End Sub
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadPanelBar RadPanelBar1 = new RadPanelBar();
+ RadPanelBar1.ID = "RadPanelBar1";
+
+ if (!Page.IsPostBack)
+ {
+ //RadPanelBar persist its item in ViewState (if EnableViewState is true).
+ //Hence items should be created only on initial load.
+
+ PadPanelItem sportItem= new PadPanelItem("Sport");
+ RadPanelBar1.Items.Add(sportItem);
+
+ PadPanelItem newsItem = new PadPanelItem("News");
+ RadPanelBar1.Items.Add(newsItem);
+ }
+
+ PlaceHolder1.Controls.Add(newsItem);
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ Dim RadPanelBar1 As RadPanelBar = New RadPanelBar()
+ RadPanelBar1.ID = "RadPanelBar1"
+
+ If Not Page.IsPostBack Then
+ 'RadPanelBar persist its item in ViewState (if EnableViewState is true).
+ 'Hence items should be created only on initial load.
+
+ Dim sportItem As PadPanelItem = New PadPanelItem("Sport")
+ RadPanelBar1.Items.Add(sportItem)
+
+ Dim newsItem As PadPanelItem = New PadPanelItem("News")
+ RadPanelBar1.Items.Add(newsItem)
+ End If
+
+ PlaceHolder1.Controls.Add(newsItem)
+ End Sub
+
+
+ private void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ RadPanelBar1.LoadContentFile("~/RadPanelBar/Examples/panelbar.xml");
+ }
+ }
+
+
+ Private Sub Page_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+ If Not Page.IsPostBack Then
+ RadPanelBar1.LoadContentFile("~/RadPanelBar/Examples/panelbar.xml")
+ End If
+ End Sub
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadPanel1.FindItem(ItemWithEqualsTextAndValue);
+ }
+ private static bool ItemWithEqualsTextAndValue(RadPanelItem item)
+ {
+ if (item.Text == item.Value)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
+ RadPanel1.FindItem(ItemWithEqualsTextAndValue)
+ End Sub
+ Private Shared Function ItemWithEqualsTextAndValue(ByVal item As RadPanelItem) As Boolean
+ If item.Text = item.Value Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ foreach (RadPanelBarItem item in RadPanelBar1.GetAllItems())
+ {
+ item.Enabled = false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ For Each childItem As RadPanelBarItem In RadPanelBar1.GetAllItems
+ childItem.Enabled = False
+ Next
+ End Sub
+
+
+ foreach (ClientOperation<RadPanelItem> operation in RadToolBar1.ClientChanges)
+ {
+ RadPanelItem item = operation.Item;
+
+ switch (operation.Type)
+ {
+ case ClientOperationType.Insert:
+ //An item has been inserted - operation.Item contains the inserted item
+ break;
+ case ClientOperationType.Remove:
+ //An item has been inserted - operation.Item contains the removed item.
+ //Keep in mind the item has been removed from the panelbar.
+ break;
+ case ClientOperationType.Update:
+ UpdateClientOperation<RadPanelItem> update = operation as UpdateClientOperation<RadPanelItem>
+ //The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
+ break;
+ case ClientOperationType.Clear:
+ //All children of have been removed - operation.Item contains the parent item whose children have been removed. If operation.Item is null then the root items have been removed.
+ break;
+ }
+ }
+
+
+ For Each operation As ClientOperation(Of RadPanelItem) In RadToolBar1.ClientChanges
+ Dim item As RadPanelItem = operation.Item
+ Select Case operation.Type
+ Case ClientOperationType.Insert
+ 'An item has been inserted - operation.Item contains the inserted item
+ Exit Select
+ Case ClientOperationType.Remove
+ 'An item has been inserted - operation.Item contains the removed item.
+ 'Keep in mind the item has been removed from the panelbar.
+ Exit Select
+ Case ClientOperationType.Update
+ Dim update As UpdateClientOperation(Of RadPanelItem) = TryCast(operation, UpdateClientOperation(Of RadPanelItem))
+ 'The "UpdateOperation" provides an additional property "PropertyName". This is the property whose value was changed from the client side.
+ Exit Select
+ Case ClientOperationType.Clear
+ 'All children of have been removed - operation.Item contains the parent item whose children have been removed. If operation.Item is Nothing then the root items have been removed.
+ Exist Select
+ End Select
+ Next
+
+
+ RadPanelBar1.Items[0].Text = "Example";
+ RadPanelBar1.Items[0].NavigateUrl = "http://www.example.com";
+
+
+ RadPanelBar1.Items(0).Text = "Example"
+ RadPanelBar1.Items(0).NavigateUrl = "http://www.example.com"
+
+ ++<ItemTemplate> +++<asp:CheckBox runat="server" + ID="CheckBox"></asp:CheckBox> +
+ <asp:Label runat="server" ID="Label1"++Text='<%# DataBinder.Eval(Container, "Text") %>' +></asp:Label> +</ItemTemplate> +<Items> +++<telerik:RadPanelItem Text="News" /> +<telerik:RadPanelItem Text="Sports" /> +<telerik:RadPanelItem Text="Games" /> +</Items> +
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadPanelBar1.ExpandAnimation.Type = AnimationType.Linear;
+ RadPanelBar1.ExpandAnimation.Duration = 300;
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ RadPanelBar1.ExpandAnimation.Type = AnimationType.Linear
+ RadPanelBar1.ExpandAnimation.Duration = 300
+ End Sub
+
+
+
+
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadPanelBar1.CollapseAnimation.Type = AnimationType.Linear;
+ RadPanelBar1.CollapseAnimation.Duration = 300;
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
+ RadPanelBar1.CollapseAnimation.Type = AnimationType.Linear
+ RadPanelBar1.CollapseAnimation.Duration = 300
+ End Sub
+
+
+ private void RadPanelBar1_ItemCreated(object sender, Telerik.WebControls.RadPanelBarItemEventArgs e)
+ {
+ e.Item.ToolTip = e.Item.Text;
+ }
+
+
+ Sub RadPanelBar1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.WebControls.RadPanelBarItemEventArgs) Handles RadPanelBar1.ItemCreated
+ e.Item.ToolTip = e.Item.Text
+ End Sub
+
+
+ private void RadPanelBar1_ItemDataBound(object sender, Telerik.WebControls.RadPanelBarEventArgs e)
+ {
+ RadPanelBarItem item = e.RadPanelBarItem;
+ DataRowView dataRow = (DataRowView) e.Item.DataItem;
+
+ item.ImageUrl = "image" + dataRow["ID"].ToString() + ".gif";
+ item.NavigateUrl = dataRow["URL"].ToString();
+ }
+
+
+ Sub RadPanelBar1_ItemDataBound(ByVal sender As Object, ByVal e As RadPanelBarEventArgs) Handles RadPanelBar1.ItemDataBound
+ Dim item As RadPanelBarItem = e.RadPanelBarItem
+ Dim dataRow As DataRowView = CType(e.Item.DataItem, DataRowView)
+
+ item.ImageUrl = "image" + dataRow("ID").ToString() + ".gif"
+ item.NavigateUrl = dataRow("URL").ToString()
+ End Sub
+
+
+ RadPanelItem item = new RadPanelItem();
+ item.Text = "News";
+ item.NavigateUrl = "~/News.aspx";
+
+ RadPanelbar1.Items.Add(item);
+
+
+ Dim item As New RadPanelItem()
+ item.Text = "News"
+ item.NavigateUrl = "~/News.aspx"
+
+ RadPanelbar1.Items.Add(item)
+
+
+ RadPanelItem item = new RadPanelItem("News");
+
+ RadPanelbar1.Items.Add(item);
+
+
+ Dim item As New RadPanelItem("News")
+
+ RadPanelbar1.Items.Add(item)
+
+
+ RadPanelItem item = new RadPanelItem("News", "~/News.aspx");
+
+ RadPanelbar1.Items.Add(item);
+
+
+ Dim item As New RadPanelItem("News", "~/News.aspx")
+
+ RadPanelbar1.Items.Add(item)
+
+
+ private void RadPanelbar1_PanelItemDataBound(object sender, Telerik.WebControls.RadPanelbarEventArgs e)
+ {
+ RadPanelItem item = e.Item;
+ DataRowView dataRow = (DataRowView) e.Item.DataItem;
+
+ item.ImageUrl = "image" + dataRow["ID"].ToString() + ".gif";
+ item.NavigateUrl = dataRow["URL"].ToString();
+ }
+
+
+ Sub RadPanel1_PanelItemDataBound(ByVal sender As Object, ByVal e As RadPanelbarEventArgs) Handles RadPanelbar1.ItemDataBound
+ Dim item As RadPanelItem = e.Item
+ Dim dataRow As DataRowView = CType(e.Item.DataItem, DataRowView)
+
+ item.ImageUrl = "image" + dataRow("ID").ToString() + ".gif"
+ item.NavigateUrl = dataRow("URL").ToString()
+ End Sub
+
+ ++<Items> +++<radP:RadPanelItem Text="Date"> +++<Items> +++<radP:RadPanelItem Text="SelectDate"> +++<ItemTemplate> +++<asp:Calendar runat="server" ID="Calendar1" + /> +</ItemTemplate> +</radP:RadPanelItem> +</Items> +</radP:RadPanelItem> +</Items> +
+ RadPanelItem newsItem = new RadPanelItem("News");
+ RadPanelBar1.Items.Add(newsItem);
+
+
+ Dim newsItem As RadPanelItem = New RadPanelItem("News")
+ RadPanelBar1.Items.Add(newsItem)
+
+
+ RadPanelItem[] items = new RadPanelItem[] { new RadPanelItem("First"), new RadPanelItem("Second"), new RadPanelItem("Third") };
+ RadPanelBar1.Items.AddRange(items);
+
+
+ Dim items() As RadPanelItem = {New RadPanelItem("First"), New RadPanelItem("Second"), New RadPanelItem("Third")}
+ RadPanelBar1.Items.AddRange(items)
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadPanel1.FindItem(ItemWithEqualsTextAndValue);
+ }
+ private static bool ItemWithEqualsTextAndValue(RadPanelItem item)
+ {
+ if (item.Text == item.Value)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
+ RadPanel1.FindItem(ItemWithEqualsTextAndValue)
+ End Sub
+ Private Shared Function ItemWithEqualsTextAndValue(ByVal item As RadPanelItem) As Boolean
+ If item.Text = item.Value Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+
+ <script type="text/javascript">
+ function DifferentControlsSource()
+ {
+ this.GetText = function()
+ {
+ return document.getElementById('before').value;
+ }
+
+ this.SetText = function(newValue)
+ {
+ document.getElementById('after').value = newValue;
+ }
+ }
+ </script>
+
+
+ spell1.CustomDictionarySourceTypeName = "RadSpellExtensions.CustomDictionarySource, RadSpellExtensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b5e57ccb698eab8e";
+
+
+ spell1.CustomDictionarySourceTypeName = "RadSpellExtensions.CustomDictionarySource, RadSpellExtensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b5e57ccb698eab8e"
+
+
+ <radS:RadSpell ID="spell1"
+ Runat="server"
+ ControlToCheck="textBox1"
+ SupportedLanguages="en-US,English,fr-FR,French">
+ </radS:RadSpell>
+
+
+ function onSpellLoad(sender, args)
+ {
+ log("spell: " + sender.get_id() + " ready.");
+ }
+
+
+ function onCheckStarted(sender, args)
+ {
+ log("spell: " + sender.clientId + " started for: " + sender.targetControlId);
+ }
+
+
+ function onCheckFinished(sender, args)
+ {
+ log("spell: " + sender.clientId + " finished for: " + sender.targetControlId);
+ }
+
+
+ function onCheckCancelled(sender, args)
+ {
+ log("spell: " + sender.clientId + " cancelled for: " + sender.targetControlId);
+ }
+
+
+ function onDialogClosed(sender, args)
+ {
+ alert("spell: " + sender.get_id()+ " dialog closed");
+ }
+
+
+ RadToolBarButton createNewButton = new RadToolBarButton("CreateNew");
+ RadToolBar1.Items.Add(createNewButton);
+
+
+ Dim createNewButton As RadToolBarButton = New RadToolBarButton("CreateNew")
+ RadToolBar1.Items.Add(createNewButton)
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadToolBar1.FindItem(ItemWithEqualsTextAndValue);
+ }
+ private static bool ItemWithEqualsTextAndValue(RadToolBarItem item)
+ {
+ if (item.Text == item.Value)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
+ RadToolBar1.FindItem(ItemWithEqualsTextAndValue)
+ End Sub
+ Private Shared Function ItemWithEqualsTextAndValue(ByVal item As RadToolBarItem) As Boolean
+ If item.Text = item.Value Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+
+ RadToolBarItem[] items = new RadToolBarItem[] { new RadToolBarButton("Create New"),
+ new RadToolBarDropDown("Manage"),
+ new RadToolBarSplitButton("Register Purchase")};
+ RadToolBar1.Items.AddRange(items);
+
+
+ Dim items() As RadToolBarItem = {New RadToolBarButton("Create New"),
+ New RadToolBarDropDown("Manage"),
+ New RadToolBarSplitButton("Register Purchase")}
+ RadToolBar1.Items.AddRange(items)
+
+
+ RadToolBarDropDown manageDropDown = new RadToolBarDropDown("Manage");
+
+ RadToolBarButton manageUsersButton = new RadToolBarButton("Users");
+ manageDropDown.Buttons.Add(manageUsersButton);
+
+ RadToolBarButton manageOrdersButton = new RadToolBarButton("Orders");
+ manageDropDown.Buttons.Add(manageOrdersButton);
+
+ RadToolBar1.Items.Add(manageDropDown);
+
+
+ Dim manageDropDown As RadToolBarDropDown = New RadToolBarDropDown("Manage")
+
+ Dim manageUsersButton As RadToolBarButton = New RadToolBarButton("Users")
+ manageDropDown.Buttons.Add(manageUsersButton)
+
+ Dim manageOrdersButton As RadToolBarButton = New RadToolBarButton("Orders")
+ manageDropDown.Buttons.Add(manageOrdersButton)
+
+ RadToolBar1.Items.Add(manageDropDown)
+
+
+ RadToolBarDropDown manageDropDown = new RadToolBarDropDown("Manage");
+ RadToolBarButton[] buttons = new RadToolBarButton[] { new RadToolBarButton("Users"),
+ new RadToolBarButton("Orders")};
+
+ manageDropDown.Buttons.AddRange(buttons);
+
+ RadToolBar1.Items.Add(manageDropDown);
+
+
+ Dim manageDropDown As RadToolBarDropDown = New RadToolBarDropDown("Manage")
+ Dim buttons() As RadToolBarButton = {New RadToolBarButton("Users"),
+ New RadToolBarButton("Orders")}
+
+ manageDropDown.Buttons.AddRange(buttons)
+
+ RadToolBar1.Items.Add(manageDropDown)
+
+
+ <telerik:RadTreeView ID="RadTreeView1" runat="server">
+ <ContextMenus>
+ <telerik:RadTreeViewContextMenu ID="ContextMenu1">
+ <Items>
+ <telerik:RadMenuItem Text="Menu1Item1"></telerik:RadMenuItem>
+ <telerik:RadMenuItem Text="Menu1Item2"></telerik:RadMenuItem>
+ </Items>
+ </telerik:RadTreeViewContextMenu>
+ <telerik:RadTreeViewContextMenu Skin="Outlook" ID="ContextMenu2">
+ <Items>
+ <telerik:RadMenuItem Text="Menu2Item1"></telerik:RadMenuItem>
+ <telerik:RadMenuItem Text="Menu2Item2"></telerik:RadMenuItem>
+ </Items>
+ </telerik:RadTreeViewContextMenu>
+ </ContextMenus>
+ <Nodes>
+ <telerik:RadTreeNode Text="Node1" ContextMenuID="ContextMenu2">
+ <Nodes>
+ <telerik:RadTreeNode Text="Node11" ContextMenuID="ContextMenu2"></telerik:RadTreeNode>
+ <telerik:RadTreeNode Text="Node12" ContextMenuID="ContextMenu2"></telerik:RadTreeNode>
+ </Nodes>
+ </telerik:RadTreeNode>
+ <telerik:RadTreeNode Text="Node2" ContextMenuID="ContextMenu2">
+ <Nodes>
+ <telerik:RadTreeNode Text="Node21" ContextMenuID="ContextMenu2"></telerik:RadTreeNode>
+ <telerik:RadTreeNode Text="Node22" ContextMenuID="ContextMenu2"></telerik:RadTreeNode>
+ </Nodes>
+ </telerik:RadTreeNode>
+ </Nodes>
+ </telerik:RadTreeView>
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" %>
+ <%@ Register TagPrefix="Telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
+
+ <script runat="server">
+ void RadTreeView1_ContextMenuItemClick(object sender, RadTreeViewContextMenuEventArgs e)
+ {
+ lblInfo.Text = string.Format(@"You clicked on Menu Item {0}(""{1}"") of Node {2}(""{3}"")",
+ e.MenuItem.Index, e.MenuItem.Text, e.Node.Index, e.Node.Text);
+ }
+ </script>
+
+ <html>
+ <body>
+ <form id="form1" runat="server">
+ <Telerik:RadScriptManager ID="RadScriptManager1" runat="server"></Telerik:RadScriptManager>
+ <br />
+ <asp:Label ID="lblInfo" style="border:solid 1px black; background-color:InfoBackground;font:normal 12px Courier New;" runat="server">Click on a context menu item to see the information for it.</asp:Label>
+ <br />
+ <Telerik:RadTreeView ID="RadTreeView1" runat="server" OnContextMenuItemClick="RadTreeView1_ContextMenuItemClick">
+ <ContextMenus>
+ <Telerik:RadTreeViewContextMenu ID="ContextMenu1">
+ <Items>
+ <Telerik:RadMenuItem Text="Menu1Item1"></Telerik:RadMenuItem>
+ <Telerik:RadMenuItem Text="Menu1Item2"></Telerik:RadMenuItem>
+ </Items>
+ </Telerik:RadTreeViewContextMenu>
+ <Telerik:RadTreeViewContextMenu Skin="Outlook" ID="ContextMenu2">
+ <Items>
+ <Telerik:RadMenuItem Text="Menu2Item1"></Telerik:RadMenuItem>
+ <Telerik:RadMenuItem Text="Menu2Item2"></Telerik:RadMenuItem>
+ </Items>
+ </Telerik:RadTreeViewContextMenu>
+ </ContextMenus>
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node1" ContextMenuID="ContextMenu2">
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node11" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node12" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node2" ContextMenuID="ContextMenu2">
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node21" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node22" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeView>
+
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" AutoEventWireup="true" %>
+ <%@ Register TagPrefix="Telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
+
+ <script runat="server">
+ Sub RadTreeView1_ContextMenuItemClick(ByVal sender as Object, ByVal e as RadTreeViewContextMenuEventArgs)
+ lblInfo.Text = String.Format("You clicked on Menu Item {0}(""{1}"") of Node {2}(""{3}"")", _
+ e.MenuItem.Index, e.MenuItem.Text, e.Node.Index, e.Node.Text)
+ End Sub
+ </script>
+
+ <html>
+ <body>
+ <form id="form1" runat="server">
+ <Telerik:RadScriptManager ID="RadScriptManager1" runat="server"></Telerik:RadScriptManager>
+ <br />
+ <asp:Label ID="lblInfo" style="border:solid 1px black; background-color:InfoBackground;font:normal 12px Courier New;" runat="server">Click on a context menu item to see the information for it.</asp:Label>
+ <br />
+ <Telerik:RadTreeView ID="RadTreeView1" runat="server" OnContextMenuItemClick="RadTreeView1_ContextMenuItemClick">
+ <ContextMenus>
+ <Telerik:RadTreeViewContextMenu ID="ContextMenu1">
+ <Items>
+ <Telerik:RadMenuItem Text="Menu1Item1"></Telerik:RadMenuItem>
+ <Telerik:RadMenuItem Text="Menu1Item2"></Telerik:RadMenuItem>
+ </Items>
+ </Telerik:RadTreeViewContextMenu>
+ <Telerik:RadTreeViewContextMenu Skin="Outlook" ID="ContextMenu2">
+ <Items>
+ <Telerik:RadMenuItem Text="Menu2Item1"></Telerik:RadMenuItem>
+ <Telerik:RadMenuItem Text="Menu2Item2"></Telerik:RadMenuItem>
+ </Items>
+ </Telerik:RadTreeViewContextMenu>
+ </ContextMenus>
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node1" ContextMenuID="ContextMenu2">
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node11" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node12" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node2" ContextMenuID="ContextMenu2">
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node21" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node22" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeView>
+
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="C#" AutoEventWireup="true" %>
+ <%@ Register TagPrefix="Telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
+
+ <script runat="server">
+ void RadTreeView1_ContextMenuItemClick(object sender, RadTreeViewContextMenuEventArgs e)
+ {
+ lblInfo.Text = string.Format(@"You clicked on Menu Item {0}(""{1}"") of Node {2}(""{3}"")",
+ e.MenuItem.Index, e.MenuItem.Text, e.Node.Index, e.Node.Text);
+ }
+ </script>
+
+ <html>
+ <body>
+ <form id="form1" runat="server">
+ <Telerik:RadScriptManager ID="RadScriptManager1" runat="server"></Telerik:RadScriptManager>
+ <br />
+ <asp:Label ID="lblInfo" style="border:solid 1px black; background-color:InfoBackground;font:normal 12px Courier New;" runat="server">Click on a context menu item to see the information for it.</asp:Label>
+ <br />
+ <Telerik:RadTreeView ID="RadTreeView1" runat="server" OnContextMenuItemClick="RadTreeView1_ContextMenuItemClick">
+ <ContextMenus>
+ <Telerik:RadTreeViewContextMenu ID="ContextMenu1">
+ <Items>
+ <Telerik:RadMenuItem Text="Menu1Item1"></Telerik:RadMenuItem>
+ <Telerik:RadMenuItem Text="Menu1Item2"></Telerik:RadMenuItem>
+ </Items>
+ </Telerik:RadTreeViewContextMenu>
+ <Telerik:RadTreeViewContextMenu Skin="Outlook" ID="ContextMenu2">
+ <Items>
+ <Telerik:RadMenuItem Text="Menu2Item1"></Telerik:RadMenuItem>
+ <Telerik:RadMenuItem Text="Menu2Item2"></Telerik:RadMenuItem>
+ </Items>
+ </Telerik:RadTreeViewContextMenu>
+ </ContextMenus>
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node1" ContextMenuID="ContextMenu2">
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node11" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node12" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node2" ContextMenuID="ContextMenu2">
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node21" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node22" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeView>
+
+ </form>
+ </body>
+ </html>
+
+
+ <%@ Page Language="VB" AutoEventWireup="true" %>
+ <%@ Register TagPrefix="Telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
+
+ <script runat="server">
+ Sub RadTreeView1_ContextMenuItemClick(ByVal sender as Object, ByVal e as RadTreeViewContextMenuEventArgs)
+ lblInfo.Text = String.Format("You clicked on Menu Item {0}(""{1}"") of Node {2}(""{3}"")", _
+ e.MenuItem.Index, e.MenuItem.Text, e.Node.Index, e.Node.Text)
+ End Sub
+ </script>
+
+ <html>
+ <body>
+ <form id="form1" runat="server">
+ <Telerik:RadScriptManager ID="RadScriptManager1" runat="server"></Telerik:RadScriptManager>
+ <br />
+ <asp:Label ID="lblInfo" style="border:solid 1px black; background-color:InfoBackground;font:normal 12px Courier New;" runat="server">Click on a context menu item to see the information for it.</asp:Label>
+ <br />
+ <Telerik:RadTreeView ID="RadTreeView1" runat="server" OnContextMenuItemClick="RadTreeView1_ContextMenuItemClick">
+ <ContextMenus>
+ <Telerik:RadTreeViewContextMenu ID="ContextMenu1">
+ <Items>
+ <Telerik:RadMenuItem Text="Menu1Item1"></Telerik:RadMenuItem>
+ <Telerik:RadMenuItem Text="Menu1Item2"></Telerik:RadMenuItem>
+ </Items>
+ </Telerik:RadTreeViewContextMenu>
+ <Telerik:RadTreeViewContextMenu Skin="Outlook" ID="ContextMenu2">
+ <Items>
+ <Telerik:RadMenuItem Text="Menu2Item1"></Telerik:RadMenuItem>
+ <Telerik:RadMenuItem Text="Menu2Item2"></Telerik:RadMenuItem>
+ </Items>
+ </Telerik:RadTreeViewContextMenu>
+ </ContextMenus>
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node1" ContextMenuID="ContextMenu2">
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node11" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node12" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node2" ContextMenuID="ContextMenu2">
+ <Nodes>
+ <Telerik:RadTreeNode Text="Node21" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ <Telerik:RadTreeNode Text="Node22" ContextMenuID="ContextMenu2"></Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeNode>
+ </Nodes>
+ </Telerik:RadTreeView>
+
+ </form>
+ </body>
+ </html>
+
+
+ Private Sub RadUpload1_FileExists(ByVal sender As Object, ByVal e As WebControls.UploadedFileEventArgs) Handles RadUpload1.FileExists
+ Dim TheFile As Telerik.WebControls.UploadedFile = e.UploadedFile
+
+ e.UploadedFile.SaveAs(Path.Combine(RadUpload1.TargetFolder, TheFile.GetName + "1" + TheFile.GetExtension))
+ End Sub
+
+
+ private void RadUpload1_FileExists(object sender, Telerik.WebControls.UploadedFileEventArgs e)
+ {
+ Telerik.WebControls.UploadedFile TheFile = e.UploadedFile;
+
+ TheFile.SaveAs(Path.Combine(RadUpload1.TargetFolder, TheFile.GetName() + "1" + TheFile.GetExtension()));
+ }
+
+
+ Private Sub RadUpload1_ValidatingFile(ByVal sender As Object, ByVal e As WebControls.ValidateFileEventArgs) Handles RadUpload1.ValidatingFile
+ If e.UploadedFile.GetExtension.ToLower() = ".zip" Then
+ 'The zip files are not allowed for upload
+ e.IsValid = False
+ End If
+ End Sub
+
+
+ private void RadUpload1_ValidatingFile(object sender, ValidateFileEventArgs e)
+ {
+ if (e.UploadedFile.GetExtension().ToLower() == ".zip")
+ {
+ //The zip files are not allowed for upload
+ e.IsValid = false;
+ }
+ }
+
+
+ Private Sub RadUpload1_ValidatingFile(ByVal sender As Object, ByVal e As WebControls.ValidateFileEventArgs) Handles RadUpload1.ValidatingFile
+ If e.UploadedFile.GetExtension.ToLower = ".zip" Then
+ Dim maxZipFileSize As Integer = 10000000 '~10MB
+ If e.UploadedFile.ContentLength > maxZipFileSize Then
+ e.IsValid = False
+ End If
+ 'The zip files are not validated for file size, extension and mime type
+ e.SkipInternalValidation = True
+ End If
+ End Sub
+
+
+ private void RadUpload1_ValidatingFile(object sender, ValidateFileEventArgs e)
+ {
+ if (e.UploadedFile.GetExtension().ToLower() == ".zip")
+ {
+ int maxZipFileSize = 10000000; //~10MB
+ if (e.UploadedFile.ContentLength > maxZipFileSize)
+ {
+ e.IsValid = false;
+ }
+ //The zip files are not validated for file size, extension and content type
+ e.SkipInternalValidation = true;
+ }
+ }
+
+