Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
226 views
Hi all,
i have one senario ,  i have telegrid with have some textbox and combox columns with binded data.  every row have two icon. for delete. and "add row icon" end of row(last row). this two operation should  work without post back.  because i have get all the value after i clicked my submit button.
when i click add icon new row should come with textbox and combo box in the grid. "add icon" should go to latest row.  .click "delete icon , corresponding  row will delete.

Please give me soluton as soon as possible.
Please refer Attachment  also
Sebastian
Telerik team
 answered on 22 Oct 2009
3 answers
135 views
Hi,

I have a RadGrid with self-referencing hierarchy and on 'RowSelected' client event I am trying to get the text of the parent row.
I am using code below which works well in IE and Chrome, but returns nothing in Fire Fox. Is there any work around for this?

eventArgs.get_tableView().get_parentRow().cells[0].innerText

Thanks
Veli
Telerik team
 answered on 22 Oct 2009
2 answers
203 views
Is it possible to set the value of a cell client-side doing something like this?  (Obviously this does not work) 

 

 

 

function Test2() {

 

 

var MasterTable = $find('RadGrid1').get_masterTableView();

 

 

var items = MasterTable.get_dataItems();

 

 

var i = 0;

 

 

for (i = 0; i < 5; i++) {

 

 

var row = MasterTable.get_dataItems()[i];

 

 

var cell = MasterTable.getCellByColumnUniqueName(row, "StopNumber");

 

 

if (cell.innerHTML == 2) {

 

MasterTable.selectItem(MasterTable.get_dataItems()[i].get_element());

MasterTable.editSelectedItems();

 

var cell2 = MasterTable.getCellByColumnUniqueName(row, "PickUpOrDelPIN_NUM");

 

cell2.set_value =

"711143"

 

 

 

 

 

MasterTable.updateEditedItems();

 

return false;

 

}

}

}

John Thompson
Top achievements
Rank 1
 answered on 22 Oct 2009
4 answers
556 views
I have the following set up in markup, which is inside a multi level hierarchy:

                    <rad:GridTemplateColumn HeaderText="Permission"> 
                        <ItemTemplate> 
                            <rad:RadComboBox ID="rcbParentCategoryPermission" runat="server" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged"></rad:RadComboBox> 
                        </ItemTemplate> 
                    </rad:GridTemplateColumn> 
 

In JS I have this:

function OnClientSelectedIndexChanged(sender, eventArgs) { 
    var row = sender.get_element().parentNode.parentNode; 
    // how to get the rowindex from this? 
} 

What I want to do is get the gridrow so I can expand/collapse the hierarchy when the combobox index is changed on the client. I've tested that my client hierarchy is looping and expanding all levels correctly. I did this by adding the RowClick handler on the grid. Now all I want to do is find the current rowindex when the combobox value is changed on the client. It feels like it should be simple, but I've been trying to do it for hours.

thanks,

Steve


Steve White
Top achievements
Rank 1
 answered on 22 Oct 2009
3 answers
108 views
Hello,

I have a problem with the scrollbar of the listbox. When I apply a skin on my list box like that :

<telerik:RadListBox runat="server" ID="RadListBoxSource" Height="200px" Width="200px" SelectionMode="Multiple" Skin="Black"> 
        <Items> 
            <telerik:RadListBoxItem Text="Argentina" /> 
            <telerik:RadListBoxItem Text="Australia" /> 
            <telerik:RadListBoxItem Text="Brazil" /> 
            <telerik:RadListBoxItem Text="Canada" /> 
            <telerik:RadListBoxItem Text="Chile" /> 
            <telerik:RadListBoxItem Text="China" /> 
            <telerik:RadListBoxItem Text="Egypt" /> 
            <telerik:RadListBoxItem Text="England" /> 
            <telerik:RadListBoxItem Text="France" /> 
            <telerik:RadListBoxItem Text="Germany" /> 
            <telerik:RadListBoxItem Text="India" /> 
            <telerik:RadListBoxItem Text="Indonesia" /> 
            <telerik:RadListBoxItem Text="Kenya" /> 
            <telerik:RadListBoxItem Text="Mexico" /> 
            <telerik:RadListBoxItem Text="New Zealand" /> 
            <telerik:RadListBoxItem Text="South Africa" /> 
            <telerik:RadListBoxItem Text="USA" /> 
        </Items> 
    </telerik:RadListBox> 

The skin is applied on the listbox's items but not on the scrollbar. I have a Windows style on it.
I tested it on IE8 and Firefox 3.0.14 with Telerik 2.826.35 and ASP .NET : 2.0.50727.3082.

How can I have the right scrollbar style?


Paul
Telerik team
 answered on 22 Oct 2009
1 answer
103 views
Hello,

How can i make a preview like images for video files. I load only video files (mpg, wmv) in the directory. Can I make a Preview for this files? I need the windows mediaplayer.

Thank you

Reiner
Fiko
Telerik team
 answered on 22 Oct 2009
1 answer
134 views
Hello,
I am having some trouble getting a details view with a RadCombobox to work in a RadWindow that functions an an Edit Dialog for a Radgrid.  I am using the following example as a base: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window

Essentially I am trying to do the same thing as the example, but my DetailsView contains a RadCombobox as one of the fields in the edit dialog.  I am having a problem with a combobox (aka drop down list) retaining the selected item in a scenario where the details view is wrapped as a user control then loaded onto the page.   The problem seems to be with using the RadCombobox in the DetailsView while also allowing the user to change the value.

-      I have two user controls that each contains a DetailsView with a dropdownlist as a template field in the DetailsView
     o      The dropdown triggers a postback which raises an event that the page then uses to determine which user control to load depending on the value selected in the dropdown.
-      I load one of the two different user controls onto the page depending on the value of the selected item in the dropdownlist.
     o      This seems to be working correctly as the correct user control loads depending on which value is selected in the dropdownlist within the user control
-      Problem: However, after loading a different usercontrol/DetailsView the selected item of the drop down list is not retained (E.g. even though the correct user control/details view loaded the dropdownlist is not remembering the previously selected value).  So while the correct user control loads the selected value in the dropdown is not retained.

Any help would be appreciated.


ASPX Markup
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ItemBuilderSimpleItem.ascx.vb" Inherits="admin_UserControls_App_ItemBuilderSimpleItem" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
   
   
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
    DataKeyNames="ItemID" DataSourceID="SqlDataSource1" BorderWidth="0" CellPadding="0" CellSpacing="7">  
    <Fields> 
            <asp:TemplateField HeaderText="<%$Resources: Config, ItemType %>" SortExpression="ItemTypeID">  
                     <EditItemTemplate> 
                         <telerik:RadComboBox ID="cboItemTypesDropdown" OnSelectedIndexChanged="ItemType_SelectedIndexChanged" runat="server" DataSourceID="SqlDataSource2" 
                          DataTextField="Alias" 
                          DataValueField="ItemTypeID" 
                          SelectedValue='<%#Bind("ItemTypeID") %>' AutoPostBack="true" Width="350px">  
                         </telerik:RadComboBox> 
                     </EditItemTemplate> 
                     <ItemTemplate> 
                        <asp:Label Runat="server" Text='<%# Bind("ItemTypeID") %>' ID="lblItemTypeID"></asp:Label> 
                     </ItemTemplate> 
            </asp:TemplateField> 
        <asp:BoundField DataField="Alias" HeaderText="<%$Resources: Config, Alias %>" SortExpression="Alias" ControlStyle-Width="350px" /> 
       <asp:CheckBoxField DataField="IsActive" HeaderText="<%$Resources: Config, IsActive %>" SortExpression="IsActive" /> 
        <asp:CommandField ShowEditButton="True" EditText="<%$Resources: Config, Update %>"/>  
        <asp:CommandField ShowInsertButton="True" InsertText="<%$Resources: Config, Add %>"/>  
        <asp:CommandField ShowDeleteButton="True" DeleteText="<%$Resources: Config, Delete %>" /> 
    </Fields> 
</asp:DetailsView> 
<br /> 
      
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connApp_PRD %>" 
DeleteCommand="proc_ConfigItems_Delete" 
DeleteCommandType="StoredProcedure" 
InsertCommand="proc_ConfigItems_Add" 
InsertCommandType="StoredProcedure" 
SelectCommand="proc_ConfigItems_GetItemByItemID" 
SelectCommandType="StoredProcedure" 
UpdateCommand="proc_ConfigItems_Update" 
UpdateCommandType="StoredProcedure">  
            <DeleteParameters> 
                <asp:Parameter Name="ItemID" Type="Int64" /> 
            </DeleteParameters> 
            <UpdateParameters> 
                <asp:Parameter Name="ItemID" Type="Int64" /> 
                <asp:Parameter Name="ItemTypeID" Type="Int64" /> 
                <asp:Parameter Name="Alias" Type="String" /> 
                <asp:Parameter Name="IsActive" Type="Boolean" /> 
            </UpdateParameters> 
            <InsertParameters> 
                <asp:Parameter Name="ItemTypeID" Type="Int64" /> 
                <asp:Parameter Name="Alias" Type="String" /> 
                <asp:Parameter Name="IsActive" Type="Boolean" /> 
            </InsertParameters> 
            <SelectParameters> 
                <asp:QueryStringParameter Name="ItemID" QueryStringField="ItemID" Type="Int64" /> 
            </SelectParameters> 
        </asp:SqlDataSource> 
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:connApp_PRD %>" 
            SelectCommand="proc_ItemTypes_GetAllItemTypes" SelectCommandType="StoredProcedure">  
        </asp:SqlDataSource> 


VB.NET Codebehind

Imports System  
Imports System.Data  
Imports System.Collections  
Imports System.Web.UI  
Imports Telerik.Web.UI  
   
Imports Microsoft.ApplicationBlocks.Data  
Imports System.Configuration  
Imports System.Data.SqlClient  
Imports JG.App.Core  
   
Partial Class admin_UserControls_App_ItemBuilderSimpleItem  
    Inherits System.Web.UI.UserControl  
    Implements IItemBuilder  
   
    Private _ItemType As Integer 
   
    'Moved delegate to interface definition  
    'Public Delegate Sub ItemTypeChangedHandler(ByVal sender As Object, ByVal e As ItemTypeChangedEventArgs)  
    Public Event ItemTypeChanged(ByVal sender As Object, ByVal e As ItemTypeChangedEventArgs) Implements IItemBuilder.ItemTypeChanged  
   
        Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init  
        If Page.Request.QueryString("ItemID") Is Nothing Then 
            DetailsView1.DefaultMode = DetailsViewMode.Insert  
        Else 
            DetailsView1.DefaultMode = DetailsViewMode.Edit  
        End If 
   
    End Sub 
   
    'Add a method that resembles default methods to handle the Item type changing  
    Protected Sub ItemType_SelectedIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)  
        Dim control As RadComboBox = ControlUtility.Instance.FindControlRecursive("cboItemTypesDropdown")  
   
        If Not IsNothing(control) Then 
            ItemType = control.SelectedValue  
        End If 
    End Sub 
   
   
    Public Property ItemType() As Integer Implements IItemBuilder.ItemType  
        Get 
            Dim control As RadComboBox = ControlUtility.Instance.FindControlRecursive("cboItemTypesDropdown")  
            If Not IsNothing(control) Then 
                If control.SelectedItem.Value = String.Empty Then 
                    control.SelectedIndex = -1  
                    _ItemType = Nothing 
                    MsgBox("Nothing")  
                Else 
                    _ItemType = control.SelectedItem.Value  
                    MsgBox("2 selected item: " & _ItemType.ToString)  
                End If 
   
                MsgBox("3 selected item: " & _ItemType.ToString)  
   
                Return _ItemType  
            End If 
   
        End Get 
        Set(ByVal Value As Integer)  
            Dim control As RadComboBox = ControlUtility.Instance.FindControlRecursive("cboItemTypesDropdown")  
            If Not IsNothing(control) Then 
                If Not IsNothing(control.Items.FindItemByValue(Value)) Then 
                    control.Items.FindItemByValue(Value).Selected = True 
                    _ItemType = Value  
                    MsgBox("Do I ever get here?" & _ItemType)  
                    OnItemTypeChanged()  
                End If 
            End If 
        End Set 
    End Property 
   
   
    Protected Sub OnItemTypeChanged()  
        RaiseEvent ItemTypeChanged(Me, New ItemTypeChangedEventArgs(_ItemType))  
    End Sub 
   
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
        Dim control As RadComboBox = ControlUtility.Instance.FindControlRecursive("cboItemTypesDropdown")  
        If Not IsNothing(control) Then 
            If Not IsNothing(control.Items.FindItemByValue(ItemType)) Then 
                control.Items.FindItemByValue(ItemType).Selected = True 
            End If 
        End If 
    End Sub 
End Class 
 
Fiko
Telerik team
 answered on 22 Oct 2009
1 answer
90 views
Reffering to this demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/selfreferencing/defaultcs.aspx

Can anyone please indicate how I can hide the id columns?

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" OnColumnCreated="RadGrid1_ColumnCreated"

 

 

 

OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound"

 

 

 

Skin="Sunset" >

 

 

 

 

 

<MasterTableView HierarchyDefaultExpanded="false" HierarchyLoadMode="Client" AllowSorting="true"

 

 

 

DataKeyNames="id, parentid" Width="100%" FilterExpression="id=1">

 

 

 

 

 

<SelfHierarchySettings ParentKeyName="parentid" KeyName="id" />

 

 

 

 

 

<Columns>

 

 

 

 

 

<telerik:GridTemplateColumn UniqueName="TemplateEditColumn">

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

<asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

 

</Columns>

 

 

 

 

 

</MasterTableView>

 

 

 

 

 

<ClientSettings AllowExpandCollapse="true">

 

 

 

</ClientSettings>

 

 

 

 

 

</telerik:RadGrid>

 

Sebastian
Telerik team
 answered on 22 Oct 2009
6 answers
420 views
Hi, this is my first post on here. I have recently installed the trial version of the AJAX controls on a publishing test site. I have got my whole site using the RadEditor toolbar by activating the relevant feature. This works okay, I can use the document manager, image manager, as well as all of the other tools fine. For the image manager I have set the config file to use "/PublishingImages" as the default directory, and this works ok, it picks up the folders I have created okay.

However, on one of my page layouts I have incorporated an individual RadEditor into the page, that just has the ImageManager icon. When clicking on the ImageManager icon for this the folders (i.e. from my default directory) I get when clicking the other RadEditor toolbar do not appear. I have set the ViewPaths attribute in the page layout to the same directory as I did in the config file, "/PublishingImages", but still nothing. All I get is the ImageManager dialog box, but with nothing in it, and the majority of the controls are greyed out and are unusable.

Is there something I should have done (or shouldn't have!) that may be causing this problem?

Many thanks in advance,
Sean
Sean Hudson
Top achievements
Rank 1
 answered on 22 Oct 2009
1 answer
191 views
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" 
    CodeBehind="Tolerance.aspx.cs" Inherits="GainLossSettlement.Tolerance" StylesheetTheme="Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">  
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
    <h2> 
        <span>Tolerance Percentage By Terminal / Product / Supplier</span></h2>  
    <telerik:RadScriptBlock runat="server">  
 
        <script type="text/javascript">  
            function showBottem() {  
                document.getElementById('divContainer').style.visibility = '';  
            }  
 
            function hideBottem() {  
                var item = document.getElementById('divContainer');  
                item.style.visibility = 'hidden';  
            }  
        </script> 
 
    </telerik:RadScriptBlock> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="rcbTerminals">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rcbProducts" LoadingPanelID="radLoadingProducts" /> 
                    <telerik:AjaxUpdatedControl ControlID="rcbSuppliers" LoadingPanelID="RadLoadingSupplier" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="rcbProducts">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rcbSuppliers" LoadingPanelID="RadLoadingSupplier" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <br /> 
    <div class="clear">  
    </div> 
    <label class="controlLabel">  
        Terminal<span class="small">Select Terminal</span></label>  
    <telerik:RadComboBox ID="rcbTerminals" runat="server" Skin="WebBlue" LoadingMessage="Loading..." 
        MarkFirstMatch="true" EnableLoadOnDemand="true" AutoPostBack="True" OnSelectedIndexChanged="rcbTerminals_SelectedIndexChanged" 
        Width="17em" CssClass="radControl">  
    </telerik:RadComboBox> 
    <div class="clear">  
    </div> 
    <label class="controlLabel">  
        Product<span class="small">Select Product</span></label>  
    <telerik:RadComboBox ID="rcbProducts" runat="server" Skin="WebBlue" LoadingMessage="Loading..." 
        MarkFirstMatch="true" EnableLoadOnDemand="true" Width="17em" CssClass="controlLabel" 
        AutoPostBack="True" OnSelectedIndexChanged="rcbProducts_SelectedIndexChanged">  
    </telerik:RadComboBox> 
    <telerik:RadAjaxLoadingPanel ID="radLoadingProducts" runat="server" IsSticky="True" 
        MinDisplayTime="1000" CssClass="small">  
        <asp:Image ID="loading" runat="server" ImageUrl="~/App_Themes/Default/Images/Web20.gif" 
            Height="18px" Width="18px" />Loading...  
    </telerik:RadAjaxLoadingPanel> 
    <div class="clear">  
    </div> 
    <label class="controlLabel">  
        Supplier<span class="small">Select Supplier</span></label>  
    <telerik:RadComboBox ID="rcbSuppliers" runat="server" Skin="WebBlue" 
        MarkFirstMatch="true"  Width="17em" CssClass="controlLabel" 
        AutoPostBack="True" OnSelectedIndexChanged="rcbSuppliers_SelectedIndexChanged">  
    </telerik:RadComboBox> 
    <telerik:RadAjaxLoadingPanel ID="RadLoadingSupplier" runat="server" IsSticky="True" 
        MinDisplayTime="1000" CssClass="small">  
        <asp:Image ID="Image1" runat="server" ImageUrl="~/App_Themes/Default/Images/Web20.gif" 
            Height="18px" Width="18px" />Loading...  
    </telerik:RadAjaxLoadingPanel> 
    <br /> 
    <div class="clear">  
    </div> 
    <br />   
        <div id="divContainer" class="divContainer">  
            <fieldset> 
                <legend title="Tolerance Rate">Current Tolerance Rate</legend> 
                <div class="divPaddedContainer">  
                    <label class="controlLabel">  
                        Rate:</label><asp:Label ID="lblCurrentRate" runat="server"></asp:Label> 
                    <asp:Label ID="lblIsDefault" runat="server" Text="*"></asp:Label> 
                    <div class="clear">  
                    </div> 
                    <label class="controlLabel">  
                        Effective As Of:</label><asp:Label ID="lblEffectiveDate" runat="server"></asp:Label><div 
                            class="clear">  
                        </div> 
                </div> 
            </fieldset> 
            <br /> 
            <br /> 
            <fieldset> 
                <legend title="New Tolerance Rate">New Tolerance Rate</legend> 
                <div class="divPaddedContainer">  
                    <label class="controlLabel">  
                        Rate:</label> 
                    <telerik:RadNumericTextBox ID="rtbNewRate" runat="server" Width="8em" Skin="WebBlue">  
                        <NumberFormat DecimalDigits="4" GroupSeparator="" /> 
                    </telerik:RadNumericTextBox> 
                    <asp:CheckBox ID="cbNewDefault" runat="server" Text="Use Default Rate"></asp:CheckBox> 
                    <div class="clear">  
                    </div> 
                    <label class="controlLabel">  
                        Effective Date:  
                    </label> 
                    <telerik:RadDatePicker ID="rdpNewEffectiveDate" runat="server" Skin="Web20" Width="8em">  
                        <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" 
                            Skin="Web20">  
                        </Calendar> 
                        <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton> 
                    </telerik:RadDatePicker> 
                    <div class="clear">  
                    </div> 
                </div> 
            </fieldset> 
            <br /> 
            <br /> 
            <span>*</span><span class="smallInline"> Default Tolerance</span> 
        </div>   
    <div class="clear">  
    </div> 
</asp:Content> 
 

Can anyone help me figure out why rcbSuppliers is not causing a postback? When I remove the ajax manager the control works and the postback occurs. But for some reason rcbSuppliers is doing an ajax request instead of a post back. Why would this be?
Martin
Telerik team
 answered on 22 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?