Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
138 views
Hello
I have a radupload inside radgrid as an itemtemplate. The uploader is used to save icon image in database along with other details. The grid has a checkbox whose autopostback is set on for checking checkChanged event accordingly. I have used radajaxmanager so that the page doesnot post back. But i face a problem when i try to save the uploaded image icon using radtoolbarbutton. Uploaded file show 0 count when i try to save the same as the page post back and there is no file to save. I have also added a client side function for disabling ajax on its clientclick of radtoolbarbutton but it results in an error of "Object doesn't support property or method 'set_enableAjax'". Please help me in achieving the required target without any code compromises.
Thanks in advance.
Dimitar Terziev
Telerik team
 answered on 04 Jan 2012
3 answers
116 views
I get the following error when trying to insert a record ...Unable to cast object of type 'Telerik.Web.UI.GridCommandItem' to type 'Telerik.Web.UI.GridEditFormInsertItem'.  I have followed the examples, what am I missing here?
Private Sub grdLogins_DeleteCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles grdLogins.DeleteCommand
    Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
    Dim LoginID As Integer = CInt(item.OwnerTableView.DataKeyValues(item.ItemIndex)("LoginKey").ToString)
    gUserData.DeleteUserNTCredential(LoginID)
    grdLogins.Rebind()
End Sub
 
Private Sub grdLogins_InsertCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles grdLogins.InsertCommand
    Dim insertedItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem)
    Dim UserID As Integer = GetSelectedUser()
    Dim Login As String = (TryCast(insertedItem("NTLogin").Controls(0), TextBox)).Text
    gUserData.AddUserNTCredential(UserTree.SelectedValue, Login, GetEditorInfo)
    grdLogins.Rebind()
End Sub
 
Private Sub grdLogins_UpdateCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles grdLogins.UpdateCommand
    Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
    Dim LoginID As Integer = CInt(editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("LoginKey").ToString)
    Dim Login As String = (TryCast(editedItem("NTLogin").Controls(0), TextBox)).Text
    Dim UserID As Integer = CInt(GetSelectedUser())
    gUserData.UpdateUserNTCredential(UserID, LoginID, Login, GetEditorInfo)
    grdLogins.Rebind()
End Sub
 
Private Sub grdLogins_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles grdLogins.NeedDataSource
    Dim UserID As Integer
    If GetSelectedUser() Then
        UserID = GetSelectedUser()
    Else
        UserID = 0
    End If
    grdLogins.DataSource = gUserData.SelectUserNTCredentialsAll(UserID)
End Sub

<telerik:RadGrid ID="grdLogins" runat="server" Skin="Office2010Blue"
                     AutoGenerateColumns="False" CellSpacing="0" GridLines="None" AllowPaging="True"
                     PageSize="5">
                 <ClientSettings>
                     <Selecting AllowRowSelect="True" />
                 </ClientSettings>
                 <MasterTableView DataKeyNames="LoginID"
                     CommandItemDisplay="Top" EditMode="InPlace">
                     <NoRecordsTemplate>
                         No Records to display.
                     </NoRecordsTemplate>
                     <CommandItemSettings ExportToPdfText="Export to PDF" />
                     <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"
                         Visible="True">
                         <HeaderStyle Width="20px" />
                     </RowIndicatorColumn>
                     <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"
                         Visible="True">
                         <HeaderStyle Width="20px" />
                     </ExpandCollapseColumn>
                     <Columns>
                         <telerik:GridBoundColumn DataField="LoginID"
                             FilterControlAltText="Filter LoginID column" UniqueName="LoginID"
                             Visible="False" Display="False" ReadOnly="True">
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="NTLogin"
                             FilterControlAltText="Filter NTLogin column" HeaderText="NT Login"
                             UniqueName="NTLogin">
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="CreateDate" Display="False"
                             FilterControlAltText="Filter CreateDate column" HeaderText="Date Added"
                             UniqueName="CreateDate" Visible="False">
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="CreateBy"
                             FilterControlAltText="Filter CreateBy column" UniqueName="CreateBy"
                             Visible="False">
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="UpdateDate"
                             FilterControlAltText="Filter UpdateDate column" UniqueName="UpdateDate"
                             Visible="False">
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="UpdateBy"
                             FilterControlAltText="Filter UpdateBy column" UniqueName="UpdateBy"
                             Visible="False">
                         </telerik:GridBoundColumn>
                     </Columns>
                     <EditFormSettings>
                         <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                         </EditColumn>
                     </EditFormSettings>
                     <CommandItemTemplate>
                         <telerik:RadToolBar ID="RadToolBar1" Runat="server" Width="100%" Skin="Office2010Blue"
                         onbuttonclick="RadToolBar1_ButtonClick" EnableRoundedCorners="True">
                         <items>
             <telerik:RadToolBarButton runat="server" CommandName="InitInsert" ImageUrl="~/Images/add2.png"
                 Visible='<%# Not grdLogins.MasterTableView.IsItemInserted %>' Owner="RadToolBar1"
                 Text="Add New">
             </telerik:RadToolBarButton>
             <telerik:RadToolBarButton runat="server" CommandName="EditSelected" ImageUrl="~/Images/edit.png"
                 Owner="RadToolBar1" Text="Edit Selected" Visible='<%# grdLogins.EditIndexes.Count = 0 %>'>
             </telerik:RadToolBarButton>
             <telerik:RadToolBarButton runat="server" CommandName="UpdateEdited" ImageUrl="~/Images/check2.png"
                 Text="Update Edit" Visible='<%# grdLogins.EditIndexes.Count > 0 %>'>
             </telerik:RadToolBarButton>
             <telerik:RadToolBarButton runat="server" CommandName="CancelAll" ImageUrl="~/Images/undo.png"
                 Text="Cancel" Visible='<%# grdLogins.EditIndexes.Count > 0 or grdLogins.MasterTableView.IsItemInserted %>'>
             </telerik:RadToolBarButton>
             <telerik:RadToolBarButton runat="server" CommandName="PerformInsert" ImageUrl="~/Images/redo.png"
                 Text="Commit Insert" Visible='<%# grdLogins.MasterTableView.IsItemInserted%>'>
             </telerik:RadToolBarButton>
             <telerik:RadToolBarButton runat="server" CommandName="DeleteSelected" ImageUrl="~/Images/delete2.png"
                 Owner="RadToolBar1" Text="Delete Selected">
             </telerik:RadToolBarButton>
             <telerik:RadToolBarButton runat="server" IsSeparator="True" Text="Sep3">
             </telerik:RadToolBarButton>
             <telerik:RadToolBarButton runat="server" CommandName="RebindGrid" ImageUrl="~/Images/refresh.png"
                 Text="Refresh">
             </telerik:RadToolBarButton>
         </items>
                         </telerik:RadToolBar>
                         </CommandItemTemplate>
                 </MasterTableView>
                 <PagerStyle PageButtonCount="5" />
                 <FilterMenu EnableImageSprites="False">
                     <WebServiceSettings>
                         <ODataSettings InitialContainerName="">
                         </ODataSettings>
                     </WebServiceSettings>
                 </FilterMenu>
                 <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Office2010Blue">
                     <WebServiceSettings>
                         <ODataSettings InitialContainerName="">
                         </ODataSettings>
                     </WebServiceSettings>
                 </HeaderContextMenu>
                 </telerik:RadGrid>
Andrey
Telerik team
 answered on 04 Jan 2012
4 answers
184 views
Hi Admin,

I have asp.net page. In that one label\link is there. Once the link is clicked, a popup would appear. I want a radTreeView inside it, containing details from database.
My question is:- 'How to generate a RadTreeView inside a PopUp, when a link is clicked'

Please see the attached image, for the requirement.

Regards,
Sourav
Kevin
Top achievements
Rank 2
 answered on 04 Jan 2012
2 answers
95 views
Hello,
I have a simple RadComboBox that when an item is selected it redirects the page back to itself and is supposed to display the item that was selected in the RCB.  
This was working with Web.UI version 2010.3.1109.40, but it broke after upgrading to version 2011.3.1115.40.

With the latest version it will reload the page, but will display the "EmptyMessage" text instead of the selected text.

Here's my page:
<%@ Page Title="Home Page" Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb"
    Inherits="RadComboBoxBug._Default" %>
 
<!DOCTYPE HTML />
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
<html>
    <head id="Head1" runat="server">
        <title>RadComboBox Issues</title>
        <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <form id="Form1" runat="server">
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
            <div class="page">
                <div class="main">
                    <div style="margin: 10px; border: 1px solid #CCC; padding: 10px;">
                        <telerik:RadComboBox ID="RadComboBox2" runat="server" EnableLoadOnDemand="true" EmptyMessage="Select a Person"
                            AppendDataBoundItems="false" AutoPostBack="true" DataValueField="RecordID" DataTextField="Name"
                            ShowMoreResultsBox="true" EnableVirtualScrolling="false" MarkFirstMatch="true"
                            CausesValidation="False" OnClientDropDownOpening="onDropDownOpening" />
                        <asp:Label ID="lbl_SelectedPerson" runat="server" Style="margin-left: 15px" />
                    </div>                    
                </div>
            </div>
        </form>
    </body>
    <script type="text/javascript">
        function onDropDownOpening(sender) {
            var attributes = sender.get_attributes();
            if (attributes.getAttribute("DefaultItem") === "true") {
                sender.requestItems("", false);
                attributes.setAttribute("DefaultItem", "false");
            }
        }
    </script>
</html>

...and the it's code-behind:
Imports Telerik.Web.UI
 
Public Class _Default
    Inherits Page
 
    Private Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If IsPostBack = False Then
            Dim personID As String = Request.QueryString("PID")
            If personID IsNot Nothing Then
                RadComboBox2.SelectedValue = personID
                RadComboBox2.Attributes.Add("DefaultItem", "true")
                RadComboBox2.Items.Add(New RadComboBoxItem(String.Format("Person {0}", personID), CStr(personID)))
            End If
        End If
    End Sub
 
    Private Sub Page_PreRender(sender As Object, e As System.EventArgs) Handles Me.PreRender
        lbl_SelectedPerson.Text = String.Format("Selected Item: {0}", RadComboBox2.SelectedValue)
    End Sub
 
    Private Sub RadComboBox2_ItemsRequested(sender As Object, e As RadComboBoxItemsRequestedEventArgs) Handles RadComboBox2.ItemsRequested
        RadComboBox2.DataSource = GetPeople()
        RadComboBox2.DataBind()
        e.EndOfItems = True
    End Sub
 
    Private Sub RadComboBox2_SelectedIndexChanged(sender As Object, e As RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox2.SelectedIndexChanged
        Response.Redirect(String.Format("/Default.aspx?PID={0}", e.Value))
    End Sub
 
    Private Function GetPeople() As List(Of Person)
        Dim theList As New List(Of Person)
        For i As Integer = 1 To 100
            theList.Add(New Person() With {.RecordID = i, .Name = String.Format("Person {0}", i)})
        Next
        Return theList
    End Function
 
    Public Structure Person
        Public Property RecordID As Integer
        Public Property Name As String
    End Structure
 
End Class

Does anybody know what's going on with this?

Thanks,
-Aaron
Aaron Bauman
Top achievements
Rank 1
 answered on 04 Jan 2012
3 answers
90 views
Hi,
can i use ASP.NET AJAX scheduler in ASP.NET MVC 3.0 project.can u send a sample project.
 
Thanx,
Alok
Peter
Telerik team
 answered on 04 Jan 2012
2 answers
263 views
I've upgrade to latest ASP.NET AJAX version, after upgrade I get this error about for my WebBlue skin:

Telerik.Web.UI.RadFormDecorator with ID='FormDecorator1' was unable to find embedded skin with name 'WebBlue'. Please, make sure that you spelled the skin name correctly, or if you want to use a custom skin, set EnableEmbeddedSkins=false.


I checked I've added Telerik.Web.UI.Skins.dll as described in :

http://blogs.telerik.com/blogs/posts/11-11-15/separate-skin-assembly-in-radcontrols-for-asp-net-ajax-with-q3-apos-11.aspx

When I change skin to default the error disappears. Any helps?

Regards
Mazdak
Rumen
Telerik team
 answered on 04 Jan 2012
1 answer
55 views
Hello,

The Process() method in custom async handlers is great. However, it is called only upon completed download of a file.

Is there a way to hook into an earlier handler event at the moment the download is initiated? The idea is that I would like to check whether the file is valid as early as possible. It looks bad to have the user wait for a 50MB upload only to tell at the end that the file cannot be uploaded (e.g. if it already exists). 

Thank you,
Stephan

Plamen
Telerik team
 answered on 04 Jan 2012
2 answers
122 views
If the Quick Access toolbar is enabled for the RibbonBar then in all browsers except IE9 a javascript error occurs and prevents everything from working.
If I disable the QA toolbar all works fine.
The error occurs in the initialize method of the RibbonBarQuickAccessToolbarItem object.

I have attached a screenshot of the error as seen in the developer tools of Safari 5. 
Kate
Telerik team
 answered on 04 Jan 2012
1 answer
165 views

When I use the RADListBox with grouped items. Everything displays correctly until I perform a client side transfer from one listbox to another. The transfered items append to the bottom of the listbox and are not grouped. How can I transfer and have everything regroup client side.



<script type="text/javascript">


        function onClientTransferred(sender, args) {


            //alert("transfer from id:" + args.get_sourceListBox().get_id());
            //alert("transfer to id:" + args.get_destinationListBox().get_id());


            var fromList = args.get_sourceListBox().get_items();
            var fromItem = args.get_item();
            var fromItemAttributes = args.get_item().get_attributes();
            var fromItemCat = fromItemAttributes.getAttribute("DataGroupField");
            alert("from item cat:" + fromItemCat);


            args.get_destinationListBox().trackChanges();
            var toList = args.get_destinationListBox().get_items();
            var toItem = args.get_destinationListBox().findItemByValue(args.get_item().get_value());
            var toItemAttributes = toItem.get_attributes();
            toItemAttributes.setAttribute("DataGroupField", fromItemCat);
            toItem.attributes = toItemAttributes;


            var index = fromList.indexOf(toItem);
            toList.removeAt(index);
            toList.insert(index, toItem);


            alert("to item:" + toItem.get_text());
            args.get_destinationListBox().commitChanges();


        }
</script>


<rei:REIRadListBox ID="lstFavItems" runat="server" AllowTransfer="true" TransferToID="lstTopFavItems" EnableDragAndDrop="true" EnableEmbeddedSkins="false"  DataTextField="DisplayText" DataValueField="UserFavoriteId" SelectionMode="Multiple" EnableFiltering="true" FilterBoxEmptyMessage="Type here to filter" Height="200" Width="370" 
TransferMode="Move"  OnTransferred="RadListBox_Transferred" AllowReorder="true"  OnClientTransferred="onClientTransferred"  />




<rei:REIRadListBox ID="lstTopFavItems" runat="server" Height="200" Width="370" EnableDragAndDrop="true" EnableFiltering="true" EnableEmbeddedSkins="false" FilterBoxEmptyMessage="Type here to filter" 
DataTextField="DisplayText" DataValueField="UserFavoriteId"  AllowReorder="true" />
Dimitar Terziev
Telerik team
 answered on 04 Jan 2012
6 answers
1.1K+ views
How to remove dynamically created column from Radgrid.
Shyam
Top achievements
Rank 1
 answered on 04 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?