Public Sub TreeInit() Dim newNode2 As New AttachmentFolderNode("FolderNode") Dim tvNodes As Telerik.Web.UI.RadTreeNodeCollection = RadTreeView1.Nodes tvNodes.Add(newNode2) RadTreeView1.DataBind() End SubPublic Class AttachmentFolderNode Inherits RadTreeNode Dim tp As New AttachmentFolderNodeTemplate Public Sub New(nodeText As String) MyBase.Text = nodeText MyBase.ImageUrl = ".\Images\book.png" tp.InstantiateIn(Me) End SubEnd ClassPublic Class AttachmentFolderNodeTemplate Implements System.Web.UI.ITemplate Public Overridable Sub InstantiateIn(container As Control) Implements ITemplate.InstantiateIn Dim img1 As New Image Dim img2 As New Image Dim lbl_space1 As New Label Dim lbl_space2 As New Label lbl_space1.Text = " " lbl_space2.Text = " " Dim label1 As New Label img1.ImageUrl = ".\Images\Close_Box.png" img2.ImageUrl = ".\Images\edit.png" Dim Link1 As New LinkButton img1.ImageUrl = ".\Images\edit.png" img1.ToolTip = "Edit" Link1.Controls.Add(img1) Dim Link2 As New LinkButton img2.ImageUrl = "\Images\Close_box.png" img2.ToolTip = "Delete" Link2.Controls.Add(img2) Dim rtn As RadTreeNode = DirectCast(container, RadTreeNode) label1.Text = rtn.Text AddHandler label1.DataBinding, AddressOf label1_DataBinding container.Controls.Add(label1) container.Controls.Add(lbl_space1) container.Controls.Add(Link1) container.Controls.Add(lbl_space2) container.Controls.Add(Link2) End Sub<telerik:RadComboBox ID="Categoria" Runat="server" DropDownWidth="350px" Height="175px" EmptyMessage="Seleziona la tua categoria" EnableLoadOnDemand="True" EnableVirtualScrolling="True" LoadingMessage="Caricamento..." ShowMoreResultsBox="True" Filter="StartsWith" MaxHeight="175px" Skin="Sunset" Width="350px" EnableItemCaching="True" Font-Italic="True" Font-Names="Verdana" AutoPostBack="True" > <WebServiceSettings Path="WebService.asmx" Method="GetCategoryNames" /></telerik:RadComboBox>Imports System.Web.ServicesImports System.CollectionsImports System.Collections.GenericImports System.Web.Script.ServicesImports SystemImports System.DataImports System.WebImports System.Data.SqlClientImports Telerik.Web.UI<WebService([Namespace]:="http://tempuri.org/")> _<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<ScriptService()> _Public Class TryWebService Private Const ItemsCategoryPerRequest As Integer = 10 Private Const ItemsCityPerRequest As Integer = 10 <WebMethod()> _ Public Function GetCategoryNames(ByVal context As RadComboBoxContext) As RadComboBoxData Dim data As DataTable = Getcategoria(context.Text) Dim comboData As New RadComboBoxData() Dim itemOffset As Integer = context.NumberOfItems Dim endOffset As Integer = Math.Min(itemOffset + ItemsCategoryPerRequest, data.Rows.Count) comboData.EndOfItems = endOffset = data.Rows.Count Dim result As New List(Of RadComboBoxItemData)(endOffset - itemOffset) For i As Integer = itemOffset To endOffset - 1 Dim itemData As New RadComboBoxItemData() itemData.Text = data.Rows(i)("descrizione").ToString() itemData.Value = data.Rows(i)("id").ToString() result.Add(itemData) Next REM ottengo il messaggio dei record selezionati comboData.Message = GetStatusMessage(endOffset, data.Rows.Count) comboData.Items = result.ToArray() Return comboData End Function Private Function GetStatusMessage(ByVal offset As Integer, ByVal total As Integer) As String If total <= 0 Then Return "Nessun dato" End If Return [String].Format("Record <b>1</b>-<b>{0}</b> di <b>{1}</b>", offset, total) End Function Private Function Getcategoria(ByVal text As String) As DataTable REM SELECT * FROM Tab_categorie WHERE CONTAINS(descrizione, @text) REM per indici full text Dim conString = ConfigurationManager.ConnectionStrings("TrycontactString") Dim strConnString As String = conString.ConnectionString Using scope As New Transactions.TransactionScope Using db As New SqlConnection(strConnString) db.Open() Using sqlcmd As New SqlCommand("select_category", db) sqlcmd.CommandType = CommandType.StoredProcedure sqlcmd.Parameters.AddWithValue("@desc", SqlDbType.VarChar).Value = text Dim adapter As New SqlDataAdapter(sqlcmd) Dim data As New DataTable() adapter.Fill(data) Return data End Using End Using scope.Complete() End Using End Function<table width="800px"><tr><td align="right">
<telerik:RadButton ID="ToggleResponseView" OnCommand="OnToggleResponseView" AccessKey="1" runat="server" ButtonType="StandardButton" ToggleType="CustomToggle">
<ToggleStates>
<telerik:RadButtonToggleState Text="SVIEW" />
<telerik:RadButtonToggleState Text="FRECORD" />
</ToggleStates>
</telerik:RadButton>
</td>
<td>
<asp:CheckBox ID="chkisSummary" runat="server" AutoPostBack="true" OnClientToggleStateChanged="chkSummaryAll" OnCheckedChanged="ViewSummaryAll" Checked="false" Visible="true" text="Show All"/>
</td></tr></table>
<script type="text/javascript">
function chkSummaryAll(sender, args) {
switch (args.get_currentToggleState().get_text()) {
case "SVIEW":
document.getElementById("chkisSummary").checked = false;
alert("RadButton was clicked.");
break;}
}
</script>
I want to hide the check box 'chkisSummary' when the toggle button ttext is 'SVIEW'. However for somne reason the checkbox object is coming as Null and the javascript does not work.
Please suggest.
Here below is my scenario (thats actually mimicing the radWindow approach mentioned in this URL :
Using RadUpload Progress area in RadWindow ) in http://www.telerik.com/support/kb/aspnet-ajax/window/using-radupload-progress-area-in-radwindow.aspx)
1) I've a RadUpload (say 'radupload1) control on page1.aspx
2) an asp.net button to indicate upload processing Button (say 'button1') on the same page i.e, page1.aspx
3) a radWindow on the page1.aspx to open page2.aspx (detailing in next point below)
3) I've second page viz., page2.aspx (to open in radWindow from page1.aspx) with radprogressmanager and radprogressarea
4) I'm good about client side things like, opening page2.aspx in radWindow as soon as I hit button1 (as explainied in URL provided), radWindow Closes once upload progress reaches 100%, radwindow closes on Cancel Click (for big files like 50 MB),
However I'm primarily stuck with questions on server side
5) I need to handle custom steps in radProgressArea1 that include file upload/stream to webserver by radUpload, security checks, file conversion to a known standard format, queuing the file to a different service, update the db by DAL layer, then I need to let the radWindow close by itself.
I'm wondering how to stream the file in page2.aspx that has been selected using radUpload on page1.aspx?
the above URL was good for client side operations, is there any code sample/URL that might be handling similar scenario Or Can you please assist on this. Thank you in advance.
Not providing the sample application since my application just followed what was suggested in above URL.
(The low priority thing for me, "nice to have resolution" is : the radWindow cancel taking looong time (appearing like stuck) to refresh page1.aspx)
PS: I should be using Telerik rad controls version 2008.2.723.20
<telerik:RadGrid runat="server" ID="grid" Visible="false" OnNeedDataSource="grid_NeedDataSource" AllowPaging="true" AllowCustomPaging="true" PageSize="10"> <ClientSettings ClientEvents-OnRowClick="consultarSolicitacao" EnableRowHoverStyle="true" />
... </telerik:RadGrid>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" InitialDelayTime="0" MinDisplayTime="500"
Transparency="50" BackgroundPosition="Center" Skin="Telerik" /><telerik:RadTreeList runat="server" ID="RadTreeList1" Skin="Telerik" AutoGenerateColumns="true" DataKeyNames="DataKey" ParentDataKeyNames="ParentDataKey" AllowSorting="true" ItemStyle-CssClass="RowStyle" AlternatingItemStyle-CssClass="AlternatingRowStyle" HeaderStyle-CssClass="HeaderStyle" SelectedItemStyle-CssClass="SelectedRowStyle" OnAutoGeneratedColumnCreated="RadTreeList1_OnColumnCreated" Visible="false" > <ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="true" /> <Resizing AllowColumnResize="true" ResizeMode="NoScroll" /> </ClientSettings> </telerik:RadTreeList>// Bind data with tree list display controlthis.RadTreeList1.DataSource = myDataTable;this.RadTreeList1.DataBind();// Hide the DataKey and ParentDataKey columnsforeach (var c in this.RadTreeList1.AutoGeneratedColumns){ if (c.UniqueName.Equals("DataKey") || c.UniqueName.Equals("ParentDataKey")) { c.Display = false; }}