Telerik Forums
UI for ASP.NET AJAX Forum
15 answers
245 views
hi guys,

ì wrote this web service code:
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
<WebMethod()> _
Public Function Search(ByVal _Str1 As String, ByVal _Str2 As String) As List(Of PropertyUtente)
Using scope As New TransactionScope()
Dim lista As New List(Of PropertyUtente)
Dim conString = ConfigurationManager.ConnectionStrings("TrycontactString")
Dim strConnString As String = conString.ConnectionString
Using db As New SqlConnection(strConnString)
db.Open()
Using sqlcmd As New SqlCommand("Sp_searching_like", db)
sqlcmd.CommandType = CommandType.StoredProcedure
sqlcmd.Parameters.AddWithValue("@Search", SqlDbType.VarChar).Value = _Str1
sqlcmd.Parameters.AddWithValue("@Searchluogo", SqlDbType.VarChar).Value = _Str2
Using sqldr As SqlDataReader = sqlcmd.ExecuteReader
While sqldr.Read
Dim _image As String
If sqldr.GetSqlString(6).IsNull = True Then
_image = "/image/avatarborder.png"
Else
_image = sqldr.GetSqlString(6).Value
End If
Dim recapiti As String = ""
If (sqldr.GetSqlValue(4).IsNull = True Or sqldr.GetSqlValue(4).ToString = String.Empty) And (sqldr.GetSqlValue(5).IsNull = True Or sqldr.GetSqlValue(5).ToString = String.Empty) Then
recapiti = "Non disponile"
ElseIf sqldr.GetSqlValue(4).IsNull = False And (sqldr.GetSqlValue(5).IsNull = True Or sqldr.GetSqlValue(5).ToString = String.Empty) Then
recapiti = sqldr.GetSqlValue(4).Value
ElseIf (sqldr.GetSqlValue(4).IsNull = True Or sqldr.GetSqlValue(4).ToString = String.Empty) And (sqldr.GetSqlValue(5).IsNull = False) Then
recapiti = sqldr.GetSqlValue(5).Value
ElseIf sqldr.GetSqlValue(4).IsNull = False And sqldr.GetSqlValue(5).IsNull = False Then
recapiti = sqldr.GetSqlValue(4).Value & " - " & sqldr.GetSqlValue(5).Value
End If
lista.Add(New PropertyUtente With {.idutente = sqldr.GetSqlInt32(0).Value, _
.utente = sqldr.GetSqlString(1).Value, _
.Desccategoria = sqldr.GetSqlString(2).Value, _
.Desccomune = sqldr.GetSqlString(3).Value, _
.Telefono = recapiti, _
.Imageprofile = _image, _
.Email = sqldr.GetSqlString(7).Value})
End While
End Using
End Using
End Using
Return lista
scope.Complete()
End Using
End Function
End Class

and this is radlistview html code:

<telerik:RadListView ID="RadListView1" runat="server" DataKeyNames="idutente"
                           ItemPlaceholderID="Contenitore" AllowPaging="True"
                           Width="650px">
                               <LayoutTemplate>
                                   <fieldset style="width: 700px; border:0px" id="FieldSet1">
                                       <legend></legend>
                                       <asp:Panel ID="Contenitore" runat="server">
                                       </asp:Panel>
                                       <telerik:RadDataPager ID="RadDataPager1" runat="server"
                                           PagedControlID="RadListView1" Width="700px" Culture="it-IT" BackColor ="#ecede5">
                                               <Fields>
                                                   <telerik:RadDataPagerButtonField FieldType="FirstPrev"></telerik:RadDataPagerButtonField>
                                                   <telerik:RadDataPagerButtonField FieldType="Numeric"></telerik:RadDataPagerButtonField>
                                                   <telerik:RadDataPagerButtonField FieldType="NextLast"></telerik:RadDataPagerButtonField>
                                               </Fields>
                                       </telerik:RadDataPager>
                                   </fieldset>
                               </LayoutTemplate>
                               <ItemTemplate>
                                   <div class="item">
                                       <div class="image">
                                           <asp:Image ID="Image1" runat="server" ImageUrl='<%# CType(Container.DataItem, PropertyUtente).imageprofile%>' Height="120px" Width="110px"/>
                                       </div>
                                   <div class="content">
                                       <div class="user">
                                           <div style="width:16px; height:16px; float:left; padding-right:3px">
                                               <img src="/image/icone/user1.png" alt="NP" />
                                           </div>
                                           <b><%# CType(Container.DataItem, PropertyUtente).utente%></b>
                                       </div>
                                       <div class="description_category">
                                           <div style="width:16px; height:16px; float:left; padding-right:3px">
                                               <img src="/image/icone/categoria.png" alt="NP" />
                                           </div> Categoria: <%# CType(Container.DataItem, PropertyUtente).Desccategoria%>
                                       </div>
                                       <div class="description_city">
                                           <div style="width:16px; height:16px; float:left; padding-right:3px">
                                               <img src="/image/icone/home.png" alt="NP" />
                                           </div> Città: <%# CType(Container.DataItem, PropertyUtente).Desccomune%></div>
                                       <div class="description_email">
                                           <div style="width:16px; height:16px; float:left; padding-right:3px">
                                               <img src="/image/icone/email.png" alt="NP" />
                                           </div> Email: <%# CType(Container.DataItem, PropertyUtente).Email%>
                                       </div>                                             
                                       <div class="description_phone">
                                           <div style="width:16px; height:16px; float:left; padding-right:3px">
                                               <img src="/image/icone/telefono.png" alt="NP" />
                                           </div>Telefono: <%# CType(Container.DataItem, PropertyUtente).Telefono%></div>                                   
                                       <div class="item_button">
                                           <telerik:RadButton ID="RadButton1" runat="server" Text="Biglietto completo" Width="140px" Skin="Office2010Silver"
                                           OnClick="RadButton1_Click">
                                           </telerik:RadButton>
                                       </div>                                                                              
                                   </div>
                                   </div>
                               </ItemTemplate>
                       </telerik:RadListView>


this code is possible send it to source radlistview?

Marin
Telerik team
 answered on 23 Dec 2016
1 answer
154 views

Hi, I want to use the media player to play continuously a short video, like this site https://unity3d.com/

So the video is in the background and I can place other Telrik components in front of it. Does the MediaPlayer is suited for this?

 

regards

Bozhidar
Telerik team
 answered on 23 Dec 2016
4 answers
418 views

Hi there,

just got reported by our user that the RadComboBox is somehow not working correctly. Here are the steps:

01. type a for search, and there will be items listed => select one of them => eveything seems ok and works fine.

02. click the ComboBox, all text are automatically selected => works as expected

03. start to type something, e.g. b => now weird thing happens, a list of items are expected to shown, but it stucks at loading, if you look at the client requests in your browser debugging tool, you will notice that the client keeps sending requests to the server side with weird search string from the previous select. ==> a BUG? or did I make anything wrong.

This is a Production Issue, hope you guys can guide me out how to fix it.

PS. i tried to upload a small demo application to reproduce the error, but i don't how to upload it, seems I cannot upload a zip file!


Regards

Z. Wang

Anton
Telerik team
 answered on 23 Dec 2016
2 answers
213 views

We currently output our data to a Grid and then export to XLSX, however we are experiencing a unique problem with one of the records.  The record in question returns the word "Infinity" and it causes a problem with opening the Excel document.  We receive the following error message:

"Excel found unreadable content in '....aspx'.  Do you want to recover the contents of this workbook?  If you trust the source of this workbook, click Yes."

Clicking Yes will repair the worksheet.  

After doing much testing to narrow down what record it is failing on, we have concluded it is failing on this record with the word "Infinity".  If I change the database record to "Infinity CU", there is no problems and the Excel file will open properly.  If I save the Excel document after all these messages, it will save properly and once reopened it will be successful.  CUName is the field that it fails on. 

I am including the code that displays the grid but might you offer a suggestion on how to remedy this problem?

<telerik:RadGrid ID="_grdInvisibleGridForExcel" runat="server" Visible="false" HeaderStyle-Font-Bold="true" HeaderStyle-BackColor="#4F9A25" HeaderStyle-ForeColor="White"  CellSpacing="-1" GridLines="Both" GroupPanelPosition="Top" AutoGenerateColumns="false" ExportSettings-Excel-Format="ExcelML">
            <MasterTableView>
                <Columns>
                    <telerik:GridDateTimeColumn DataField="Financial Date" HeaderText="Financial Date" UniqueName="FinancialDate" FilterControlAltText="Filter FinancialDate column"></telerik:GridDateTimeColumn>
                    <telerik:GridBoundColumn DataField="charter_Num" HeaderText="Charter #" UniqueName="CharterNum" FilterControlAltText="Filter CharterNum column"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="asi_Num" HeaderText="ASI #" UniqueName="AsiNum" FilterControlAltText="Filter AsiNum column"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="cuName" HeaderText="CU Name" UniqueName="cuName" FilterControlAltText="Filter cuName column"></telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>

 

 

Kurt Kluth
Top achievements
Rank 1
 answered on 23 Dec 2016
1 answer
196 views

I have a dropdown the controls the visibility of some controls including a RadExplorer. This is all in a BootStrap form where the form-group visibility is changed.  If I start with the RadExplorer invisible, the toolbar and windows are not formed properly. Resizing the browser window fixes it though all visibility changes until the next refresh. If I start out with the RadExplorer visible and make it invisible on loading the toolbar is fine but the windows are not correct, please see the attached picture.  I need to be able to make the RadExplorer invisible at page load.

The function BackgroupSettingChanged(); changes the visiblity of controls.

Sys.Application.add_load(function loadHandler() {
    BackgroupSettingChanged();
    Sys.Application.remove_load(loadHandler);
});

BackgroupSettingChanged(); calls ObjVisible() to change the visibility of the different div's.

function ObjVisible(control, visible)
{
    if (visible) {
        control.style.visibility = 'visible'
        control.style.display = "block";
    }
    else {
        control.style.visibility = 'hidden';
        control.style.display = "none";
    }
}

The RadExplorer is in a form-group

<div class="form-group" id="ExplorerDiv" runat="server" >
    <asp:Label runat="server" AssociatedControlID="SelectImage" CssClass="col-md-2 control-label">Explorer</asp:Label>
    <div class="col-md-4" >
        <span >Use the file explorer to choose an image, you can download an image.</span>
        <telerik:RadFileExplorer RenderMode="Lightweight" runat="server" ID="FileExplorer1" Width="580px" Height="300px"  EnableCreateNewFolder="true"
            VisibleControls="Grid,TreeView,ContextMenus,Toolbar,FileList"
            AllowPaging="true" PageSize="8" OnClientItemSelected="OnClientItemSelected">
            <Configuration  EnableAsyncUpload="true"  AllowMultipleSelection="true"
                ViewPaths = "~/Organizations/Org3"
                UploadPaths = "~/Organizations/Org3"
                DeletePaths = "~/Organizations/Org3"></Configuration>
        </telerik:RadFileExplorer>
    </div>
</div>

 

Is there something I can call on the RadExplorer when I make it visible to ensure it initializes properly?  or maybe my initial call to add_load to make it invisible could be made on another startup event?

It is actually the 

control.style.display = "none";

that causes the problem. Without "none", the file list window of the RadExplorer shows even though the RadExplorer div is visibility='hidden'.  The is needed to get rid of the space taken by the controls.  I also have a RadColorPicker that works fine if it does not start out invisible (with set, forced to accept this with its accompanying disappearing flash as the window opens).

George

Vessy
Telerik team
 answered on 23 Dec 2016
6 answers
77 views

Erro;

Uncaught TypeError: Cannot read property 'clear' of null

 

code:

$find("<%=radnumericbox.ClientID%>").clear();

 

what im doing badly? i have more radnuemirc boxes and they are running smoothly

 

BestRegards

 

Vasil
Telerik team
 answered on 23 Dec 2016
6 answers
271 views

Hello,

How can I turn off the highlighting on specific nodes in a radTreeView?  There are specific nodes that I don't want to change in any way when hovering over them.

I'm using UI for ASP.NET AJAX, V2013.1.417.45

Thank you.

Ivan Danchev
Telerik team
 answered on 23 Dec 2016
5 answers
396 views
I am using the below radtextbox and the onkeyup is not working for it. Below is the code:
<td align="left" style="Width:80px; padding-bottom:10px;"><telerik:RadTextBox ID="SphereRightText" runat="server" width="50" OnKeyUp="doRightSphereValidation();" onchange="FormatRightSphere(2, true);" /></td>
function doRightSphereValidation()
    {
        if (IsRightLensItemSelected())
        {
            var textBox = $find("<%=SphereRightText.ClientID %>");
            return validation_ValidateNumericTextBox(textBox, RightSphereMinimum, RightSphereMaximum, false, TurnInvalidInputsRed());
        }
        else
        {
            return true;
        }
    }
Vasil
Telerik team
 answered on 23 Dec 2016
1 answer
332 views

Hello, I am looking for support with the radwindowmanager and the autosize and autosize behavior properties...I've been trying to implement the same scenario as these two links:
- http://docs.telerik.com/devtools/aspnet-ajax/controls/window/troubleshooting/autosizing-issues

-http://demos.telerik.com/aspnet-ajax/window/examples/autosize/defaultcs.aspx

no luck... I always need to have a width and a height coming from the codebehind, else it only displays a small square. I am not sure if this is cause by the way the app is programmed...anyway hope somebody can jump in and help out. Thanks...here is the code driving the window: 

starts here:
gui.OpenRadWindow(
                            url: "/Pages/Inventory/Add_Product.aspx", 
                            width: 800, 
                            height: 550, 
                            title: "Add Product", 
                            modal: true, 
                            javascriptOnClientClose: "OnClientClose", 
                            page: Page
                        );

goes to here:

 

public void OpenRadWindow(string url, int width, int height, string title, bool modal, WindowBehaviors behaviors, bool showDuringLoad, string javascriptOnClientClose, Page page)
        {
            RadWindowManager winMgr = null;

            winMgr = (RadWindowManager)page.Master.FindControl("RadWindowManager_Global");

            if (winMgr != null)
            {
                RadWindow radWindowForm = new RadWindow();
                radWindowForm.ID = "radWindowForm_" + Guid.NewGuid().ToString();
                radWindowForm.MinWidth = new System.Web.UI.WebControls.Unit(width,System.Web.UI.WebControls.UnitType.Pixel);
                radWindowForm.MinHeight = new System.Web.UI.WebControls.Unit(height, System.Web.UI.WebControls.UnitType.Pixel);
                radWindowForm.AutoSize = true;
                radWindowForm.AutoSizeBehaviors = WindowAutoSizeBehaviors.Default;
                radWindowForm.Title = title;
                radWindowForm.Modal = modal;
                radWindowForm.NavigateUrl = url;
                radWindowForm.Behaviors = behaviors; 
                radWindowForm.EnableShadow = true;
                radWindowForm.EnableTheming = true;
                radWindowForm.KeepInScreenBounds = true;
                radWindowForm.ShowContentDuringLoad = showDuringLoad;
                radWindowForm.VisibleStatusbar = false;
                radWindowForm.VisibleOnPageLoad = true;
                radWindowForm.OnClientClose = javascriptOnClientClose;
                winMgr.EnableViewState = false;
                winMgr.Windows.Add(radWindowForm);                
            }
        }

this is the control in master page:

 

<telerik:RadWindowManager ID="RadWindowManager_Global" runat="server" AutoSize="true" AutoSizeBehaviors="Default" Style="z-index: 7001" />

thanks for the support. I will add additional info if needed.

Ianko
Telerik team
 answered on 23 Dec 2016
2 answers
135 views

I am setting a default recurrence rule in the FormCreated event when opening an advanced insert form as described at http://docs.telerik.com/devtools/aspnet-ajax/controls/scheduler/recurrence-editor/server-side-programming/populating-the-recurrence-rule

 

When the Save button is clicked, I am attempting to read the recurrence rule from e.Appointment.RecurrenceRule. This always returns the default rule that I set in FormCreated, even if the user altered the recurrence settings in the form before clicking Save. If I do not set the recurrence rule in FormCreated, this returns the settings that the user chose as expected.

 

Is there any way to set the default recurrence settings that are shown when the form is opened and still access the user's chosen settings in the AppointmentInsert event?

Veselin Tsvetanov
Telerik team
 answered on 23 Dec 2016
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
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
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?