Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
85 views
How do I trap the click event of a link control in a RadNodeTemplate. The node is created in code seen below.
    Public Sub TreeInit()
 
       Dim newNode2 As New AttachmentFolderNode("FolderNode")
 
        Dim tvNodes As Telerik.Web.UI.RadTreeNodeCollection = RadTreeView1.Nodes
        tvNodes.Add(newNode2)
 
 
        RadTreeView1.DataBind()
 
    End Sub
 
Public 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 Sub
End Class
 
Public 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
Boyan Dimitrov
Telerik team
 answered on 12 Feb 2013
3 answers
78 views
guys,

when i start the page web and click on combobox after the load the record into combo, if i click on item record i've this error:

"Unable to get the value of the 'get_Count' null object or undefined"

but the same procedure on another combobox does not generate this error.

the combobox that this error is this:
<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>

this is code webservice:

Imports System.Web.Services
Imports System.Collections
Imports System.Collections.Generic
Imports System.Web.Script.Services
Imports System
Imports System.Data
Imports System.Web
Imports System.Data.SqlClient
Imports 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


Hristo Valyavicharski
Telerik team
 answered on 12 Feb 2013
3 answers
323 views
Hello,

I have the following code on my aspx page

<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.

Danail Vasilev
Telerik team
 answered on 12 Feb 2013
3 answers
118 views

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

Marin Bratanov
Telerik team
 answered on 12 Feb 2013
1 answer
179 views
Hi ALL,

I have a search page with a RadGrid.Visible=false; after user clicks on "Search" button, a partial postback controlled by RadAjaxManager sets grid.Visible=true, but configured client settings doesn't works. If i have a full postback or grid always shows up, that problem doesn't occurs.

<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>

I'm running 2012.3.1308.35 on Microsoft SharePoint 2010.

Thanks,
Eyup
Telerik team
 answered on 12 Feb 2013
6 answers
110 views
Hello,

I have a RadAjaxLoadingPanel with a Telerik skin.

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"
               InitialDelayTime="0" MinDisplayTime="500"
               Transparency="50" BackgroundPosition="Center" Skin="Telerik" />

When an update is done, I see the loading panel displayed over my control, but the little gif central animation is missing.

As you can see in the attached png file (in the red cercle I added), we can see the place of the animation (the position seems to be good), but  there is no animation.

Should I have to define explicitly the gif file ? I thought it is done by chosing a skin.

Thanks by advance.

Damien 
Damien
Top achievements
Rank 1
 answered on 12 Feb 2013
10 answers
358 views
Hi there

Does anyone know if there is a way to tell radCaptcha to start from scratch and ignore any existing images in the Cache? I'm thinking that during development, when I'm hitting lots of new page loads, that previous images in the cache might be causing a trouble I have with intermittent blank Captcha images.

Could anybody advise if this is a useful way forward?

Thanks

 
Slav
Telerik team
 answered on 12 Feb 2013
2 answers
154 views
Hello,

First step: I have a generic page with a tree list control which is by default not visible.
On some conditions, I make it visible and bind it on a datatable, result of a stored procedure.
The columns are all autogenerated, so the stored procedure returns at least a column named DataKey and one named ParentDataKey (as named in the tree list declaration).

<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>

This works correctly.

Second step: I don't want to display the identifers used as data key and as parent data key. So I add some code just after the binding to hide those column.

// Bind data with tree list display control
this.RadTreeList1.DataSource = myDataTable;
this.RadTreeList1.DataBind();
 
// Hide the DataKey and ParentDataKey columns
foreach (var c in this.RadTreeList1.AutoGeneratedColumns)
{
    if (c.UniqueName.Equals("DataKey") || c.UniqueName.Equals("ParentDataKey"))
    {
        c.Display = false;
    }
}

This works correctly.

Third step (the problem arrives):
The datatable, result of the stored procedure is saved in viewstate.
In the page_load method, on postback, the datatable is get from viewstate and the tree list is bind on it.

At this moment, I run the some code to hide the data key and parent data key columns, but it doesn't work.
I checked on debug, in page_load the display property is well set to false for the two columns (I also tried the visible property)
but the two columns are always visible.

Someone has an idea to hide those columns ?

Thanks by advance.

Regards,
Damien
















Damien
Top achievements
Rank 1
 answered on 12 Feb 2013
1 answer
242 views
Hai

     How can I hide the clientselect column in a certain row. i.e I want it hidden depending on the value of the column. How can I have it done. Please help me out.

thanx
RT
Shinu
Top achievements
Rank 2
 answered on 12 Feb 2013
1 answer
78 views
Hi
How can I get the datakeyvalue of the selected row on an external button click.

Savyo
Shinu
Top achievements
Rank 2
 answered on 12 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?