Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
99 views

Hi

An issue appear while selecting date, if we see in html code a style left:-1000px apply on RadCalendarPopup RadCalendarPopupShadows that disturb style by creating extra space on the page (pic attach)

Another important point here, i use dir="ltr" on body tag for english language and dir="rtl" on body tag for arabic language, the style issue only appear for arabic case in which we use dir="rtl". how we can fix this ? 

 

Rumen
Telerik team
 answered on 29 Aug 2018
0 answers
162 views

Hi 

We have implemented a Multi column, Multi selection Rad Combobox with Radgrid as itemtemplate,  we able to create multiple selection effect by clicking on grid rows area (not using check box column for selection) and able to persist selection on filtering and sorting, the issue we face is selection text doesn’t appear on combobox header on first time selection without using checkbox (clicking on row), however its working fine on 2nd, 3rd click.

ASPX code:

<telerik:RadComboBox ID="cmbUser" runat="server" Width="180px" Height="200px" DropDownWidth="180px"
  EmptyMessage="Please select..." OnClientDropDownClosing="OnEmployeeDropdownClosing" AutoPostBack="true">
<ItemTemplate>
<div style="max-height: 200px; overflow: auto;">

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"  >

<asp:Button ID="btnHidden" ClientIDMode="Static" runat="server" Style="display: none;" CausesValidation="false" />
<telerik:RadGrid ID="rGrdUsers4DDL" runat="server" AllowSorting="True" AutoGenerateColumns="False"
AllowMultiRowSelection="true" AllowFilteringByColumn="true"
CellSpacing="0" GridLines="None" OnNeedDataSource="rGrdUsers4DDL_NeedDataSource"
Width="180px" ClientSettings-EnableRowHoverStyle="True">
<ClientSettings>
<Selecting AllowRowSelect="true" EnableDragToSelectRows="true" UseClientSelectColumnOnly="false" ></Selecting>
</ClientSettings>
<GroupingSettings CaseSensitive="false" />
<MasterTableView DataKeyNames="UserID,FullDesc,EmployeeID,Firstname" ClientDataKeyNames="UserID,FullDesc,EmployeeID,Firstname">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>

<Columns>
<telerik:GridClientSelectColumn  UniqueName="SelectColumn"  ></telerik:GridClientSelectColumn>

<telerik:GridBoundColumn DataField="UserID" Visible="false" FilterControlAltText="Filter column column"
HeaderText="User ID" UniqueName="column">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="EmployeeID" FilterControlAltText="Filter column1 column" CurrentFilterFunction="Contains" FilterDelay="3000" ShowFilterIcon="false"
HeaderText="Employee Code" UniqueName="column1" AutoPostBackOnFilter="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Firstname" FilterControlAltText="Filter column2 column" CurrentFilterFunction="Contains" FilterDelay="3000" AutoPostBackOnFilter="false" ShowFilterIcon="false"
HeaderText="Firstname" UniqueName="column2">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Lastname" FilterControlAltText="Filter column3 column" CurrentFilterFunction="Contains" FilterDelay="3000" AutoPostBackOnFilter="false" ShowFilterIcon="false"
HeaderText="Lastname" UniqueName="column3">
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn>
</EditFormSettings>
</MasterTableView>
<ClientSettings>
<ClientEvents OnGridCreated="OnddlEmployeeGridCreated"  OnRowCreated="OnddlEmployeeRowCreated"
OnRowDeselected="OnddlEmployeeRowDeSelected" OnRowSelected="OnddlEmployeeRowSelected"
OnRowClick="OnddlEmployeeRowClick"></ClientEvents>
</ClientSettings>
<FilterMenu EnableImageSprites="False">
</FilterMenu>
</telerik:RadGrid>
</telerik:RadAjaxPanel>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" IsSticky="true" />
</div>

</ItemTemplate>
<Items>
<telerik:RadComboBoxItem runat="server" Text=""></telerik:RadComboBoxItem>
</Items>
</telerik:RadComboBox>
Java script functions:

        var clickedItemIndex;
            var selected;
            var chkbxClicked;
            var PersistSelctionArray = {};


            function OnddlEmployeeGridCreated(sender, eventArgs) {
                //alert('grid created');

                //To create array selected length of dataitems
                selected = new Array(sender.get_masterTableView().get_dataItems().length);

                //To set the select all checkbox with respect to the selected dataitems
                var masterTable = sender.get_masterTableView();
                var selectColumn = masterTable.getColumnByUniqueName("SelectColumn");
                var headerCheckBox = $(selectColumn.get_element()).find("[type=checkbox]")[0];

                if (headerCheckBox) {
                    headerCheckBox.checked = masterTable.get_selectedItems().length ==
                        masterTable.get_dataItems().length;
                }
            }

            function ClearSelection() {
                PersistSelctionArray = {};
            }

            function OnddlEmployeeRowClick(sender, args) {
                //alert('Row clicked');
                var master = sender.get_masterTableView();
                var index = args.get_itemIndexHierarchical();
                selected[index] = master.get_dataItems()[index].get_selected()
                clickedItemIndex = index;
                //alert(selected[index]);
                //master.get_dataItems()[index].set_selected(!master.get_dataItems()[index].get_selected());
            }

            function OnddlEmployeeRowSelected(sender, args) {
                //alert('Row Selected');

                var e = args.get_domEvent(); 
                //IE - srcElement, Others - target 
                var targetElement = e.srcElement || e.target;
                if (typeof (targetElement) != "undefined") {
                    //is the clicked element an input checkbox? <input type="checkbox"...> 
                    if (targetElement.tagName.toLowerCase() != "input" &&
                        (!targetElement.type || targetElement.type.toLowerCase() != "checkbox"))// && currentClickEvent) 
                    {
                        chkbxClicked = false;
                    }
                    else {
                        chkbxClicked = true;
                    }
                }
                else {
                    //args.set_cancel(true);
                }
                //alert('chkbxClicked=' + chkbxClicked);
                var index = args.get_itemIndexHierarchical();
                var UserID = args.getDataKeyValue("UserID");
                if (!chkbxClicked) {
                    //alert("row clicked=" + selected[index]);
                    if (clickedItemIndex == index && selected[index]) {
                        //args.set_cancel(true);
                        args.get_gridDataItem().set_selected(false);
                    }
                    else {
                        //To keep record of selection state
                        if (!PersistSelctionArray[UserID]) {
                            //alert('saved index=' + index);
                            PersistSelctionArray[UserID] = true;
                        }

                    }
                }
                else {
                    //To keep record of selection state
                    if (!PersistSelctionArray[UserID]) {
                        //alert('saved index=' + index);
                        PersistSelctionArray[UserID] = true;
                    }
                }

                //To set the selected text
                var grid = $find(sender.ClientID);
                var MasterTable = grid.get_masterTableView();
                var selectedRows = MasterTable.get_selectedItems();
                //alert(selectedRows.length);
                var headerValues = '';
                for (var i = 0; i < selectedRows.length; i++) {
                    var row = selectedRows[i];
                    var cell = MasterTable.getCellByColumnUniqueName(row, "column1")
                    if (headerValues != '')
                        headerValues = headerValues + ',';
                    headerValues = headerValues + cell.textContent;
                }
                var combo = $find(sender.ClientID.replace('_i0_rGrdUsers4DDL', ''));
                //alert('header values='+headerValues);
                combo.set_text(headerValues);
//combo.commitChanges();
                //$('#btnHidden').click();
                //alert(combo.get_text());
            }
            function OnddlEmployeeRowDeSelected(sender, args) {
                //alert('Row DeSelected');

var e = args.get_domEvent(); 
                //IE - srcElement, Others - target 
                var targetElement = e.srcElement || e.target;
                if (typeof (targetElement) != "undefined") {
                    //is the clicked element an input checkbox? <input type="checkbox"...> 
                    if (targetElement.tagName.toLowerCase() != "input" &&
                        (!targetElement.type || targetElement.type.toLowerCase() != "checkbox"))// && currentClickEvent) 
                    {
                        chkbxClicked = false;
                    }
                    else {
                        chkbxClicked = true;
                    }
                }
                else {
                    //args.set_cancel(true);
                }
                //alert('chkbxClicked=' + chkbxClicked);
                var index = args.get_itemIndexHierarchical();
                var UserID = args.getDataKeyValue("UserID");
                if (!chkbxClicked) {
                    if (clickedItemIndex != index) {
                        //args.set_cancel(true);
                        //alert('clickedItemIndex=' + clickedItemIndex + ' index=' + index)
                        args.get_gridDataItem().set_selected(true);
                    }
                    else {
                        //To keep record of selection state
                        if (PersistSelctionArray[UserID]) {
                            //alert('Removed index=' + index);
                            PersistSelctionArray[UserID] = false;
                        }
                    }
                }
                else {
                    //To keep record of selection state
                    if (PersistSelctionArray[UserID]) {
//alert('Removed index=' + index);
                        PersistSelctionArray[UserID] = false;
                    }
                }

                //To set the selected text
                var grid = $find(sender.ClientID);
                var MasterTable = grid.get_masterTableView();
                var selectedRows = MasterTable.get_selectedItems();
                var headerValues = '';
                for (var i = 0; i < selectedRows.length; i++) {
                    var row = selectedRows[i];
                    var cell = MasterTable.getCellByColumnUniqueName(row, "column1")
                    if (headerValues != '')
                        headerValues = headerValues + ',';
                    headerValues = headerValues + cell.textContent;
                }
                var combo = $find(sender.ClientID.replace('_i0_rGrdUsers4DDL', ''));
                combo.set_text(headerValues);
            }

            function OnddlEmployeeRowCreated(sender, args) {
                //var index = args.get_itemIndexHierarchical();
                var UserID = args.getDataKeyValue("UserID");
                if (PersistSelctionArray[UserID]) {
                    args.get_gridDataItem().set_selected(true);
                }
            }

            function OnEmployeeDropdownClosing(sender, args) {
                var e = args.get_domEvent();
                //IE - srcElement, Others - target 
                var targetElement = e.srcElement || e.target;
                if (typeof (targetElement) != "undefined") {
                    if (targetElement.tagName.toLowerCase() == "td")// && currentClickEvent) 
                    {
                        if (clickedItemIndex>-1) {
                            args.set_cancel(true);
                        }
                    }
                }
                else {
                    //args.set_cancel(true);
                }

                clickedItemIndex = -1;
            }

 

 

Zain
Top achievements
Rank 1
 asked on 29 Aug 2018
2 answers
118 views

Hello again

On HtmlChart is there any way to disable the mousewheel zoom in Javascript ? 

I've tried the following but zooming by mousewheel is still enabled, so neither of them worked. I'd appreciate your help.

$find("chart")._options.zoomable.mousewheel = "false";

$find("chart")._options.zoomable.mousewheel = false;

$find("chart")._options.zoomable.mousewheel.set("false");

$find("chart")._options.zoomable.mousewheel.set(false);

Thanks.

 

 

Ahmet
Top achievements
Rank 1
 answered on 28 Aug 2018
1 answer
179 views

Hello,

is it possible to fire custom command name with parameters from client side as it is in RadGrid ? https://www.telerik.com/forums/fire-insert-command-with-arguments-using-jquery-on-hierarchical-grid#8SdCCScqtU2GOs6cr-uJkA

Thank you.

Best regards

Vasssek

Attila Antal
Telerik team
 answered on 28 Aug 2018
2 answers
206 views

     Hi,

I have a gridview inside a RadAjaxPanel. Everything works fine except when a linkbutton onclick event (which is inside the gridview's template column) triggers, loading panel shows up but never hides.

Need urgent help.

Thanks.

Example of the layout

<telerik:RadAjaxPanel runat="server" LoadingPanelID="loadingPanelXYZ">

     <asp:GridView ID="grdXYZ" runat="server" 

           <Columns>
                     <asp:TemplateField HeaderText="XYZ" >
                                <ItemTemplate>
                                        <asp:LinkButton id="lnkXYZ" runat="server" 

Eyup
Telerik team
 answered on 28 Aug 2018
1 answer
356 views

Hi all. I've been using Silverlight Upload for years (Q3/2013), and it works flawlessly. Now there are many browsers preventing SL from being used, so I've built an AJAX ASP.NET (Q3/2013) site to do the trick. It works fine on my development machine (Win 8.1/VS2012SP1/IIS7), but once deployed on our server (Win Srv 8, FW 4.5) the selected filed 2B uploaded remain in a red state. Using Firefox for developers, I've seen an error 404 trying to load WebResources.axd; so I've followed Telerik's suggestion found in this forum to troubleshoot the error, amended config.web file inserting reference to ScriptResource.axd, with no success. Is there anyone who can help me to get rid of this error? TIA

Saverio Tedeschi

Rumen
Telerik team
 answered on 28 Aug 2018
2 answers
86 views

For tri-state TreeView i am trying to check state of 'parent' node.

I tried get_checked() function, but it returns true for both checked and part-checked items

Here is the code just in case:

function rddtRegion_OnClientNodeChecking(sender, args) {

         var region_node = args.get_node();

         if (region_node.get_value().includes('000')) {      // PARENT NODE CHECK

              if (region_node.get_checked()) {        

 Thank you

   

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 28 Aug 2018
5 answers
178 views

Hi,

Can anyone please help me on how to achieve updating of Imagebutton on click using GridTemplateColumn with EditTemplate with Batch edit mode similar to this DropDrownList in this demo? 

 

https://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx

Thanks in advance!

Please help ASAP

 

Siri
Top achievements
Rank 1
 answered on 27 Aug 2018
1 answer
191 views

  How to Increase the Width of ContextMenu Filter in RadGrid

 

   

 

     

  

 

Marin Bratanov
Telerik team
 answered on 27 Aug 2018
5 answers
396 views
I must say I haven't seen anything like this on the forums, but possibly I overlooked a thread or demo. However, I am using a ListView with the following templates: LayoutTemplate, InsertItemTemplate, ItemTemplate, SelectedItemTemplate and EditItemTemplate. An item consists of a LinkButton. See example below:

<asp:LinkButton ID="ItemLinkButton" runat="server" CommandName="Select">
    <%# Eval("Value1") %><br />
    <%# Eval("Value2") %><br />
    <%# Eval("Value3") %><br />
    <%# Eval("Value4") %>
</asp:LinkButton>

where "Value#" is just a string from a certain datasource. As you can see this LinkButton has its CommandName property set to "Select". When you select a single item, the selected item will appear using the SelectItemTemplate (that is with inversed colors as the normal ItemTemplate). But, I have a problem with (de)selecting all items.

This ListView currently contains 2 items. The LayoutTemplate holds a button to select or deselect all items in the ListView. This button is linked through the ItemCommand event ("onitemcommand") with its CommandName property set to "DeSelectAll". In my code-behind I do:

protected void RadListView_ItemCommand(object sender, RadListViewCommandEventArgs e)
{
    if (e.CommandName == "DeSelectAll")
    {
        RadListView rlv = sender as RadListView;
        if (rlv.SelectedItems.Count == rlv.Items.Count)
        {
            foreach (RadListViewDataItem item in rlv.SelectedItems)
            {
                item.Selected = false;
            }
        }
        else
        {
            foreach (RadListViewDataItem item in rlv.Items)
            {
                item.Selected = true;
            }
        }
    }
}

As I said the ListView currently contains 2 items. So whenever the button - to select or deselect all items - is clicked this event is fired. So when you are debugging it looks like it's working, but visually it's far from what you actually want.

Firstly (situation 1), if no item has been preselected (both items are not selected) and you click the button visually nothing happens, while under water (code) the item.Selected properties are changed accordingly. When you click the button for the second time both items change to the SelectedItemTemplate, while under water the item.Selected properties are set back to "false". Notice, you have to click twice in order to get this result.

Secondly (situation 2), if one of two items has been preselected (this works as mentioned earlier) (1) and you click the button visually nothing happens, while under water the item.Selected properties are changed accordingly (both items have their Selected property set to "true") (2). Notice that you can't see any difference visually (the preselected item still is the only visible selected item). Next, click the item - which visually still is the only selected item - and be amazed this item deselects and the other gets selected (3). To make one another clear, let's schematize this:

  1. item 1: selected, item 2: not selected, visibility: item 1 uses SelectedItemTemplate, item 2 uses ItemTemplate
  2. item 1: selected, item 2: selected, visibility: item 1 uses SelectedItemTemplate, item 2 uses ItemTemplate
  3. item 1: not selected, item 2: selected, visibility: item 1 uses ItemTemplate, item 2 uses SelectedItemTemplate

As you can see, step 2 is the problem. The property "Selected" for both items is set to "true", but visually item 2 is not using the correct template. Instead of using ItemTemplate it should be using SelectedItemTemplate. Notice that in both situations you have to click twice to visually get a result.

Any thoughts or suggestions on how to select or deselect all items in a ListView?

Thanks in advance.

Regards,
Datamex
Marin Bratanov
Telerik team
 answered on 27 Aug 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?