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

hi,

i want to replace name of serie from the 1st to the 2ed palce cheek the pic to understading 

plz help me 

EssMus
Top achievements
Rank 1
 answered on 30 Apr 2015
14 answers
1.1K+ views

We recently upgraded to the lates version of Telerik Ajax Controls (from 2010 Q2), and have an issue with the ComboBox.

We are dynaimcally loading user controls that contains comboboxes with autopostback set to true.
The problem is that the comboboxes selected values are lost on postback.

This works well when we use the old dll (2010 Q2).

I have tried the dll from Q3 2011 and i have the same problem with that.
Do you have any idea what would cause this?

Regards, Richard

Here is the code for the aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Modules_DEV_ComboboxBug_Default" %>
<%@ Register src="WebUserControl.ascx" tagname="WebUserControl" tagprefix="uc" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="rsm"></telerik:RadScriptManager>
    <div>
        <asp:PlaceHolder runat="server" ID="phContent" />
    </div>
    </form>
</body>
</html>

aspx.cs:

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
public partial class Modules_DEV_ComboboxBug_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
WebUserControl uc = (WebUserControl)Page.LoadControl("WebUserControl.ascx");
uc.ID = "WebUserControl";
phContent.Controls.Add(uc);
}
}

ascx:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
 
<telerik:radComboBox runat="server" ID="RadComboBox1" AutoPostBack="true">
</telerik:radComboBox>
<telerik:radComboBox runat="server" ID="RadComboBox2" AutoPostBack="true">
</telerik:radComboBox>

ascx.cs:

using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class WebUserControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string[] dataSource = new string[] {"UnSelected", "First", "Second", "Third" };
        RadComboBox1.DataSource = dataSource;
        RadComboBox1.DataBind();
 
        RadComboBox2.DataSource = dataSource;
        RadComboBox2.DataBind();
    }
}
Martin Rouen
Top achievements
Rank 1
 answered on 30 Apr 2015
1 answer
330 views

I have my Radgrid defined with the master table in Batch mode as follows:

<telerik:RadGrid ID="EventSubjects" CssClass="eventSubjectsGrid" ShowStatusBar="true"
    AutoGenerateColumns="False" GridLines="Both" AllowPaging="True"
    PagerStyle-AlwaysVisible="true"
    OnNeedDataSource="EventSubjects_NeedDataSource"
    OnBatchEditCommand="EventSubjects_BatchEditCommand"
    Skin="Sunset"
    runat="server" GroupPanelPosition="Top">
    <ClientSettings AllowKeyboardNavigation="true">
        <Selecting AllowRowSelect="True" />
        <ClientEvents OnCommand="gridCommand" />
    </ClientSettings>
    <ValidationSettings EnableValidation ="true" CommandsToValidate="PerformInsert,Update,UpdateEdited,saveChanges,BatchEdit"></ValidationSettings>
    <MasterTableView EditMode="Batch" CommandItemDisplay="Bottom" DataKeyNames="PhotoSubjectID,EventPhotoSubjectID,EventPhotoSessionID">
        <BatchEditingSettings EditType="Cell" />

In the ClientEvents OnCommand js function I am trying to the the Data Key for the current DataGridItem, but it comes back null (rowPhotoSessionID . When I check the masterTableView, masterTable.get_clientDataKeyNames(), it returns an empty array.

        function gridCommand(sender, args) {
            if (args.get_commandName() == "BatchEdit") {
                var masterTable = sender.get_masterTableView();
                var batchManager = sender.get_batchEditingManager();
                var dataItems = masterTable.get_dataItems();
                var validationFails = false;
 
                for (var i = 0; i < dataItems.length; i++) {
                    var barcodeCell = dataItems[i].get_cell("Barcode");
                    var barcodeValue = batchManager.getCellValue(barcodeCell);
                    var rowPhotoSessionID = dataItems[i].getDataKeyValue("PhotoSubjectID");
.
.
.

How do I get the DataKeys for the current DataGridRow in this situation?

In case you are wondering, I am trying to do validation when the user clicks the 'Save Changes' button in BatchEdit mode, by passing the barcodes on the page to the server in an ajax call, and then update the cells that are invalid. So, I need both the barcode value and the PhotoSubjectID so that I can tell which barcodes changed.

 I looked all over to find a property or method that would return me JUST the edited data values, I found this forum entry Batch Editing - Need to have the save changes button outside the grid , that said that this internal collection has the edited data, but did not recommend using it. 

$find('RadGrid1').get_batchEditingManager()._changes

 Is there some other way, in BatchEdit mode to get the edited values on the Client side so that I can do validation?

Viktor Tachev
Telerik team
 answered on 30 Apr 2015
1 answer
43 views

I have the need to either, create my own GrandTotal column to the right of the grid or .. allow me to show a PivotGridRowField to the right of the report. 

 

Here are my fields (that are displayed as columns): 

PivotGridColumnFIeld: Period

PivotGridAggregateFields: Plan, Actual

 

I want to add a column that is a percentage of Actual / Plan but I only want this column to show at the end in the GrandTotals section? Is there any way to do this?

 

Also, is there anyway to display PivotGridRowFields to the right of the GrandTotal columns?

 

Thanks,

 

 

 

 

 

Konstantin Dikov
Telerik team
 answered on 30 Apr 2015
4 answers
79 views

Hello,

I'm using a RadAjaxManager to perform an async request to the code behind. With Chrome, the page jumps to the top and then returns to the original scroll location. I'm kicking off the request via the change event of a Kendo UI DatePicker. The event calls the ajaxRequestWithTarget js function from the RadAjaxManager. Sometimes is takes 1 or 2 calendar date changes for this behavior to start. This behavior only happens with Chrome (42.0.2311.90 m). Below is an example.

Browser: Chrome (42.0.2311.90 m)

Dev Environment: Visual Studio 2013

Telerik Version: UI for ASP.NET AJAX Q1 2015

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="RadAjaxManagerIssue.Test" %><br><!DOCTYPE html><br><br><html xmlns="http://www.w3.org/1999/xhtml"><br>    <br><head runat="server"><br>    <title></title><br>    <script src="//code.jquery.com/jquery-1.9.1.min.js"></script><br>    <script src="http://cdn.kendostatic.com/2015.1.318/js/kendo.ui.core.min.js"></script><br>    <link href="http://cdn.kendostatic.com/2015.1.318/styles/kendo.common.min.css" rel="stylesheet" type="text/css" /><br>    <link href="http://cdn.kendostatic.com/2015.1.318/styles/kendo.default.min.css" rel="stylesheet" type="text/css"/><br></head><br><br><body>    <br>    <form id="form1" runat="server"><br>              <br>        <div><br>            <telerik:RadScriptManager   ID="rsm" runat="server"> </telerik:RadScriptManager><br>        <br>            <div style="padding-top: 1500px;"><br>                <input id="txtMonth" runat="server" /><br>                <asp:CustomValidator ID="valMonthPicker" ControlToValidate="txtMonth" ClientValidationFunction="IsValidDate" Text="*" runat="server"><br>                </asp:CustomValidator><br>                <input id="txtUpdatedControl" runat="server" />   <br>            </div><br>        </div><br>        <br>        <telerik:RadAjaxManager ID="ram" runat="server"><br>            <AjaxSettings><br>                <telerik:AjaxSetting AjaxControlID="txtMonth"><br>                    <UpdatedControls><br>                        <telerik:AjaxUpdatedControl ControlID="txtUpdatedControl" /><br>                    </UpdatedControls><br>                </telerik:AjaxSetting><br>            </AjaxSettings><br>        </telerik:RadAjaxManager><br>        <br>        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"><br>            <script type="text/javascript">              <br>                function InitiateAsyncRequest() {<br>                    $find('ram').ajaxRequestWithTarget('txtMonth', '');<br>                    return false;<br>                }<br><br>                function IsValidDate(source, args) {<br>                    var datePicker = $('#txtMonth').data('kendoDatePicker');<br>                    var date = datePicker.value();<br>                    var format = datePicker.format;<br>                    args.IsValid = kendo.parseDate(date, format);<br>                }<br><br>                $('#txtMonth').kendoDatePicker({<br>                    start: 'year',<br>                    depth: 'year',<br>                    format: 'MM/yyyy',<br>                    change: InitiateAsyncRequest<br>                });<br>            </script><br>        </telerik:RadCodeBlock><br>    </form><br></body><br></html>

Konstantin Dikov
Telerik team
 answered on 30 Apr 2015
1 answer
145 views
on RadHtmlChart - I have my legend on the right side - is it possible in any way to add header(s) to it? just the legend part.
Danail Vasilev
Telerik team
 answered on 30 Apr 2015
1 answer
139 views

Hi there,

How can I select a cell by using Javascript? I found a method to clear all selected cells but it seems there is not way to select / deselect a single cell on client side.

Please can you help me?

Thank you and regards,
Dan

Konstantin Dikov
Telerik team
 answered on 30 Apr 2015
3 answers
76 views

Hi,

I can't see the tool "InsertExternalVideo". I have no ToolsFile.xml

What am i missing?

 

 

Vessy
Telerik team
 answered on 30 Apr 2015
1 answer
140 views

Hi,

 I'm using a 2012 Version of the Telerik DLL (2012.1.411.40 - v4.0.30319)  - due to comparability with an older integrated project (basically when I use the new DLL- combo boxes start looking really weird)

 I have a RadGrid with a TreeList Control in it. The TreeList is AJAX enabled. Everytime the TreeList does an AJAX call, if I leave my mouse on the control I get a Javascript: "Error: Unspecified Error" error. The error does not occur if I move my mouse off the control after clicking. Some sort of mouseover event is conflicting with the AJAX call and causing errors. 

 This is ONLY occurring in IE 11. Earlier versions of IE, no problem. Chrome, no problem.

 Attached find an image of the debugger with the javascript call stack, an image of the error itself.

 Anyone know what's causing this? Or had this happen before?

Code:

The Control .ascx

01.<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="StandAlone.ascx.cs" Inherits="DDW.DA2_Clients.StandAlone" %>
02.<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
03. 
04. 
05.<telerik:RadAjaxManager ID="RadAjaxManagerBoundaryDefinitions" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanelBoundaryDefinitions">
06.    <AjaxSettings>
07.        <telerik:AjaxSetting AjaxControlID="AreaJurTreeList">
08.            <UpdatedControls>
09.                <telerik:AjaxUpdatedControl ControlID="AreaJurTreeList" />
10.            </UpdatedControls>
11.        </telerik:AjaxSetting>
12.        <telerik:AjaxSetting AjaxControlID="AreaJurTreeListEdit">
13.            <UpdatedControls>
14.                <telerik:AjaxUpdatedControl ControlID="AreaJurTreeListEdit" />
15.            </UpdatedControls>
16.        </telerik:AjaxSetting>
17.    </AjaxSettings>
18.</telerik:RadAjaxManager>
19. 
20.<telerik:RadGrid ID="BoundaryDefinitionDetailsGrid" AutoGenerateColumns="false" OnNeedDataSource="BoundaryDefinitionDetailsGrid_NeedDataSource" Width="100%" runat="server"
21.                 ViewStateMode="Enabled" BorderStyle="None"
22.                 AllowPaging="false" GridLines="None" MasterTableView-GridLines="None">
23.    <MasterTableView BorderStyle="None" NoMasterRecordsText="No Boundary Definition match these attributes" ShowHeadersWhenNoRecords="false" EditMode="InPlace"
24.                     DataKeyNames="BoundaryDefinitionId, BoundaryName">
25.        <Columns>
26.            <telerik:GridTemplateColumn UniqueName="BoundaryDefDetailsCol">
27.                <ItemTemplate>
28.                    <h2>Boundary Definition Details</h2>
29.                    <div class="container">
30.                        <div class="text-inputs">
31.                            <div class="left-column-controls">
32.                                <asp:Label ID="BoundaryIdLabelEdit" runat="server" CssClass="DetailsLabel">Boundary ID:</asp:Label>
33.                                <telerik:RadTextBox ID="BoundaryIdTextboxEdit" runat="server" Width="100px" Enabled="true" Text="Sample Text Bound to something" />                              
34.                            </div>
35.                            <div class="right-column-controls">
36.                                <asp:Label ID="Label1" runat="server" CssClass="DetailsLabel">Boundary ID:</asp:Label>
37.                                <telerik:RadTextBox ID="RadTextBox1" runat="server" Width="100px" Enabled="true" Text="Sample Right Text Bound to something" />
38.                            </div>
39.                        </div>
40.                        <div id="areajurtreelist">
41.                            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelBoundaryDefinitions" runat="server" HorizontalAlign="Center" IsSticky="true" Style="position: static" Transparency="10">
42.                                <asp:Image ID="Image1" Style="border: 0px" alt="working..." runat="server" ImageUrl="~/Images/loading.gif" />
43.                            </telerik:RadAjaxLoadingPanel>
44.                            <telerik:RadTreeList ID="AreaJurTreeList" runat="server" OnNeedDataSource="AreaJurTreeList_NeedDataSource"
45.                                ParentDataKeyNames="Area" DataKeyNames="Code" AllowPaging="false" ClientSettings-Scrolling-AllowScroll="true"
46.                                AutoGenerateColumns="false" AllowSorting="true" OnItemDataBound="AreaJurTreeList_ItemDataBound" Height="500"
47.                                BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px"
48.                                HeaderStyle-BorderColor="Gray" HeaderStyle-BorderWidth="1px" HeaderStyle-BorderStyle="Solid" >
49.                                <Columns>
50.                                    <telerik:TreeListBoundColumn DataField="Code" UniqueName="Code" HeaderText="Code" Visible="false" />          
51.                                    <telerik:TreeListBoundColumn DataField="Area" UniqueName="Area" HeaderText="Area ID" Visible="false" />           
52.                                        <telerik:TreeListTemplateColumn DataField="Description" UniqueName="Description" HeaderText="Description">
53.                                        <ItemTemplate>
54.                                            <asp:Label ID="AreaJurNameEdit" runat="server" Text='<%# Eval("Description")%>'>
55.                                            </asp:Label>
56.                                        </ItemTemplate>
57.                                    </telerik:TreeListTemplateColumn>
58.                                    <telerik:TreeListTemplateColumn>
59.                                        <ItemTemplate>
60.                                            <asp:CheckBox ID="CheckBoxEdit" runat="server" AutoPostBack="true" />
61.                                        </ItemTemplate>
62.                                    </telerik:TreeListTemplateColumn>       
63.                                </Columns>
64.                            </telerik:RadTreeList>
65.                        </div>
66.                    </div>
67.                </ItemTemplate>
68.            </telerik:GridTemplateColumn>
69.        </Columns>
70.    </MasterTableView>
71.</telerik:RadGrid>

 The Control Code Behind:

 

01.using System;
02.using System.Collections.Generic;
03.using System.Linq;
04.using System.Web;
05.using System.Web.UI;
06.using System.Web.UI.WebControls;
07.using DDW.Core;
08.using DDW.ServiceReference;
09.using Telerik.Web.UI;
10. 
11.namespace DDW.DA2_Clients
12.{
13.    public partial class StandAlone : System.Web.UI.UserControl
14.    {
15.        DDW.ServiceReference.ServiceDDWClient Svc;
16.        protected void Page_Load(object sender, EventArgs e)
17.        {
18. 
19.        }
20.        protected void AreaJurTreeList_NeedDataSource(object sender, TreeListNeedDataSourceEventArgs e)
21.        {
22. 
23.            //may not need, handled at Grid Level
24.            var RadTreeList = sender as RadTreeList;
25.            RadTreeList.DataSource = GetAttributes();
26. 
27.        }
28.        private List<Jurisdiction> GetAttributes()
29.        {
30.            Svc = new ServiceDDWClient();
31. 
32.            List<Jurisdiction> AreaJurs = new List<Jurisdiction>();
33.            List<AssessmentArea> Areas;
34.            try
35.            {
36.                Areas = Svc.GetAreasListWithFN();
37. 
38.                foreach (AssessmentArea Ass in Areas)
39.                {
40.                    Jurisdiction Temp = new Jurisdiction();
41.                    Temp.Code = Ass.Code;
42.                    Temp.Description = Ass.LongDescription;
43.                    Temp.Area = null;
44. 
45.                    //Safe to use this roll year? Will it always be current in Prod?
46.                    Temp.RollYear = Ass.RollYear.ToString();
47.                    Temp.ShortName = null;
48. 
49.                    AreaJurs.Add(Temp);
50.                    List<Jurisdiction> TempJurs;
51. 
52.                    //Get all jurs for the area and add them to the list as well.
53.                    TempJurs = Svc.GetJurisdictionsListGivenArea(Ass.Code, Ass.RollYear.ToString());
54. 
55.                    AreaJurs.AddRange(TempJurs);
56. 
57.                }
58.            }
59.            catch (Exception ex)
60.            {
61.                Svc.Abort();
62.                throw new Exception("An Error has occured retrieving the list of Areas: Fault Execption Details from the Web Service: " + ex.ToString());
63.            }
64.            finally
65.            {
66.                Svc.Close();
67.            }
68. 
69.            return AreaJurs;
70.        }
71.        protected void AreaJurTreeList_ItemDataBound(object sender, TreeListItemDataBoundEventArgs e)
72.        {
73.        }
74.        protected void BoundaryDefinitionDetailsGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
75.        {
76.            Svc = new ServiceDDWClient();
77.            BoundaryDefinitionDetailsGrid.DataSource = GetBoundaryDefinition();
78. 
79.        }
80.        private List<BoundaryDefinition> GetBoundaryDefinition()
81.        {
82.            List<BoundaryDefinition> ListOfDefs = new List<BoundaryDefinition>();
83.            BoundaryDefinition test = new BoundaryDefinition("BoundDefId", "Port Clements (Village of)", 203, "Fee Paying", true, DateTime.Now, DateTime.Today, "Fergasun");
84.            ListOfDefs.Add(test);
85.            return ListOfDefs;
86.        }
87.    }
88.}

 

 Thanks,

Craig

Viktor Tachev
Telerik team
 answered on 30 Apr 2015
5 answers
130 views
Hi, I have a RadWindowManager defined like this:
 
           <telerik:RadWindowManager VisibleStatusbar="false" VisibleTitlebar="false" BorderStyle="Double" BorderWidth="100" BorderColor="Red"
                                      EnableShadow="false" Behaviors="Close, Move" ID="RadWindowManager" DestroyOnClose="true" ShowContentDuringLoad="true"
                                      RestrictionZoneID ="RestrictionZone" Opacity="85" runat="server" KeepInScreenBounds="true" Modal="true" OnClientClose="ClientClose">
                <Windows>
                    <telerik:RadWindow runat="server" ID="RadWindowUser" Width="400" Height="500" />
                    <telerik:RadWindow runat="server" ID="RadWindowPCN" Width="600" Height="500" />
                </Windows>
            </telerik:RadWindowManager>

...and I'm invoking the two windows separately like this:

            function ShowUserWindow(userId)
            {
                var manager = window.radopen("UserAudit.aspx?id=" + userId, "RadWindowUser");
                return false;
            }
            function ShowPCNWindow(representationId)
            {
                var manager = window.radopen("PCNAudit.aspx?id=" + representationId, "RadWindowPCN");
                return false;
            }

The first time either of the windows is shown it's all fine, with the width and height being correct. But if I then close the window and show the same one again, the width and height are both 300. Any idea what I'm doing wrong here? Thanks.


















Daniel
Top achievements
Rank 1
 answered on 30 Apr 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?