Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
1.2K+ views
I am able to check all the checkboxes. But When I tried to retrieve all the checked boxes, checked, I am able to get the checkboxes ticked only in the first page.
other page value are not getting retrieved using the code:

for (int i = 0; i < rdNew.Items.Count; i++)
{
CheckBox chkSelected = (CheckBox)rdNew.Items[i].FindControl("chkSelected");
String Id = rdNew.Items[i]["id"].Text;

if (chkSelected.Checked && chkSelected != null)
{
if (list.Count == 0)
{
list.Add(Id);
}
}
}
I am not getting the total list, of the users checked.
Jaya
Top achievements
Rank 1
 answered on 20 Feb 2015
1 answer
55 views
I am creating a batch grid.  One of the cells in this grid is telerik:GridTemplateColumn ("Value" in the code below)  The EtidItemTemplate contains different objects.  Depending on the selected field type, only one of the objects is displayed.  So, if the field type is date, a calendar will be displayed and the other types - hidden.

Here are the issues I am coming across at the moment:
1. if the field type is text, the first time the user enters text into the box and moves out, the selected value is displayed as blank.  If I re-open the text box and enter the value once more, it shows up.
2. If field type is telerik:RadComboBox, I would like the ItemTemplate to display a comma delimited list of descriptions but the best I can do is a comma delimited list of IDs.  I need to be able to save the selection as list of IDs but display a list of descriptions to the user.
3. if I am editing an item that was saved earlier, the change is not processed.  I only see delete and insert being processed.

Here is the code for the aspx and code behind.
Thank you!

' CriteriaBuilderSimple.aspx code:

<%@ Page Title="" Language="VB" MasterPageFile="~/MNI.master" AutoEventWireup="false" CodeFile="CriteriaBuilderSimple.aspx.vb" Inherits="CriteriaBuilder_CriteriaBuilderSimple" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css" id="StyleSheet" runat="server">
        li.rlbItem .rlbText {
            color: red;
        }

        .message {
            line-height: 37px;
        }

        .RadGrid .rgRow,
        .RadGrid .rgAltRow {
            height: 30px;
        }

        .RadGrid_Silk .rgRow,
        .RadGrid_Silk .rgAltRow,
        .RadGrid_Glow .rgRow,
        .RadGrid_Glow .rgAltRow {
            height: 36px;
        }

        .RadGrid_MetroTouch .rgRow,
        .RadGrid_MetroTouch .rgAltRow,
        .RadGrid_BlackMetroTouch .rgRow,
        .RadGrid_BlackMetroTouch .rgAltRow {
            height: 46px;
        }
    </style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphContent" runat="Server">

    <asp:Panel runat="Server" ID="pnlClientSideMethods">
        <script type="text/javascript">
            var _grid = null;

            var _currentRow = null;
            var _currentCell = null;
            var _currentTableView = null;
            var _currentColumn = null;
            var _currentColumnUniqueName = null;

            var _currentFieldCell = null;
            var _currentValueCell = null;

            var strValueDisplay;

            var _currentCellsProcessed = 0;
            var _cellsToProcess = 0;

            function BatchEditOpened(sender, args) {
                _grid = sender;
                _currentTableView = args.get_tableView();

                _currentRow = args.get_row();
                _currentCell = args.get_cell();
                _currentColumn = args.get_column();
                _currentColumnUniqueName = args.get_columnUniqueName();

                if (_cellsToProcess === 0)
                    _cellsToProcess = _currentTableView._columnsInternal.length - 1; // since array starts with 0, stop the loop at length - 1

                if (_currentCellsProcessed === _cellsToProcess) {
                    _currentCellsProcessed = 0; // re-set the total number of processed cells since we are moving to a different row

                    // re-set current row cells
                    _currentFieldCell = null;
                    _currentValueCell = null;
                }

                // we are in the loop over all cells in the row, perform necessary validations to set all parameters of the newly selected row
                if (_currentCellsProcessed < _cellsToProcess) {
                    if (_currentColumnUniqueName === "FieldID") {
                        _currentFieldCell = args.get_cell();
                    }
                    else if (_currentColumnUniqueName === "Value") {
                        _currentValueCell = args.get_cell();
                    }


                }
                _currentCellsProcessed++; // one more cell has been processed, count it

                if (_currentCellsProcessed >= _cellsToProcess) {
                    // by now, all the cells in the row have been processed, set the initial field type values
                    if (_currentFieldCell != null && _currentValueCell != null) {
                        var strValue = sender.get_batchEditingManager().getCellValue(_currentFieldCell);
                        HandleFieldType(sender, _currentRow, strValue);


                        var textBox = $telerik.findControl(args.get_cell(), "txtValue");
                        var list = $telerik.findControl(args.get_cell(), "ddlProduct");

                        var selectedItems = textBox.get_value();
                        if (selectedItems.length > 0) {
                            var items = selectedItems.split(",");
                            var itemsCount = items.length;
                            for (var itemIndex = 0; itemIndex < itemsCount; itemIndex++) {
                                var item = items[itemIndex];

                                var listItem = list.findItemByValue(item)
                                if (listItem != null)
                                    listItem.set_checked(true);
                            }
                        }
                    }
                }
            }

            function FieldTypeSelected(sender, args) {
                if (_currentRow && _currentFieldCell && _grid) {
                    var objItem = args.get_item();
                    var strValue = objItem.get_text();
                    if (strValue != "") {
                        HandleFieldType(_grid, _currentRow, strValue);
                    }
                }
            }

            function TextTypeSelected(sender, eventArgs) {
                if (_currentRow && _currentValueCell && _grid) {
                    var lblValue = $telerik.findElement(_currentRow, "lblValue");
                    if (lblValue != null)
                        lblValue.innerHTML = eventArgs.get_newValue();
                }
            }

            function DateTypeSelected(sender, args) {
                if (_currentRow && _currentValueCell && _grid) {
                    var calendarBox = sender;
                    var valueBox = $telerik.findControl(_currentRow, "txtValue");
                    valueBox.set_value(calendarBox.get_selectedDate().format("MM/dd/yyyy"));
                }
            }

            function ComboBoxTypeSelected(sender, args) {
                if (_currentRow && _currentValueCell && _grid) {
                    var strValue = "";
                    strValueDisplay = "";

                    var items = sender.get_checkedItems();
                    var itemsCount = items.length;

                    for (var itemIndex = 0; itemIndex < itemsCount; itemIndex++) {
                        var item = items[itemIndex];
                        if (strValue != "")
                            strValue += ",";
                        strValue += item.get_value();

                        if (strValueDisplay != "")
                            strValueDisplay += ",";
                        strValueDisplay += item.get_text();
                    }

                    var valueBox = $telerik.findControl(_currentRow, "txtValue");
                    valueBox.set_value(strValue);

                }
            }

            function DropDownTypeSelected(sender, args) {
                if (_currentRow && _currentValueCell && _grid) {
                    var valueBox = $telerik.findControl(_currentRow, "txtValue");
                    valueBox.set_value(sender.get_selectedItem().get_value() + " " + sender.get_selectedItem().get_text());
                }
            }
            function HandleFieldType(sender, row, fieldType) {
                var andorBox = $telerik.findControl(row, "ddlAndOr");
                var operatorBox = $telerik.findControl(row, "ddlOperator");
                var textBox = $telerik.findControl(row, "txtValue");
                var calendarBox = $telerik.findControl(row, "calValue");
                var productBox = $telerik.findControl(row, "ddlProduct");

                var strValue = "";
                if (textBox != null) {
                    strValue = textBox.get_value();

                    textBox.set_visible(false);
                    calendarBox.set_visible(false);
                    productBox.set_visible(false);

                    if (fieldType === "Application Date") {
                        calendarBox.set_visible(true);
                    }
                    else if (fieldType === "Product") {
                        productBox.set_visible(true);
                    }
                    else if (fieldType === "") {
                        // field type not yet selected, do not allow operator or value selection
                        textBox.disable();
                        operatorBox.set_enabled(false);
                    }
                    else {
                        textBox.set_visible(true);
                        textBox.enable();
                        operatorBox.set_enabled(true);
                    }
                }
            }
        </script>
    </asp:Panel>

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="SavedChangesList" />
                </UpdatedControls>
            </telerik:AjaxSetting>

            <telerik:AjaxSetting AjaxControlID="ConfigurationPanel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1"></telerik:RadAjaxLoadingPanel>

    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecorationZoneID="demo" DecoratedControls="All" EnableRoundedCorners="false" />

    <div id="demo" class="demo-container no-bg">

        <telerik:RadListBox runat="server" ID="SavedChangesList" Width="600px" Height="200px" Visible="false"></telerik:RadListBox>

        <telerik:RadGrid ID="RadGrid1" GridLines="Both" runat="server" AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True" PageSize="50"
            AllowAutomaticUpdates="True" AllowPaging="False"
            AutoGenerateColumns="False" OnBatchEditCommand="RadGrid1_BatchEditCommand"
            DataSourceID="dsCriteria">

            <MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="ID"
                DataSourceID="dsCriteria" HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False" InsertItemDisplay="Bottom">

                <BatchEditingSettings EditType="Row" />
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="Sequence" SortOrder="Ascending" />
                </SortExpressions>

                <Columns>

                    <telerik:GridBoundColumn DataField="Sequence" SortExpression="Sequence" UniqueName="Sequence" Visible="false">
                    </telerik:GridBoundColumn>

                    <telerik:GridTemplateColumn HeaderText="And / Or" UniqueName="AndOr" DataField="AndOr" HeaderStyle-Width="100px">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblAndOr"><%# Eval("AndOr")%></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadDropDownList runat="server" ID="ddlAndOr" DataValueField="AndOr" DataTextField="AndOr" Width="50px" DefaultMessage="And" SelectedValue='<%# Bind("AndOr")%>'>
                                <Items>
                                    <telerik:DropDownListItem Value="And" Text="And" />
                                    <telerik:DropDownListItem Value="Or" Text="Or" />
                                </Items>
                            </telerik:RadDropDownList>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn HeaderText="Field" HeaderStyle-Width="200px" UniqueName="FieldID" DataField="FieldID">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblFieldDisplayName"><%# Eval("FieldDisplayName")%></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadDropDownList runat="server" ID="ddlAvailableFields" DataValueField="ID" AppendDataBoundItems="true"
                                DataTextField="FieldDisplayName" DataSourceID="dsAvailableFields" OnClientItemSelected="FieldTypeSelected">
                            </telerik:RadDropDownList>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn HeaderText="Operator" UniqueName="Operator" DataField="Operator" HeaderStyle-Width="100px">
                        <ItemTemplate>
                            <%# Eval("Operator")%>
                        </ItemTemplate>
                        <EditItemTemplate>

                            <telerik:RadDropDownList runat="server" ID="ddlOperator" DataValueField="Operator" DataTextField="Operator">
                                <Items>
                                    <telerik:DropDownListItem Value="=" Text="=" />
                                    <telerik:DropDownListItem Value="<>" Text="<>" />
                                    <telerik:DropDownListItem Value=">" Text=">" />
                                    <telerik:DropDownListItem Value="<" Text="<" />
                                    <telerik:DropDownListItem Value=">=" Text=">=" />
                                    <telerik:DropDownListItem Value="<=" Text="<=" />
                                    <telerik:DropDownListItem Value="Contains" Text="Contains" />
                                </Items>
                            </telerik:RadDropDownList>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="Value" HeaderStyle-Width="100%" HeaderText="Value" DataField="Value">
                        <ItemTemplate>
                            <asp:Label ID="lblValue" runat="server" Text='<%# Eval("Value")%>'></asp:Label>
                            <asp:Label ID="lblValueDisplay" runat="server" Text='<%# Eval("ValueDisplay")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadTextBox ID="txtValue" runat="server" Visible="true" Text='<%# Bind("Value")%>'>
                                <ClientEvents OnValueChanged="TextTypeSelected" />
                            </telerik:RadTextBox>

                            <telerik:RadDatePicker ID="calValue" runat="server" DateInput-DateFormat="MM/dd/yyyy" DateInput-DisplayDateFormat="MM/dd/yyyy" DbSelectedDate='<%# Bind("Value") %>' DateInput-OnClientDateChanged="DateTypeSelected"></telerik:RadDatePicker>

                            <telerik:RadComboBox runat="server" CheckBoxes="true" ID="ddlProduct" DataValueField="ID"
                                DataTextField="Description" DataSourceID="dsProduct" OnClientDropDownClosed="ComboBoxTypeSelected" DropDownAutoWidth="Enabled" >
                            </telerik:RadComboBox>

                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>

                    <telerik:GridButtonColumn ConfirmText="Delete?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" HeaderText="Delete" HeaderStyle-Width="50px" ButtonType="ImageButton"
                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                    </telerik:GridButtonColumn>

                </Columns>

            </MasterTableView>

            <ClientSettings>
                <ClientEvents OnBatchEditOpened="BatchEditOpened" />
            </ClientSettings>

        </telerik:RadGrid>
        <div style="display: none;">
            <telerik:RadCalendar ID="sharedCalendar" runat="server" EnableMultiSelect="false">
            </telerik:RadCalendar>
        </div>
    </div>

    <asp:SqlDataSource ID="dsCriteria" runat="server"
        SelectCommandType="StoredProcedure" SelectCommand="mnetwork.dbo.usp_LC_SelectCriteria"
        DeleteCommandType="StoredProcedure" DeleteCommand="mnetwork.dbo.usp_LC_DeleteCriteria"
        UpdateCommandType="StoredProcedure" UpdateCommand="mnetwork.dbo.usp_LC_UpsertCriteria"
        InsertCommandType="StoredProcedure" InsertCommand="mnetwork.dbo.usp_LC_UpsertCriteria">

        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
        </DeleteParameters>

        <InsertParameters>
            <asp:Parameter Name="Sequence" Type="String"></asp:Parameter>
            <asp:Parameter Name="FieldID" Type="String"></asp:Parameter>
            <asp:Parameter Name="Operator" Type="String"></asp:Parameter>
            <asp:Parameter Name="Value" Type="String"></asp:Parameter>
        </InsertParameters>

        <UpdateParameters>
            <asp:Parameter Name="Sequence" Type="String"></asp:Parameter>
            <asp:Parameter Name="FieldID" Type="String"></asp:Parameter>
            <asp:Parameter Name="Operator" Type="String"></asp:Parameter>
            <asp:Parameter Name="Value" Type="String"></asp:Parameter>
        </UpdateParameters>

    </asp:SqlDataSource>

    <asp:SqlDataSource ID="dsAvailableFields" runat="server" SelectCommandType="StoredProcedure" SelectCommand="mnetwork.dbo.usp_LC_SelectAvailableFields"></asp:SqlDataSource>
    <asp:SqlDataSource ID="dsProduct" runat="server" SelectCommandType="StoredProcedure" SelectCommand="mnetwork.dbo.uspGetProductList"></asp:SqlDataSource>

</asp:Content> 


' CriteriaBuilderSimple.aspx.vb code:

Imports System
Imports Telerik.Web.UI
Imports System.Collections

Imports System.Data

Partial Class CriteriaBuilder_CriteriaBuilderSimple
    Inherits Data1003Base

    Private _commonDataAccess As New Mnetweb.Common.DataAccess()
    Private _cnxString As String = _commonDataAccess.GetMNISQLSingleUserConnection()

    Protected Sub RadGrid1_BatchEditCommand(sender As Object, e As Telerik.Web.UI.GridBatchEditingEventArgs) Handles RadGrid1.BatchEditCommand
        SavedChangesList.Visible = True
    End Sub

    Protected Sub RadGrid1_ItemUpdated(source As Object, e As Telerik.Web.UI.GridUpdatedEventArgs) Handles RadGrid1.ItemUpdated
        Dim item As GridEditableItem = DirectCast(e.Item, GridEditableItem)
        Dim id As [String] = item.GetDataKeyValue("ID").ToString()
        If e.Exception IsNot Nothing Then
            e.KeepInEditMode = True
            e.ExceptionHandled = True
            NotifyUser("Criteria cannot be updated. " + e.Exception.Message)
        Else
            NotifyUser("Criteria updated!")
        End If
    End Sub

    Protected Sub RadGrid1_ItemInserted(source As Object, e As GridInsertedEventArgs) Handles RadGrid1.ItemInserted
        If e.Exception IsNot Nothing Then
            e.ExceptionHandled = True
            NotifyUser("Criteria cannot be inserted. " + e.Exception.Message)
        Else
            NotifyUser("New criteria inserted!")
        End If
    End Sub

    Protected Sub RadGrid1_ItemDeleted(source As Object, e As GridDeletedEventArgs) Handles RadGrid1.ItemDeleted
        Dim dataItem As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim id As [String] = dataItem.GetDataKeyValue("ID").ToString()
        If e.Exception IsNot Nothing Then
            e.ExceptionHandled = True
            NotifyUser("Criteria cannot be deleted. " + e.Exception.Message)
        Else
            NotifyUser("Criteria deleted!")
        End If
    End Sub

    Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
        If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
            Dim editItem As GridEditableItem = CType(e.Item, GridEditableItem)
            Dim picker As RadDatePicker = CType(editItem.FindControl("calValue"), RadDatePicker)
            picker.SharedCalendar = sharedCalendar
        End If
    End Sub

    Private Sub NotifyUser(message As String)
        Dim commandListItem As New RadListBoxItem()
        commandListItem.Text = message
        SavedChangesList.Items.Add(commandListItem)
    End Sub

    Protected Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
        dsCriteria.ConnectionString = _cnxString
        dsAvailableFields.ConnectionString = _cnxString
        dsProduct.ConnectionString = _cnxString
    End Sub

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        pnlClientSideMethods.DataBind()
    End Sub

End Class








Konstantin Dikov
Telerik team
 answered on 20 Feb 2015
1 answer
155 views
Hi I'm new here and I'm currently working with ASP.NET WebForms.

I had some issues trying to bind sources to a RadMediaPlayer that's inside a ASP Repeater:

<asp:Repeater ID="Publicaciones" runat="server" OnItemDataBound="FormatearPublicaciones" OnItemCommand="Publicaciones_ItemCommand">
    <ItemTemplate>
        <td><%# Eval("PublicacionId")%></td>
        <td><%# Eval("Mensaje")%></td>
        <td><asp:Image ID="PubImagen" runat="server" ClientIDMode="Static"/></td>
        <td>
            <telerik:RadMediaPlayer ID="PubAV" runat="server" ClientIDMode="Static" Width="350px" Height="250px"></telerik:RadMediaPlayer>
            <%--<audio id="PubAudio" runat="server" Width="350px" Height="250px"></audio>--%>
        </td>
        <br />
        <br />
    </ItemTemplate>
</asp:Repeater>


The repeater source is provided by a stored procedure which is called in code-behind and then I use the "OnItemDataBound" event of the repeater to format each ItemTemplate. I'm doing all this steps because I'm working on a social network and I want to manage different posts (images,videos,songs,etc).

Here is the code-behind of the repeater event:  

protected void FormatearPublicaciones(Object Sender, RepeaterItemEventArgs e)
{
    string filename = ((MuroEntity)e.Item.DataItem).PubMultimediaRuta;
    System.Web.UI.WebControls.Image imagenPub = e.Item.FindControl("PubImagen") as System.Web.UI.WebControls.Image;
    Telerik.Web.UI.RadMediaPlayer avPub = e.Item.FindControl("PubAV") as Telerik.Web.UI.RadMediaPlayer;
 
    if (((MuroEntity)e.Item.DataItem).Tipo.Equals("F"))
    {
        var imagenURL = Autenticado.Paths.Archivos + "thumb_" + filename;
        imagenPub.ImageUrl = imagenURL;
        avPub.Visible = false;
    }
    else if (((MuroEntity)e.Item.DataItem).Tipo.Equals("C") || ((MuroEntity)e.Item.DataItem).Tipo.Equals("V"))
    {
        avPub.Source = Autenticado.Paths.Archivos + filename;
        imagenPub.Visible = false;
    }
    else
    {
        avPub.Visible = false;
        imagenPub.Visible = false;
    }
}

The data bind of the repeater is working fine, for example the images binding is perfect but not the audio binding. You can see the player there but when you press play nothing happens, it seems like the source isn't there but i checked with the javascript console of google chrome and the source is there.

Here is also the static class that provides the path to the project local folder where the files (images,songs,videos,etc) are stored:

public static class Paths
{
    public static readonly string Archivos = "~/Archivos/" + SessionHelper.UsuarioAutenticado.Id.ToString() + "/"; // cannot change
    public static readonly string Archivos2 = "Archivos/" + SessionHelper.UsuarioAutenticado.Id.ToString() + "/";
    //public static int Total = 5; // can change because not const
}

I hope you can help me.

Thanks in advance.

John.

Eyup
Telerik team
 answered on 20 Feb 2015
1 answer
52 views
Hi All,
I have a RadDatePicker control and I need to validate the date. The user must enter a valid date and I have to check the date is not greater that the DataTime.Now value.
I am trying to build a method to handle both cases and send the corresponding error message. It looks I do not have the choice to call a method from the RequiredFieldValidator control.
Do you have any suggestion to handle this case?
Thanks
Yuri.
Vasil
Telerik team
 answered on 20 Feb 2015
2 answers
79 views
I've got an expandable grid that I'd like to fill the child as a Floated Tiles ListView.  Each of the cells (or tiles) in the listview have set widths and are rows/records from a datasource.  Depending on the right margin it would be good if the cells could wrap, but if not a set number of columns would be fine.  Whats the best way to achieve this?  

+ Row 1
   [1][2][3][4][5][6]
   [7][8][9][10][11]
   [12][13][14][15]
   [16][17][18][19]
- Row 2
- Row 3

Reducing the width would wrap the cells
+ Row 1
   [1][2][3][4]
   [5][6][7][8]
   [9][10][11]
   [12][13]
   [14][15]
   [16][17]
   [18][19]
- Row 2
- Row 3

cheers






Peter
Top achievements
Rank 1
 answered on 19 Feb 2015
3 answers
295 views
I'd like to add separators in the editor context menu - is this supported? The Tools section uses <telerik:EditorSeparator /> but this is not recognized inside the <ContextMenus> section.
Mark
Top achievements
Rank 2
Bronze
Bronze
Veteran
 answered on 19 Feb 2015
7 answers
386 views
No matter what I do, the dropdown arrow for the combo box only shows up on mouse over.  I have removed ALL css from the page to eliminate that as an issue and it still happens.  I've tried using a RadFormDecorator and selecting a different style theme as well but the same display issue persists.

<telerik:RadComboBox ID="cmbBillTo_State" runat="server" />


See attached images.

Anyone have an idea?
Bob
Top achievements
Rank 2
 answered on 19 Feb 2015
12 answers
1.7K+ views

We use your RadWindow controls quite a bit in our application. They are invoked using the following JavaScript convention…

 

var oWnd = radopen("EditWBSEast.aspx", "WBSRadWindow");

oWnd.setSize(830,300);

oWnd.Center();

 

We define WBSRadWindow as follows:

 

<telerik:RadWindowManager

    ID="RadWindowManager1"

    runat="server"

    Behavior="None"

    InitialBehavior="None" Left=""

    Skin="Outlook"

    style="display: inline;"

    Top=""

    DestroyOnClose="True">

    <Windows>

        <telerik:RadWindow

            ID="WBSRadWindow"

            Modal="true"

            runat="server"

            Behavior="None"

            DestroyOnClose="True"

            InitialBehavior="None"

            Title="”

            ReloadOnShow="true"

            Left=""

            NavigateUrl=""

            style="display: inline"

            Top=""

            Behaviors="None"  

            OnClientShow="OnClientShow">

        </telerik:RadWindow>

    </Windows>

</telerik:RadWindowManager>

 

This code provides us with a rather generic window with very little functionality but vastly better looking than the corresponding Window(Open) or Javascript alert. Our one problem is that we would also like to suppress the horizontal and vertical scrollbars.

 

We have seen elsewhere in your documentation that a JavaScript method similar to the one below should accomplish this

 

    function OnClientShow(radWindow)  

    {   

 

       var delScrollbar = radWindow._name;

       document.getElementsByName(delScrollbar)[0].setAttribute("scrolling", "no");

 

 

       var oTop = document.documentElement.scrollTop;  

       document.documentElement.scroll = "no";  

       document.documentElement.style.overflow = "hidden";  

       document.documentElement.scrollTop = oTop;  

 

       if(document.documentElement && document.documentElement.scrollTop)  

       {  

           var oTop = document.documentElement.scrollTop;  

           document.documentElement.scroll = "no";  

           document.documentElement.style.overflow = "hidden";  

           document.documentElement.scrollTop = oTop;  

                

       }

       else if(document.body)  

       {  

            var oTop = document.body.scrollTop;  

            document.body.scroll = "no";  

            document.body.style.overflow = "hidden";  

            document.body.scrollTop = oTop;  

        }  

    }  

  

This method does not suppress the scrollbars for us. Could you advise us as to how to best accomplish this?

 

 

Thanks

 

 

 

 

 

John
Top achievements
Rank 1
 answered on 19 Feb 2015
1 answer
100 views
I've been fighting with this issue for hours and hours now and I'm about ready to throw Rad controls out the window, it's so counter-intuitive.

I have a Radgrid called MyGroupsRadGrid01.  This grid displays a list of groups I'm in.  When I click on the Edit command of one of the rows, it displays the details of the group as well as a RadGrid of the other members in the group called GroupMembersRadGrid all within a FormTemplate.  I want to be able to add or delete an entry in GroupMembersRadGrid using GroupMemberRadGrid_DeleteCommand() and GroupMemberRadGrid_InsertCommand().  I tried using GroupMemberRadGrid_NeedDataSource() but the method itself cannot find GroupMemberRadGrid.  I then tried populating GroupMemberRadGrid within MyGroupsRadGrid01_ItemDataBound but after deleting an entry, the GroupMemberRadGrid showed up as empty (which seems to me necessitate's the GroupMemberRadGrid_NeedDataSource() that I can't get to work.  

<telerik:RadGrid ID="MyGroupsRadGrid01" runat="server"
    OnNeedDataSource="MyGroupsRadGrid01_NeedDataSource"
    AutoGenerateColumns="false" AutoPostBackOnFilter="true" OnUpdateCommand="MyGroupsRadGrid01_UpdateCommand" OnItemDataBound="MyGroupsRadGrid01_ItemDataBound"
    AllowSorting="true" AllowAutomaticUpdates="True" AllowAutomaticInserts="True" OnEditCommand="MyGroupsRadGrid01_EditCommand"
    AllowFilteringByColumn="false" MasterTableView-CommandItemDisplay="Top">
    <MasterTableView DataKeyNames="BWGroupID">
        <EditFormSettings EditFormType="Template">
            <FormTemplate>
                <table id="Table1" style="margin-left: 50px;" width="100%" cellspacing="2" cellpadding="1" border="0" rules="none" style="border-collapse: collapse;">
                    <tr>
                        <td valign="top">
                            <table id="Table2" cellspacing="2" cellpadding="1" border="0" rules="none" style="border-collapse: collapse;">
                                <tr id="BWGroupIDRow" runat="server">
                                    <td>BW Group ID   </td>
                                    <td><asp:Label ID="BWGroupIDLabel" runat="server" Text='<%# Bind("BWGroupID") %>' /></td>
                                </tr>
                                <tr id="BWGroupNameRow" runat="server">
                                    <td>BW Group Name   </td>
                                    <td><asp:Label ID="Label5" runat="server" Text='<%# Bind("BWGroupName") %>' /></td>
                                </tr>
                                <tr id="BWUserIDRow" runat="server">
                                    <td>BW User ID Owner   </td>
                                    <td><asp:Label ID="Label6" runat="server" Text='<%# Bind("BWUserOwner.BWUserID") %>' /></td>
                                </tr>
                                <tr id="DisplayNameRow" runat="server">
                                    <td>BW User Owner   </td>
                                    <td><asp:Label ID="Label7" runat="server" Text='<%# Bind("BWUserOwner.DisplayName") %>' /></td>
                                </tr>
                                <tr id="IsActive" runat="server">
                                    <td></td>
                                    <td><asp:CheckBox ID="DeactivateCheckBox" runat="server" Text="Deactivate" /></td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="2"><br />
                                        <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                            runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button
                                        <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
                                    </td>
                                </tr>
                            </table>
 
                        </td>
                        <td valign="top">
                            <table id="Table3" style="margin-left: 5px;" cellspacing="2" cellpadding="1" border="0" rules="none" style="border-collapse: collapse;">
                                <tr><td><h4>Group Members:</h4></td></tr>
                                <tr>
                                    <td>
                                        <telerik:RadGrid ID="GroupMemberRadGrid" runat="server" width="100%" AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
                                            AllowAutomaticDeletes="true" OnDeleteCommand="GroupMemberRadGrid_DeleteCommand" OnNeedDataSource="GroupMemberRadGrid_NeedDataSource"
                                            AutoPostBackOnFilter="true" OnUpdateCommand="GroupMemberRadGrid_UpdateCommand">
                                            <MasterTableView AutoGenerateColumns="False" DataKeyNames="BWUserId">
                                                <Columns>
                                                    <telerik:GridBoundColumn DataField="BWGroupId" DataType="System.Int32" HeaderText="Group ID" ReadOnly="True" SortExpression="BWGroupId" UniqueName="BWGroupId"></telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="BWUserId" DataType="System.Int32" HeaderText="User ID" ReadOnly="True" SortExpression="BWUserId" UniqueName="BWUserId"></telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="DisplayName" HeaderText="Name" SortExpression="DisplayName" UniqueName="DisplayName"></telerik:GridBoundColumn>
                                                    <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" />
                                                </Columns>
                                            </MasterTableView>
                                        </telerik:RadGrid>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <br />
            </FormTemplate>
        </EditFormSettings>
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="LinkButton" EditText="View/Edit" UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn UniqueName="BWGroupID" DataField="BWGroupID" HeaderText="BW Group ID" SortExpression="BWGroupID" FilterControlWidth="150px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="BWGroupName" HeaderText="BW Group Name" ReadOnly="true" SortExpression="BWGroupName" FilterControlWidth="150px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="BWUserOwner.BWUserID" HeaderText="BW User ID Owner" SortExpression="BWUserOwner.BWUserID" FilterControlWidth="50px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="BWUserOwner.DisplayName" HeaderText="BW User Owner" SortExpression="BWUserOwner.DisplayName" FilterControlWidth="50px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
protected void MyGroupsRadGrid01_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        Label BWGroupID = editedItem.FindControl("BWGroupIDLabel") as Label;
        int ParseBWGroupID = -1; int.TryParse(BWGroupID.Text, out ParseBWGroupID);
 
        if (ParseBWGroupID < 1)
            return;
 
        BWGroupUsers usersInGroup = new BWGroupUsers();
        usersInGroup.GetActiveBWUsersByGroupID(ParseBWGroupID);
 
        RadGrid GroupMemberRadGrid = new RadGrid();
        GroupMemberRadGrid = (RadGrid)e.Item.FindControl("GroupMemberRadGrid");
 
        ViewState["BWGroupID"] = ParseBWGroupID;
 
        //GroupMemberRadGrid.DataSource = usersInGroup.BWGroupUsersList.OrderBy(u => u.DisplayName);
        //GroupMemberRadGrid.DataBind();
    }
}
 
protected void GroupMemberRadGrid_DeleteCommand(object sender, GridCommandEventArgs e)
{
    if (e.Item is GridDataItem && e.CommandName == "Delete")
    {
        GridDataItem item = (GridDataItem)e.Item;
        int parseGroupId = -1; int.TryParse(item["BWGroupId"].Text.ToString(), out parseGroupId);
        int parseUserId = -1; int.TryParse(item["BWUserId"].Text.ToString(), out parseUserId);
 
        BWGroupUser selectedGroupUser = new BWGroupUser();
        //selectedGroupUser.DeleteBWGroupUser(parseGroupId, parseUserId);
    }
}
 
protected void GroupMemberRadGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    GroupMemberRadGrid.DataSource = GroupMemberDataSource().BWUserList;  //Doesn't find this!
}
 
private BWUsers GroupMemberDataSource()
{
    BWUsers allBWUsers = new BWUsers();
    if (ViewState["BWGroupID"] != null && ViewState["BWGroupID"].ToString().Length > 0)
    {
        int ParseBWGroupID = -1; int.TryParse(ViewState["BWGroupID"].ToString(), out ParseBWGroupID);
 
        allBWUsers.GetActiveBWUsersByGroupID(ParseBWGroupID);
        return allBWUsers;
    }
    return allBWUsers;
}



It's 9:00pm and I've been working on this since noon.  I can't fight with this all night and it's due in 11 hours.  I need help.
Pavlina
Telerik team
 answered on 19 Feb 2015
5 answers
93 views
Data in the file exported to excel is incorrect plz help me
Kostadin
Telerik team
 answered on 19 Feb 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?