Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
209 views
I am working with radautocompletebox to fetch email addresses for a user from sharepoint userprofile. 
i have a webservice method created that returns the matching email address. 
the first time it works and when i search again for another user or same user whenever i type anything in the box it throws the erro called object refrence not set to an instance of object. but if i reload the page again then it works. 

here is the code for my webservices and the rad autocompletebox. 
//error i am getting at the browser when i type anything second time in the radautocompletebox...
 
 
SCRIPT5022: Sys.InvalidOperationException: Type Telerik.Web.UI.AttributeCollection has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.
ScriptResource.axd?d=QJ81aqhAwulu2hIOFMDEkrm2EPI_p5Rwn1qI6uFkGM6jPgRdNCdVCW-Ayu0H8f67BVUhz1dDf0p53SEzAsTbe86n4C8no9dnNoDIOecQwHTcrKnohckOhEi-82CZIS9S59Q-OnLMc6Zo--sMwRT5nIG_jACybbgI7netGoKwKlFGkZtn0&t=ffffffffb868b5f4, line 1717 character 42
 
SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited.
 
  
 
  
 
//web service method that returns the selected email address of the input typed in the radautcompletebox
[WebMethod]
 
public  AutoCompleteBoxData FilterEmailaddress(RadAutoCompleteContext context)
 
        {
 
            string prefixText = context.Text.ToString();      
 
           
 
            List<AutoCompleteBoxItemData> result = new List<AutoCompleteBoxItemData>();
 
            AutoCompleteBoxData dropdowndata = new AutoCompleteBoxData();
 
            List<String> existingemailadd = UserEmailAddress();
 
            var q = from string s in existingemailadd
 
                    where s.ToLower().StartsWith(prefixText.ToLower().Trim())
 
                    select s;
 
            foreach (string s in q)
 
            {
 
                AutoCompleteBoxItemData itemdata = new AutoCompleteBoxItemData();
 
                itemdata.Text = s;
 
                itemdata.Value = s;
 
                result.Add(itemdata);
 
  
 
            }
 
  
 
            if (result.Count > 0)
 
            {
 
                dropdowndata.Items = result.ToArray();
 
            }
 
  
 
            return dropdowndata;
 
        }
 
  
 
//list returing the emailaddresses for all users from the userprofile
 
        private  List<String> UserEmailAddress()
 
        {
 
            List<String> emailaddress = new List<string>();
 
            HttpContext context = System.Web.HttpContext.Current;
 
            string protocol = context.Request.ServerVariables["HTTPS"].ToString().Equals("ON", StringComparison.CurrentCultureIgnoreCase) ? "https" : "http";
 
            string port = context.Request.ServerVariables["SERVER_PORT"].ToString();
 
            string server = context.Request.ServerVariables["Server_Name"].ToString();
 
            string address = string.Format("{0}://{1}:{2}", protocol, server, port);
 
            SPSecurity.RunWithElevatedPrivileges(delegate
 
                {
 
                    using (SPSite site = new SPSite(address))
 
                    {
 
                        try
 
                        {
 
                            SPServiceContext servicecontext = SPServiceContext.GetContext(site);
 
                            UserProfileManager userProfileManager = new UserProfileManager(servicecontext);
 
                            foreach (UserProfile user in userProfileManager)
 
                            {
 
                                string emailadd = (string)user["WorkEmail"].Value;
 
                                emailaddress.Add(emailadd);
 
  
 
  
 
                            }
 
  
 
                        }
 
                        catch (Exception ex)
 
                        {
 
                            
  
 
  
 
                        }
 
                    }
 
                });
 
  
 
            return emailaddress;
 
  
 
  
 
        }
 
  
 
  
// Radautocompletebox in aspx
 
<telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" AllowCustomEntry="true"
 
                    DropDownHeight="150px" DropDownWidth="250px" runat="server" InputType="Text"
 
                    Filter="Contains">
 
                    <TextSettings SelectionMode="Single" />
 
                    <WebServiceSettings Path="/_layouts/WebServices/emailService.asmx"
 
                        Method="FilterEmailaddress" />
 
                </telerik:RadAutoCompleteBox>
Uttam Dhakal
Top achievements
Rank 1
 asked on 16 May 2013
5 answers
188 views
http://itweb.ca/JobSeeker/CreateNewUser.aspx

In google chrome the combobox works and in ie it does not.

Is this a bug?
Dimitar Terziev
Telerik team
 answered on 16 May 2013
1 answer
408 views
I have a load on demand RadTreeView displaying perfectly in my project, however only the root node and the root node's child nodes react to being selected; as in RadTreeView.GetSelectedCount returns 0 when a node is selected that is a child of a root node child node, and RadTreeView.SelectedNodes[0] throws an out of range exception in the same scenario.

Any ideas?

Thanks,
Matt
Boyan Dimitrov
Telerik team
 answered on 16 May 2013
3 answers
83 views
I have this set to true however on the advanced form it still only shows time from 8am - 5:30pm.
Brian
Top achievements
Rank 1
 answered on 16 May 2013
5 answers
150 views
Test environment:
Telerik.Web.Design version 2011.1.413.35
Platform: Windows Server 2003 SP2, Internet Explorer 7.0 (7.0.5730.13)
Silverlight on client: version 5.1.10411.0

Inside our web application, we're using the RadAsynUpload control to show the red/green color solid dot to indicate success/failure of loading of client file(s). The following javacript has been added to disable flash and use the Silverlight

<script type="text/javascript">

//Disable usage of flash in favor of Silverlight.

Telerik.Web.UI.RadAsyncUpload.Modules.Flash.isAvailable =

 

function () { return false; };

</script>


The issue we're having is the control behavior is correct on my local machine (IE 9.0). But in the VM environment (pseudo production) as described earlier, the red dot is displayed even if the client file loaded is a small and not opened anywhere else.
The same file if I try to open in my local machine, the green dot is displayed indicating success.
Here's the additional relevent code snippet:

<telerik:RadAsyncUpload ID="RawFileRadAsyncUpload" runat="server"
                MultipleFileSelection="Automatic" Skin="Windows7" OnClientFileUploadFailed="OnClientFileUploadFailed">
                <Localization Select="Browse..." />
            </telerik:RadAsyncUpload>


Javascript:
 function OnClientFileUploadFailed(sender, args) {
                    document.getElementById('<%=ErrorLabel.ClientID %>').innerHTML = args.get_message();
                    args.set_handled(true);
                }
Please advise, if we're missing anything. Thanks!

Hristo Valyavicharski
Telerik team
 answered on 16 May 2013
2 answers
296 views
I am updated my project to utilize the RadAsynchUpload control and cannot get the FileUploaded event to fire. I am using the control in two places, one just a page with an upload button and the other inside of a RadGrid. Everything is working fine in the RadGrid. I am able to select the file and then click the update button, where it is firing off the FileUploaded event. For some reason, this is not working in the standalone sense. I can't seem to understand what I'm missing.

<telerik:RadAsyncUpload ID="radAsyncUpload" runat="server" EnableInlineProgress="true" MaxFileInputsCount="1" OnClientFileUploaded="onClientFileUploaded" OnClientFileUploadRemoved="onClientFileUploadRemoved" PostbackTriggers="radUpload" />
 
<telerik:RadButton ID="radUpload" runat="server" Text="Upload" Enabled="false" CausesValidation="false" />
 
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
      <script type="text/javascript">
          function onClientFileUploaded(sender, args) {
              var radUpload = $find("<%=radUpload.ClientID %>");
 
              radUpload.set_enabled(true);
          }
          function onClientFileUploadRemoved(sender, args) {
              var radUpload = $find("<%=radUpload.ClientID %>");
 
              radUpload.set_enabled(false);
          }
      </script>
 </telerik:RadScriptBlock>
Plamen
Telerik team
 answered on 16 May 2013
2 answers
147 views
Hi

Is there any posibility that user confirm his action before onclick method start
somethin like this

<telerik:RadButton ID="btnEdit" runat="server" OnClientClicked="ConfirmEdit" OnClick="btnEdit_Click"></telerik:RadButton>

So, I would like that in JS user confirm his action in ConfirmEdit method and after that if he clicked on 'OK' to call btnEdit_Click method on server side

Petar
Top achievements
Rank 1
 answered on 16 May 2013
1 answer
101 views
Hi,

Is it possible to invert a Radbutton? If possible, someone please help with a solution

Thanks,
Merlin
Princy
Top achievements
Rank 2
 answered on 16 May 2013
3 answers
643 views
I am using one of the provided sample page for RADGrid.

ASPX:
<%@ Page Language="VB" MasterPageFile="~/MasterPage.Master" AutoEventWireup="false"
    CodeBehind="Tenders.aspx.vb" Inherits="WebUI.Tenders" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="Server">
    <form id="mainForm" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <!-- content start -->
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            <!--
            function RowDblClick(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }
            function gridCreated(sender, args) {
                if (sender.get_editIndexes && sender.get_editIndexes().length > 0) {
                    document.getElementById("OutPut").innerHTML = sender.get_editIndexes().join();
                }
                else {
                    document.getElementById("OutPut").innerHTML = "";
                }
            }
            -->
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgdTenders">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgdTenders" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadGrid ID="rgdTenders" GridLines="None" runat="server" AllowPaging="True"
        OnNeedDataSource="rgdTenders_NeedDataSource" AutoGenerateColumns="False" CellSpacing="0"
        OnUpdateCommand="rgdTenders_UpdateCommand" OnInsertCommand="rgdTenders_InsertCommand"
        OnDeleteCommand="rgdTenders_DeleteCommand" AllowSorting="true" AllowMultiRowSelection="false">
        <ClientSettings Selecting-AllowRowSelect="true" />
        <PagerStyle Mode="NextPrevAndNumeric" />
        <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="TenderID"
            HorizontalAlign="NotSet" AutoGenerateColumns="False" CommandItemSettings-AddNewRecordText="Add New Tender"
            RetrieveDataTypeFromFirstItem="true">
            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                    <ItemStyle CssClass="MyImageButton" Width="20px" />
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn DataField="Nr" HeaderText="Tender Nr." SortExpression="Nr"
                    UniqueName="Nr" ColumnEditorID="GridTextBoxColumnEditor1" ItemStyle-Width="150px">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn ConfirmText="Delete this Tender?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="DeleteColumn">
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" Width="20px" />
                </telerik:GridButtonColumn>
            </Columns>
            <EditFormSettings ColumnNumber="2" CaptionDataField="Nr" CaptionFormatString="Edit properties of Tender {0}"
                InsertCaption="New Tender">
                <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                    Width="100%" />
                <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record"
                    UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                </EditColumn>
                <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
            </EditFormSettings>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents OnRowDblClick="RowDblClick" OnGridCreated="gridCreated" />
        </ClientSettings>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
    </telerik:RadGrid>
    <!-- End of Main Grid Control -->
    <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="200px" />
    <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor2" runat="server" TextBoxStyle-Width="400px"
        TextBoxMode="MultiLine" TextBoxStyle-Height="150">
    </telerik:GridTextBoxColumnEditor>
    <telerik:GridDateTimeColumnEditor ID="GridDateTimeColumnEditor1" runat="server" TextBoxStyle-Width="200px" />
    <br />
    <br />
    <telerik:RadTabStrip runat="server" ID="RadTabStrip1" MultiPageID="RadMultiPage1"
        SelectedIndex="0">
        <Tabs>
            <telerik:RadTab runat="server" Text="Sales" PageViewID="PageView1" />
            <telerik:RadTab runat="server" Text="Contact Information" PageViewID="PageView2" />
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" RenderSelectedPageOnly="false">
        <telerik:RadPageView runat="server" ID="PageView1">
            <div>
                PageView 1</div>
        </telerik:RadPageView>
        <telerik:RadPageView runat="server" ID="PageView2" Width="460px" BorderColor="Black"
            BorderWidth="1px">
            <div>
                PageView 2</div>
        </telerik:RadPageView>
    </telerik:RadMultiPage>
    <br />
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
    </form>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Footer" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="AfterBody" runat="Server">
</asp:Content>


Code:
Imports Telerik.Web.UI
Imports BAL
Imports DAL.EntityClasses
 
Partial Class Tenders
    Inherits System.Web.UI.Page
 
    Public Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        If Not IsPostBack Then
             
        End If
    End Sub
 
    Public Sub rgdTenders_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgdTenders.NeedDataSource
        Dim etcTenders As New DBRealated
        rgdTenders.DataSource = etcTenders.GetTenders(Nothing)
    End Sub
 
    Protected Sub rgdTenders_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgdTenders.InsertCommand
        'Get the GridEditFormInsertItem of the RadGrid
        Dim insertedItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem)
 
        'Access the textbox from the edit form template and store the values in string variables.
        Dim Nr As String = (TryCast(insertedItem("Nr").Controls(0), TextBox)).Text
 
        Try
            Dim etTender As New TenderEntity
            etTender.Nr = Nr
 
            Dim obj As New DBRealated
            obj.SaveTender(etTender, False)
 
            SetMessage("New Tender """ & Nr & """ has been created!", True)
        Catch ex As Exception
            SetMessage("Tender with Nr """ & Nr & """ could not be created!", False)
            e.Canceled = True
        End Try
    End Sub
 
    Public Sub rgdTenders_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgdTenders.DeleteCommand
        'Get the GridDataItem of the RadGrid
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
 
        'Get the primary key value using the DataKeyValue.
        Dim TenderID As Integer = CInt(item.OwnerTableView.DataKeyValues(item.ItemIndex)("TenderID"))
 
        Try
            Dim obj As New DBRealated
            obj.DeleteTender(TenderID)
 
            SetMessage("Tender has been deleted!", True)
 
        Catch ex As Exception
            SetMessage("Tender could not be deleted!", False)
            e.Canceled = True
        End Try
 
    End Sub
 
    Public Sub rgdTenders_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgdTenders.UpdateCommand
        'Get the GridEditableItem of the RadGrid
        Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
 
        'Get the primary key value using the DataKeyValue.
        Dim TenderID As Integer = CInt(editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("TenderID"))
 
        'Access the textbox from the edit form template and store the values in string variables.
        Dim Nr As String = (TryCast(editedItem("Nr").Controls(0), TextBox)).Text
 
        Try
            Dim etTender As New TenderEntity
            etTender.TenderId = TenderID
            etTender.Nr = Nr
 
            Dim obj As New DBRealated
            obj.SaveTender(etTender, True)
 
            SetMessage("Tender with Nr """ & Nr & """ is updated!", True)
 
        Catch ex As Exception
            SetMessage("Tender with Nr """ & Nr & """ could not be updated!", False)
            e.Canceled = True
        End Try
 
    End Sub
 
    Private Sub SetMessage(ByVal message As String, ByVal bIsGood As Boolean)
        gridMessage = message
        GoodMessage = bIsGood
    End Sub
 
    Private gridMessage As String = Nothing
    Private GoodMessage As Boolean = True
    Protected Sub rgdTenders_DataBound(ByVal sender As Object, ByVal e As EventArgs) Handles rgdTenders.DataBound
        If Not String.IsNullOrEmpty(gridMessage) Then
            DisplayMessage(gridMessage, GoodMessage)
        End If
    End Sub
 
    Private Sub DisplayMessage(ByVal text As String, ByVal bIsGood As Boolean)
        If bIsGood Then
            rgdTenders.Controls.Add(New LiteralControl(String.Format("<span style='color:green'>{0}</span>", text)))
        Else
            rgdTenders.Controls.Add(New LiteralControl(String.Format("<span style='color:red'>{0}</span>", text)))
        End If
    End Sub
End Class

Everything thing related to the RADGrid is working fine, but RADTabStrip is not working as expected, when I select "Contact Information" which is 2nd tab page inside the RADTabStrip it is not actually selecting it and so the content of the 2nd Page "PageView 2" is also not showing.

what i am missing here? do i have to configure something in the update panel for RadTabStrip?

kindly write the code as i am new to Rad World.
Vipul
Top achievements
Rank 1
 answered on 16 May 2013
5 answers
373 views
Hello,

I'm using the Pie Chart but instead of showing the absolute values in the label, i wanted to show the series name in the label to not need a legend and keep my interface clean. This I could do easily by setting the clienttemplate of the labels. However, after rendering the labels are not displayed proper. They are clipped (see attachments).
It seems that the width of the svg element is actually larger then the width of the containing div that is generated despite them both being the width I set for the control (300px).

Is there anyway to make these labels fit in the container so they are not clipped?
I have limited width on my page because I show more pie charts in a row. 

Thanks
Danail Vasilev
Telerik team
 answered on 16 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?