Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
228 views
Hi,

I pass the value of the value of the item selected from a radcombox to another. The first is radcombox Region and I have to pass the valure the selected region or typed, the second radcombo to load the list of provinces that refer to the region. Here is the code I use hand side aspx and vb net:

<telerik:RadComboBox ID="Regione" Runat="server" CollapseDelay="100"
    EnableLoadOnDemand="True" HighlightTemplatedItems="True" IsCaseSensitive="True"
    LoadingMessage="Caricamento..." DropDownWidth="160px" Filter="StartsWith" Width="160px"
    MaxHeight="175px" ShowMoreResultsBox="True" Height="175px" AutoPostBack="True">
</telerik:RadComboBox>
 
 
<telerik:RadComboBox ID="Provincia" Runat="server" CollapseDelay="100"
    DropDownWidth="170px" EnableLoadOnDemand="True" Filter="StartsWith"
    HighlightTemplatedItems="True" IsCaseSensitive="True"
    LoadingMessage="Caricamento..." MaxHeight="175px" ShowMoreResultsBox="True"
    Width="170px" Height="175px" EmptyMessage="Scegli la regione">
</telerik:RadComboBox>



    
Private Const ItemsRegion As Integer = 11
    Private Const ItemsProvincs As Integer = 10
    Private idregione As Integer = 0
Protected Sub Region_ItemsRequested(sender As Object, e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs) Handles Region.ItemsRequested
        Dim data As DataTable = GetDataRegion(e.Text)
        Dim itemOffset As Integer = e.NumberOfItems
        Dim endOffset As Integer = Math.Min(itemOffset + ItemsRegion, data.Rows.Count)
 
        e.EndOfItems = endOffset = data.Rows.Count
        For i As Integer = itemOffset To endOffset - 1
            Region.Items.Add(New RadComboBoxItem(data.Rows(i)("descrizione").ToString(), data.Rows(i)("id").ToString()))
        Next
        e.Message = GetStatusMessageRegion(endOffset, data.Rows.Count)
    End Sub
    Private Shared Function GetDataRegion(text As String) As DataTable
 
        Dim sqlSelectCommand As String = "SELECT [id], [descrizione] from [tab_regioni] WHERE [descrizione] LIKE @desc + '%' Order By [descrizione]"
 
        Dim adapter As New SqlDataAdapter(sqlSelectCommand, ConfigurationManager.ConnectionStrings("TrycontactString").ConnectionString)
        adapter.SelectCommand.Parameters.AddWithValue("@desc", text)
 
        Dim data As New DataTable()
 
        adapter.Fill(data)
 
        Return data
 
    End Function
 
    Private Shared Function GetStatusMessageRegion(offset As Integer, total As Integer) As String
 
        If total <= 0 Then
 
            Return "Regione non trovata"
 
        End If
 
        Return [String].Format("Lista: <b>1</b>-<b>{0}</b> di <b>{1}</b>", offset, total)
 
    End Function
 
    Protected Sub Provincs_ItemsRequested(sender As Object, e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs) Handles Provincs.ItemsRequested
        Dim data As DataTable = GetDataProvincs(e.Text, idregione)
        Dim itemOffset As Integer = e.NumberOfItems
        Dim endOffset As Integer = Math.Min(itemOffset + ItemsProvincs, data.Rows.Count)
 
        e.EndOfItems = endOffset = data.Rows.Count
        For i As Integer = itemOffset To endOffset - 1
            Provincs.Items.Add(New RadComboBoxItem(data.Rows(i)("descrizione").ToString(), data.Rows(i)("id").ToString()))
        Next
        e.Message = GetStatusMessageProvincs(endOffset, data.Rows.Count)
    End Sub
    Private Shared Function GetDataProvincs(text As String, id As Int32) As DataTable
 
        Dim sqlSelectCommand As String = "SELECT [id], [idregione], [descrizione] from [tab_province] WHERE [idregione]=@idregione and [descrizione] LIKE @desc + '%' Order By [descrizione]"
 
        Dim adapter As New SqlDataAdapter(sqlSelectCommand, ConfigurationManager.ConnectionStrings("TrycontactString").ConnectionString)
        adapter.SelectCommand.Parameters.AddWithValue("@desc", text)
        adapter.SelectCommand.Parameters.AddWithValue("@idregione", id)
        Dim data As New DataTable()
 
        adapter.Fill(data)
 
        Return data
 
    End Function
 
    Private Shared Function GetStatusMessageProvincs(offset As Integer, total As Integer) As String
 
        If total <= 0 Then
 
            Return "Provincia non trovata"
 
        End If
 
        Return [String].Format("Lista: <b>1</b>-<b>{0}</b> di <b>{1}</b>", offset, total)
 
    End Function

bye
Nencho
Telerik team
 answered on 22 Nov 2012
1 answer
250 views
Hi,

I have a RadMenu context menu on my page. Items are added to it and removed from it client side. The problem is the items are not the same width. Some items can be very long in which case they extend past the right boundary of the context menu. Shorter items don't extend to the width of the context menu.

I thought I could use the ClientShowing method to loop through the items currently in the menu, determine the width of the longest one, then set the width of all the other items to this value. However I can't get the width of any of the items in the menu. The width and offsetwidth properties of each item (and it's linkelement, text element etc) are always 0.

How do I get the actual value of these?

Thanks,

Matt
Kate
Telerik team
 answered on 22 Nov 2012
2 answers
136 views
Hi Guys,

Our users may upload a .shp file. To process these type of file you need 3 in total. The 2 other files have the same name but different extensions. I want the user to load the main file (.myFile.shp) and for telerik uploader to go and get the 2 other files dynamically (so long as they are in the same folder on the clients machine)

Does any one know how i can add to the list of files to be uploaded 'on the fly'

Thanks

Harvo
Harvo
Top achievements
Rank 1
 answered on 22 Nov 2012
1 answer
138 views
Hi,
I have a radmaskedtextbox that is intended for gender-input. the desired mask should accept only one of the following inputs: "m", "f", "M", "F", or "" (the empty ("") is obviously necessary to wait for the user to input the gender)

That's it, I can't discover the mask that should provided in the mask property.

Thank you for your help.
Kostadin
Telerik team
 answered on 22 Nov 2012
1 answer
116 views
how search  Menu items 
Princy
Top achievements
Rank 2
 answered on 22 Nov 2012
1 answer
123 views
HI,

I am using multiple telerik rad menu controls in the web application. When the top menu is expanded with the drop down sub menus, some of the menu items are blocked by the current page's rad menu bar. The image below is showing the issue.  Please help me in fixing this.



Thank you,

Srilal Fonseka
Shinu
Top achievements
Rank 2
 answered on 22 Nov 2012
4 answers
198 views
I am using the following sample codes to add a new dock to middle zone successfully. The issue is everytime the new dock is always added at the buttom of the middle zone.

Is there a way to add the new dock at the top of middle zone?

------------------
ScriptManager.RegisterStartupScript(
                    theDock,
                    this.GetType(),
                    "AddDock",
                    string.Format(@"function _addDock() {{
                        Sys.Application.remove_load(_addDock);
                        $find('{1}').dock($find('{0}'));
                        $find('{0}').doPostBack('DockPositionChanged');
                        }};
                        Sys.Application.add_load(_addDock);",
                        theDock.ClientID,
                        this.MiddleCustomZone.ClientID),
                        true);
                
                CreateSaveStateTrigger(theDock);
-----------------

thanks,
Slav
Telerik team
 answered on 22 Nov 2012
2 answers
131 views
Hi,

Hi friend this shanker .Am doing one project  by using telirik controls .It,s fine But my requirement is sms application.I don't know of about that .Please  help me of that requirement  how to do that i think it,s need to web services. how to do that and any sample any solutions pleaser send me p[lease help me it's argent , i complete in  3 days only please help me friends

thanks and regards
shanker.B
Anton
Top achievements
Rank 1
 answered on 22 Nov 2012
1 answer
89 views

Hi,

I have done sample project on radgrid with commanditemtemplate , but I cannot export to excel when i am click on button.

I applied Ajaxmanager ,radscript manager and ajaxpanel to grid.

please find the project below here.
Project .. Click Here

It is redirecting into same page without commanditemtemplate once clicked.
how can i redirect into add/edit pages once clicked on add /edit buttons in the grid.

please help me on this.

Andrey
Telerik team
 answered on 22 Nov 2012
7 answers
502 views
How do I change the Expand Icon to (+) sign and Collapse Icon to (-) sign  for the RadGrid Heirarchy.
Nicolaï
Top achievements
Rank 2
 answered on 22 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?