RadToolBarDropDown rbViewReport = (RadToolBarDropDown)RadToolBar4.FindItemByText("Please Select"); rbViewReport.Text = RetrievedValueConfirm;I am using Windows XP, VS 2008 VB, and Telerik controls 2009.2.826.35. I have a radtabstrip with three tabs and a radmultipage with three pageviews. There are fieldvalidators for the first two pages/tabs and a validationsummary for each. The validation is triggered if the user clicks on the button at the bottom of the page but wont’t if they just click on the tab at the top. If a user clicks on the second tab without all the required fields filled in on the first pageview, I want the validationgroup for that page to be triggered. If the user gets as far as the second pageview and clicks on the third tab, without all required fields filled in, then I want the validationgroup for the second page to be triggered.
I have set the “CausesValidation” property to true but it appears to have no effect. I have also tried to use the javascript routine, UpdateValidationGroup (two slightly different variations), that I found in your forums but it gives me an error: “Microsoft JScript runtime error: 'undefined' is null or not an object”. It occurs on the line: var selectedTab = tabstrip.get_selectedTab();.
Below is my markup without the pageviews and the controls.
Thanks for any assistance,
Alex
<%@ Page Title="" Language="VB" MasterPageFile="~/Pages/MasterPages/MasterPage.master" AutoEventWireup="false" CodeBehind="ExamRegistration.aspx.vb" Inherits="SPPOnlineExamRegistrationWebApp.Pages_ExamRegistration" %> <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <!--- <link href="../../Library/CSS/StyleSheet.css" rel="stylesheet" type="text/css" /> ---> <form id="main" runat="server"> <br /> <p style="text-align: center"> <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="Medium" Text="Pesticide Exam Registration"></asp:Label> </p> <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="True"> </telerik:RadScriptManager> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadMultiPage1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" /> <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadTabStrip1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" /> <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <script type="text/javascript" > function UpdateValidationGroup() { var tabStrip = $find("<%= RadTabStrip1.ClientID %>"); var selectedTab = tabStrip.get_selectedTab(); if(selectedTab != null) tabStrip.ValidationGroup = selectedTab.get_value(); } </script> <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0" BorderStyle="None" Font-Size="Medium" Skin="WebBlue" Height="19px" CausesValidation="true" Width="441px" AutoPostBack="True" OnClientTabSelected="UpdateValidationGroup" ValidationGroup="ExamRegistration" > <Tabs> <telerik:RadTab runat="server" PageViewID="rpvExamRegistration" Text="Exam Registration" SelectedIndex="0" Selected="True" onclick="UpdateValidationGroup()" Value="ExamRegistration" > </telerik:RadTab> <telerik:RadTab runat="server" PageViewID="rpvContactInformation" Text="Contact Information" SelectedIndex="1" onclick="UpdateValidationGroup()" Value="ContactInfo" > </telerik:RadTab> <telerik:RadTab runat="server" PageViewID="rpvConfirmation" Text="Confirmation" SelectedIndex="2"> </telerik:RadTab> </Tabs> </telerik:RadTabStrip>
<telerik:RadGrid ID="rgContactsResult" runat="server" Width="99%" AllowPaging="True" AllowSorting="true"
GridLines="None" PageSize="10" AllowFilteringByColumn="True" AutoGenerateColumns="false">
<PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" Wrap="false"></PagerStyle>
<GroupingSettings CaseSensitive="false" />
<ClientSettings EnablePostBackOnRowClick="true">
<Selecting AllowRowSelect="true" />
<KeyboardNavigationSettings AllowSubmitOnEnter="true" />
</ClientSettings>
<MasterTableView CommandItemDisplay="None">
<Columns>
<telerik:GridBoundColumn HeaderText="Our Ref" UniqueName="contactID" DataField="contactID" AllowFiltering="false" >
<telerik:GridTemplateColumn HeaderText="ContactJob" UniqueName="ContactJob" AllowFiltering="false">
<ItemTemplate>
<%# ContactJob(DataBinder.Eval(Container.DataItem, "ContactID"))%>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
Thanks
function SetFocusAndSelectText(tbID) {<br> var textBox = $get(tbID);<br><br> // Standard approach<br> textBox.focus();<br> textBox.select();<br><br><br> // Approach when the TextBox resides in an AJAXified RadWindow<br> // function f() {<br> // debugger <br> // if (textBox != null) {<br> // textBox.focus();<br> // textBox.select();<br> // }<br><br> // Sys.Application.remove_load(f);<br> // }<br><br> // Sys.Application.add_load(f);<br> } //........
EventSessions = from eventobj1 in context.EventSessions
where eventobj1.Event.Id == eventid
select eventobj1; foreach (EventSessionsItem session in EventSessions) { Appointment _appointment = new Appointment(); editor.Content = session.Event.EventDetails; _appointment.Subject = session.Title; _appointment.Description = Server.HtmlDecode(editor.Text); _appointment.Start = session.DateOfSession.Value; _appointment.End = dtStart.AddHours(session.SessionDuration.Value); sbICSFile.Append(RadScheduler.ExportToICalendar(_appointment)); } WriteCalendar(sbICSFile.ToString());
private void WriteCalendar(String data)
{
HttpResponse response = Page.Response;
response.Clear();
response.Buffer = true;
response.ContentType = "text/calendar";
response.ContentEncoding = Encoding.UTF8;
response.Charset = "utf-8";
response.AddHeader("Content-Disposition", "attachment;filename=\"Calendar.ics\"");
response.Write(data);
response.End();
}Hi there,
I have created a webpart include a RadTreeView in Sharepoint 2010. However, when I open the IE to see webpart , I see following script error:
Message: 'RadTreeView1_NodeClicked' is undefined Line: 1481 Char: 5 Code: 0 <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HiTreeViewUserControl.ascx.cs" Inherits="TreeView.HiTreeView.HiTreeViewUserControl" %> <%@ Register Assembly="Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> <%@ Register Assembly="Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.Design" TagPrefix="telerik" %> <telerik:RadTreeView ID="RadTreeView1" Runat="server" EnableEmbeddedScripts="true" OnClientNodeClicked="RadTreeView1_NodeClicked"> <DataBindings> <telerik:RadTreeNodeBinding Expanded="True" /> </DataBindings> </telerik:RadTreeView> <telerik:RadTextBox ID="Dscp" Runat="server" Height="100px" LabelWidth="" Text="Comment" TextMode="MultiLine" Width="325px"> </telerik:RadTextBox> <p> </p> <telerik:RadButton ID="btnUpdate" runat="server" onclick="btnUpdate_Click" Text="Update"> </telerik:RadButton>
using System; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using Telerik.Web.UI; using System.Data; using Microsoft.SharePoint; using Microsoft.SharePoint.WebControls; namespace TreeView.HiTreeView { public partial class HiTreeViewUserControl : UserControl { static int selectedItem; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BindToDataSet(RadTreeView1); } } private static void BindToDataSet(RadTreeView treeView) { try { DataSet dataSet = new DataSet(); dataSet.Tables.Add("Table"); dataSet.Tables[0].Columns.Add("ID", typeof(int)); dataSet.Tables[0].Columns.Add("ParentID", typeof(int)); dataSet.Tables[0].Columns.Add("Text", typeof(string)); SPSite spSite = new SPSite(SPContext.Current.Web.Url); SPWeb spWeb = spSite.OpenWeb(); SPList peopleList = spWeb.Lists["People"]; foreach (SPListItem people in peopleList.Items) { DataRow row = dataSet.Tables[0].NewRow(); row["ID"] = people["ID"]; row["Text"] = people["Name"]; if (people["Manager"] != null) { int intIndex = Convert.ToInt32(people["Manager"].ToString().IndexOf(';')); row["ParentID"] = Convert.ToInt32(people["Manager"].ToString().Substring(0, intIndex)); } dataSet.Tables[0].Rows.Add(row); } treeView.DataTextField = "Text"; treeView.DataFieldID = "ID"; treeView.DataFieldParentID = "ParentID"; treeView.DataSource = new HierarchicalDataSet(dataSet, "ID", "ParentID"); treeView.DataBind(); } catch(Exception ex) { } } protected void RadTreeView1_NodeClicked(object sender, EventArgs e) { SPSite spSite = new SPSite(SPContext.Current.Web.Url); SPWeb spWeb = spSite.OpenWeb(); SPList peopleList = spWeb.Lists["People"]; foreach (SPListItem people in peopleList.Items) { if (people["Name"] != null) { if (RadTreeView1.SelectedNode.Text.ToString() == people["Name"].ToString()) { if (people["Comment"] != null) { Dscp.Text = people["Comment"].ToString(); } else { Dscp.Text = ""; } } } } selectedItem = Convert.ToInt32(RadTreeView1.SelectedNode.Value.ToString()); } protected void btnUpdate_Click(object sender, EventArgs e) { SPSite spSite = new SPSite(SPContext.Current.Web.Url); SPWeb spWeb = spSite.OpenWeb(); SPListItem itemUpdate = spWeb.Lists["People"].Items[selectedItem]; itemUpdate["Comment"] = Dscp.Text; itemUpdate.Update(); } } } Dears;
am having an issue on the combobox checkbox property;
the control syntax is:
<rad:RadComboBox ID="lstCustomrs" runat="server" Width="300px" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" Localization-AllItemsCheckedString="All Customers"EmptyMessage="Select Customer"></rad:RadComboBox>All Items are checked by default:
Private Sub lstCustomers_ItemDataBound(sender As Object, e As Telerik.Web.UI.RadComboBoxItemEventArgs) Handles lstCustoemrss.ItemDataBound e.Item.Checked = TrueEnd SubThe Scenario is:
Can you please advise
|
<telerik:RadPanelBar ID="pbCategory" runat="server">
<Items>
<telerik:RadPanelItem runat="server" Text="Root RadPanelItem1">
<Items>
<telerik:RadPanelItem>
<ItemTemplate>
<table style="width:90%; margin:5px 10px 5px 10px">
<tr style="width:90%">
<td colspan="2" style="width:85%; text-align:left; border:1px solid black"><asp:Label id="lblDetails" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Details") %>' /></td>
<td style="width:5%; text-align:right"><asp:ImageButton ID="btnEdit" runat="server" src="../images/ico_Edit.gif"/></td>
</tr>
<tr>
<td style="width:45%; text-align:left">Added By:<asp:Label id="lblAddedBy" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "AddedBy") %> ' /></td>
<td style="width:45%; text-align:right">Last Updated By:<asp:Label id="lblUpdatedBy" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "UpdatedBy") %>' /></td>
<td> </td>
</tr>
</table>
</ItemTemplate>
</telerik:RadPanelItem>
</Items>
</telerik:RadPanelItem>
</Items>
</telerik:RadPanelBar>
CS:
pbCategory.DataSource = ds;
pbCategory.DataTextField =
"LongName";
pbCategory.DataValueField =
"CategoryCode";
pbCategory.DataFieldParentID = "Id";
pbCategory.DataBind();