Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
153 views

Hello all!

 

I have a RadGrid with BatchEdit mode. 

I need take the client side value of some cells when users update the grid.

But when i check the values of the cells in onUpdate or onItemUpdate event of RadGrid I can only acces to old values. How i can get the client side values of the edited cells?

 

Thanks you for your time!!!

Marc
Top achievements
Rank 1
 answered on 20 Oct 2016
3 answers
258 views
Hi,  in my radwizard,  I have multile steps with different groups.  I try to find a way to bypass the validation when I press "previous" button.  There is no way I can hit previous without my required field validator interrupting me.

I found a thread where you ask to add the following javascript :
function OnClientButtonClicking(sender, args) {
                if (sender.get_activeIndex() > args.get_nextActiveStep().get_index()) {
                     args.set_cancel(true);
                     sender.set_activeIndex(args.get_nextActiveStep().get_index());
                 }
            }
When I debug,  I can see the script is called but there is something else preventing the page from going to the previous one.  Required field validator kicks in as soon as I hit previous.
Thank you for your help
Veselin Tsvetanov
Telerik team
 answered on 20 Oct 2016
5 answers
779 views
(1) In a multi-column RadCombo, is there some way to get a value from the selected row (which is not the SelectedValue and not the SelectedText)? Client-side preferred.

(2) In a multi-column RadCombo, is there some way to get the input area to display in columns matching the dropdown?
Peter Milchev
Telerik team
 answered on 20 Oct 2016
7 answers
103 views

Hi,

We are using a workaround, once provided by you, to decorate checkboxes in treeview.

This was working fine until the new 2016 Q3 release...

In IE11, the hack doesn't work anymore, all other browsers are working!

The problem is that after a postback, all checked nodes are unchecked in IE11!

Is there an other workaround available, or can I do anything to make this work in IE11 again?

The workaround that work in previous versions looked like this:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="treeview.aspx.vb" Inherits="TestaTredjepartWeb.treeview" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="s" runat="server">
        </asp:ScriptManager>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function pageLoad()
                {
                    var $ = $telerik.$;
                    var tree = $('#<%= RadTreeView1.ClientID %>');
                    var decorator = $find('<%= RadFormDecorator1.ClientID %>');
 
                    var boxes = $('input[type*=checkbox]');
 
                    boxes.removeAttr('class');
 
 
                    decorator.decorate(document.documentElement);
                    boxes.addClass('rtChk');
 
 
                }
 
                //Workaround 1 - attach to the OnClientNodeChecking event and manually set the decorator classes:
 
                function OnClientNodeChecking(sender, args)
                {
                    var decoratedCheckBox = $telerik.$(args.get_node().get_element()).find('input.rfdRealInput').next()[0];
                    if (decoratedCheckBox.className.indexOf("Unchecked") != -1)
                    {
                        decoratedCheckBox.className = "rfdCheckboxChecked";
                    } else
                    {
                        decoratedCheckBox.className = "rfdCheckboxUnchecked";
                    }
                }
 
 
                //Workaround 2 - remove the preventDefault() method of the TreeView when the checkbox is decorated ($target[0].id.indexOf("RadFormDecorator") == -1):
 
 
                //Telerik.Web.UI.RadTreeView.prototype._preventLabelDefault = function (nodeElement, e) {
                //    $ = $telerik.$;
                //    var target = $telerik.getTouchTarget(e),
                //        $target = $(target),
                //        targetIsLabelDescendant = $(nodeElement).find("label").eq(0).has(e.target).length !== 0;
 
                //    //We should not prevent the default when the target is a link or the checkbox itself.
                //    //Also when the target is not a direct descendant of the label, which is the case when templates are used.
                //    if (targetIsLabelDescendant && $target[0].id.indexOf("RadFormDecorator") == -1 && !$target.is("a") && !$target.is("input")) {
                //        e.preventDefault();
                //    }
                //};
            </script>
        </telerik:RadCodeBlock>
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="Default" />
        <div>
            <telerik:RadTreeView ID="RadTreeView1" runat="server" RenderMode="Lightweight" CheckBoxes="true" OnClientNodeChecking="OnClientNodeChecking">
                <Nodes>
                    <telerik:RadTreeNode Text="aaa">
                        <Nodes>
                            <telerik:RadTreeNode Text="123" />
                            <telerik:RadTreeNode Text="234" />
                            <telerik:RadTreeNode Text="345" />
                            <telerik:RadTreeNode Text="456" />
                            <telerik:RadTreeNode Text="567" />
                        </Nodes>
                    </telerik:RadTreeNode>
                </Nodes>
            </telerik:RadTreeView>
            <asp:Button ID="Button1" runat="server" Text="Click to do postback" />
        </div>
    </form>
</body>
</html>

 

Regards
Andreas

Danail Vasilev
Telerik team
 answered on 20 Oct 2016
3 answers
95 views

I had a grid which I would like to sort. However, it appears (and acts like) sorting is not enabled.

1st Quarter 2016

Here is my grid definition. There is quite a bit going on in the code behind, as this grid is datasource driven. I have code in prerender, itemcreated, columncreated and needdatasource, but nothing I can determine would affect the sort capabilities.

 

<telerik:RadGrid
ID="grdReportRecords"
runat="server"
RenderMode="Lightweight"
width="99%"
AllowSorting="True"
AllowMultiRowSelection="True"
AllowFilteringByColumn="true"
OnNeedDataSource="grdReportRecords_NeedDataSource"
ActiveItemStyle-BackColor="Yellow"
GroupPanelPosition="Top"
Skin="Silk">
<GroupingSettings
CollapseAllTooltip="Collapse all groups"
CaseSensitive="false">
</GroupingSettings>
<ClientSettings>
<Selecting
AllowRowSelect="true" />
<%--<Resizing AllowResizeToFit="true"
AllowColumnResize="true"
ResizeGridOnColumnResize="true"/>--%>
<ClientEvents
OnColumnCreated="ColumnCreated">
</ClientEvents>
</ClientSettings>
<ExportSettings
ExportOnlyData="True"
HideStructureColumns="True">
<Excel Format="Xlsx" />
</ExportSettings>
<MasterTableView
AllowMultiColumnSorting="true"
DataKeyNames="ReqID"
AllowSorting="true"
AllowFilteringByColumn="true"
CommandItemDisplay="top">
<CommandItemSettings
ShowAddNewRecordButton="false"
ShowExportToExcelButton="true"
ShowRefreshButton="False" />
<Columns>
<telerik:GridHyperLinkColumn
DataNavigateUrlFields="ReqID, RequestTypeAbbrev"
DataNavigateUrlFormatString="javascript:ShowEditForm({0}, '{1}')"
ImageUrl="images/view.gif"
UniqueName="GridLink_Edit"
HeaderText="View"
AllowFiltering="False">
<HeaderStyle HorizontalAlign="Center" width="40"/>
<ItemStyle HorizontalAlign="Center" width="40"/>
</telerik:GridHyperLinkColumn>
<telerik:GridClientSelectColumn
UniqueName="ClientSelectColumn">
<HeaderStyle HorizontalAlign="Center" width="40"/>
<ItemStyle HorizontalAlign="Center" width="40"/>
</telerik:GridClientSelectColumn>
<%--<telerik:GridTemplateColumn UniqueName="Select">
<HeaderTemplate>
<asp:CheckBox ID="chkView1" runat="server" onclick="selectall_clicked(this)" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkView" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>--%>
<%--<telerik:GridTemplateColumn
UniqueName="View"
AllowFiltering="false">
<HeaderTemplate>
<asp:CheckBox
ID="chkView1"
runat="server"
onclick="return selectall_clicked(this);" />
<telerik:RadCheckBox ID="chkView1" runat="server" />
</HeaderTemplate>
<FilterTemplate>

</FilterTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkView" runat="server" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</telerik:GridTemplateColumn>--%>
</Columns>
</MasterTableView>
<ClientSettings>
<ClientEvents OnColumnCreated="ColumnCreated" />
</ClientSettings>
<ActiveItemStyle BackColor="Yellow">
</ActiveItemStyle>
</telerik:RadGrid>

 

Could you please help?

 

 

Kostadin
Telerik team
 answered on 20 Oct 2016
1 answer
206 views
ASPX Page 

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
       <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="gvResourceActivity">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="gvResourceActivity" 
                       LoadingPanelID="RadAjaxLoadingPanel1" />
               </UpdatedControls>
           </telerik:AjaxSetting>
       </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" MinDisplayTime="1000"
        Transparency="10" BackColor="#EFEFEF">
        <img alt="Loading..." src="../../Images/ajax-loader.gif" style="width: 100px; height: 100px;
            border: 0px;" />
        <p style="color: Blue;">
            Please wait! while your request is being processed.</p>
    </telerik:RadAjaxLoadingPanel>

<telerik:RadGrid ID="gvResourceActivity" runat="server" 
                    AllowFilteringByColumn="True" AllowSorting="True" AllowPaging="True" PageSize="50"
                    AutoGenerateColumns="False" Height="600px" EnableLinqExpressions="false" 
                    Skin="Simple" onitemcommand="gvResourceActivity_ItemCommand" 
                        onitemcreated="gvResourceActivity_ItemCreated" 
                        onneeddatasource="gvResourceActivity_NeedDataSource">
                    <ClientSettings EnableRowHoverStyle="true">
                        <Scrolling UseStaticHeaders="true" AllowScroll="true" SaveScrollPosition="true" />
                        <Selecting AllowRowSelect="true" />
                    </ClientSettings>
                    <PagerStyle AlwaysVisible="true" />
                    <ExportSettings ExportOnlyData="true" FileName="ESR Detail List" IgnorePaging="true"
                        OpenInNewWindow="true" Excel-Format="ExcelML">
                    </ExportSettings>
                    <MasterTableView TableLayout="Fixed">
                        <Columns>
                            <telerik:GridBoundColumn UniqueName="BusinessUnitName" DataField="BusinessUnitName"
                                HeaderText="Business Unit" HeaderStyle-Wrap="false" ItemStyle-Wrap="false">
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="rcmbBusinessUnit" runat="server" Filter="Contains" NoWrap="true"
                                        DropDownAutoWidth="Enabled" Height="200px" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("BusinessUnitName").CurrentFilterValue %>'
                                        OnClientSelectedIndexChanged="BUIndexChanged" Width="95%">
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="radscriptBusinessUnitCombo" runat="server">
                                        <script type="text/javascript">
                                            function BUIndexChanged(sender, args) {
                                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                tableView.filter("BusinessUnitName", args.get_item().get_value(), "Contains");
                                            }
                                        </script>
                                    </telerik:RadScriptBlock>
                                </FilterTemplate>
                            </telerik:GridBoundColumn>
                        </Columns>
                        <CommandItemStyle Height="40px" />
                        <ItemStyle HorizontalAlign="Left" />
                        <AlternatingItemStyle HorizontalAlign="Left" />
                        <HeaderStyle HorizontalAlign="Left" />
                    </MasterTableView>
                </telerik:RadGrid>



Code Page


    private string strBU_Id = null, strFromDate = "10-01-2015", strToDate = "09-30-2016", strWOID = null, strLIID = null, strTeamID = null, strUserID = null;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            BindResourceActivity();
            gvResourceActivity.DataBind();
        }
    }
    private void BindResourceActivity()
    {
        objProperties = new OMSDetailsProperties();
        if (!String.IsNullOrEmpty(strBU_Id))
            objProperties.iBusinessUnit = Convert.ToInt32(strBU_Id);
        else
            objProperties.iBusinessUnit = 0;

        if (!String.IsNullOrEmpty(strTeamID) && strTeamID != "0")
            objProperties.strTeamId = strTeamID;
        else
            objProperties.strTeamId = "";

        if (!String.IsNullOrEmpty(strUserID))
            objProperties.UserId = Convert.ToInt32(strUserID);
        else
            objProperties.UserId = 0;

        if (!string.IsNullOrEmpty(strFromDate))
            objProperties.DateFrom = strFromDate;
        else
            objProperties.DateFrom = "";

        if (!string.IsNullOrEmpty(strToDate))
            objProperties.DateTo = strToDate;
        else
            objProperties.DateTo = "";

        if (strWOID != string.Empty)
            objProperties.WorkOrderId = Convert.ToInt32(strWOID);
        else
            objProperties.WorkOrderId = 0;

        if (strLIID != string.Empty)
            objProperties.LineItemId = Convert.ToInt32(strLIID);
        else
            objProperties.LineItemId = 0;


        objWorkOrder = new WorkOrderBAL();
        DataTable dt = objWorkOrder.ReportResourceActivity(objProperties);


        gvResourceActivity.DataSource = dt;

    }
    
    protected void gvResourceActivity_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        BindResourceActivity();
    }
    protected void gvResourceActivity_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridFilteringItem)
        {
            GridFilteringItem filterItem = e.Item as GridFilteringItem;
            RadComboBox cmbBusinessUnit = filterItem.FindControl("rcmbBusinessUnit") as RadComboBox;

            BindBusinessUnit(cmbBusinessUnit);
        }

    }
    private void BindBusinessUnit(RadComboBox cmbBusinessUnit)
    {

        DataTable dtBusinessUnit = new DataTable();
        objWorkOrder = new WorkOrderBAL();
        objProperties = new OMSDetailsProperties();
        objProperties.RoleName = Session["Role"].ToString().Trim();
        objProperties.UserId = Convert.ToInt32(Session["UserId"].ToString().Trim());
        objProperties.WorkOrderType = "OE";
        objProperties.UserTypeId = Convert.ToInt32(Session["UserType"].ToString().Trim());
        dtBusinessUnit = objWorkOrder.GetBusinessUnitName(objProperties);
        DataRow dr = dtBusinessUnit.NewRow();
        dr[0] = 0;
        dr[1] = "All";
        dtBusinessUnit.Rows.InsertAt(dr, 0);
        cmbBusinessUnit.DataTextField = "BusinessUnitName";
        cmbBusinessUnit.DataValueField = "BusinessUnitId";
        cmbBusinessUnit.DataSource = dtBusinessUnit;
        cmbBusinessUnit.DataBind();
    }

    protected void gvResourceActivity_ItemCommand(object sender, GridCommandEventArgs e)
    {
        string gridMessage1 = null;

        if (e.CommandName == RadGrid.FilterCommandName)
        {
            Pair filterPair = (Pair)e.CommandArgument;

            gridMessage1 = "Current Filter function: '" + filterPair.First + "' for column '" + filterPair.Second + "'";

            switch (filterPair.Second.ToString())
            {
                case "BusinessUnitName":
                    RadComboBox cmbBusinessUnit = (e.Item as GridFilteringItem)[filterPair.Second.ToString()].Controls[1] as RadComboBox;
                    strBU_Id = cmbBusinessUnit.SelectedItem.Value;
                    break;

            }


            gvResourceActivity.Rebind();
        }
    }
Pavlina
Telerik team
 answered on 20 Oct 2016
15 answers
407 views

Hi,

We are using Radgrid with Frozen. It was woking correctly before version. but now Chrome updated version it behave differently. we can not change manually all the grid even if we have soloution. because whole website we used that Radgrid with Frozen option. Please check and let us know is there any global fix. 

This is very urgent and all clients complaint about this weired issue, I have attached screen shot Please help us

 

Thanks,

 

 

 

Pavlina
Telerik team
 answered on 20 Oct 2016
2 answers
149 views

Hi,

 

I have a dynamically created grid, it has column groups and in each group is lets say column A, B, C, D

These columns have different dates to make up their unique name.

so we could have  201601-A, 201601-B, 201601-C, 201601-D      201602-A, 201602-B, 201602-C, 201602-D

This causes issues when trying to use the context menu to hide show columns as it displays each unique column, the user would like to hide/show all "A"'s or "B"'s etc.. 

I would like to give them a check box outside the grid and allow them to select what columns types (A or B or C or D) to hide show. 

Is this possible?

 

Thanks for your help

Eyup
Telerik team
 answered on 20 Oct 2016
3 answers
117 views

Hi, I've implemented the radWizard. 

 

When I add "OnActiveStepChanged="RadWizardEntreprise_ActiveStepChanged",  backend code will be called for every step changed.  However,  doing this will mess my navigation bar.  All stepe become grayed out except step 1.

 

Hete is my code front end :

<telerik:RadWizard RenderMode="Auto" ID="RadWizardEntreprise" CssClass="RadWizardEntreprise" runat="server" OnClientLoad="OnClientLoad" OnClientButtonClicking="OnClientButtonClicking" OnActiveStepChanged="RadWizardEntreprise_ActiveStepChanged">
            <WizardSteps>            
                <telerik:RadWizardStep ID="EtapeContractantInfoBase" runat="server" Title="Vos Informations Personnelles" CausesValidation="true" ValidationGroup="InfosBase">
                    <uc1:CtlContractantInfosBase runat="server" ID="CtlContractantInfosBase" />    
                </telerik:RadWizardStep>
                <telerik:RadWizardStep ID="EtapeContractantAdresse" runat="server" Title="Votre Adresse" CausesValidation="true" ValidationGroup="InfosContractantAdresse">
                    <uc1:CtlContractantAdresse runat="server" ID="CtlContractantAdresse" />    
                </telerik:RadWizardStep>
                <telerik:RadWizardStep ID="EtapeContractantContact" runat="server" Title="Contact" CausesValidation="true" ValidationGroup="InfosContractantContact">
                    <uc1:CtlContractantContact runat="server" ID="CtlContractantContact" />    
                </telerik:RadWizardStep>
                <telerik:RadWizardStep ID="EtapeEntrepriseInfoBase" runat="server" Title="L'Entreprise" ValidationGroup="EntrpriseInformationsBase">
                    <uc1:CtlEntrepriseInformationsBase runat="server" ID="CtlEntrepriseInformationsBase" />    
                </telerik:RadWizardStep>
                <telerik:RadWizardStep ID="EtapeEntrepriseCouverture" runat="server" Title="Couverture" ValidationGroup="EntrepriseCouverture">
                    <uc1:CtlEntrepriseCouverture runat="server" ID="CtlEntrepriseCouverture"/>
                </telerik:RadWizardStep>
                <telerik:RadWizardStep ID="EtapeAbonnement" runat="server" Title="Abonnement" ValidationGroup="Abonnement">
                    <uc1:CtlAbonnements runat="server" ID="CtlAbonnements" />
                    <uc1:CtlNotes runat="server" ID="CtlAbonnements1" />                    
                </telerik:RadWizardStep>
            </WizardSteps>
        </telerik:RadWizard>

 

and my backend code that does nothing for now :

    protected void RadWizardEntreprise_ActiveStepChanged(object sender, EventArgs e)
    {
        int activeStepIndex = (sender as RadWizard).ActiveStep.Index;
    }

 

So question is why my progress bar become grayed out when I add the server side binding.

 

Thank you!

 

 

Ivan Danchev
Telerik team
 answered on 20 Oct 2016
5 answers
709 views

Hello!

I'm having an issue with the RadComboBox control. I have noticed that when there are 2 items that have the same name, let's call them "Combo1", the event SelectedIndexChanged doesn't fire if the user is selecting the second "Combo1" while the current selection is the first "Combo1", or viceversa.

Here's a sample with which I've reproduced the issue:

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
    
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:scriptmanager runat="server"></asp:scriptmanager>
        
        <telerik:RadComboBox id="ComboBox1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ComboBox1_SelectedIndexChanged">
        <Items>
            <telerik:RadComboBoxItem Text="Combo1" />
            <telerik:RadComboBoxItem Text="Combo2" />
            <telerik:RadComboBoxItem Text="Combo1" />            
        </Items>
        </telerik:RadComboBox>
    </form>
</body>
</html>

 

using System;
using System.Web.UI;

namespace WebApplication2
{
    public partial class WebForm1 : Page
    {
        protected void ComboBox1_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
        }
    }
}

 

Am I doing something wrong or is this a bug? Is there a workaround that I could use in order to get it to work properly?

Best Regards,

Andrei

Anton
Telerik team
 answered on 20 Oct 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?