Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
104 views

Hi

Is it possible to edit treelist view only for a few row ?? 

After searching, i did not find a way to view my gantt row...

I would like to edit some value of row from one column and represented them by a different color.

 

Thanks

Salvatore

Veselin Tsvetanov
Telerik team
 answered on 03 Oct 2016
9 answers
217 views

I have a problem where after I dragged Branch ID into the Row Area and update, the pivotgrid will load for some time and show empty result. Results will show if Branch ID is not dragged into row area. 

I have tried the same scenario in Visual Studio 2008 SSAS and it successfully shows the result.

Thanks.

Maria Ilieva
Telerik team
 answered on 03 Oct 2016
45 answers
1.5K+ views
I'm noticing that the RadAjaxPanel control is causing a full postback when one of its child controls is fired (like a checkbox with autopostback=true).  This only happens the 1st time and all subsequent postbacks happen via AJAX.

Any idea on why this may be happening?

Also, when more than 1 RadAjaxPanels are on the same page, it seems that all the other update panels work fine on their 1st trigger, it's just the first request from any of them that seems to be a problem.

These are inside a formview in a user control, if that matters.
Mihail
Top achievements
Rank 1
 answered on 02 Oct 2016
2 answers
72 views

Hi,

I am playing with Radmenu on multiple devices, including desktop and mobile devices. I realize i can set "RenderMode" to "Auto" and it will adapt to devices automatically.

However, one issue i noticed is that once it is set to "Auto", it renders desktop menu in "Lightweight" mode. According to my research, it is the default behavior: if there is lightweight mode available, use lightweight mode for desktop and using Mobile mode for mobile devices. I also realized the lightweight mode has different HTML layout than the Classic one. That cause some styling issue cross my web application. I would prefer to show "Classic" on desktop, and "Mobile" for mobile devices. Is there any setting/configuration that can help with that?

In addition, is there any specific CSS files for lightweight mode that I need to download and add to my web application (because this is my first time play with lightweight render mode)?

 

Thanks

Kan

Kan
Top achievements
Rank 1
 answered on 30 Sep 2016
6 answers
246 views
Hi,

I have open a RadWindow on a button click event and then in that window i have added a download button for downloading the file.
But as the download pop up the radwindow stop behaving. Right now i want that RadWindow should get close automatically  when the download gets completed but currently it remains open. So please provide me solution for this.

Thanks
Logan Marshall
Top achievements
Rank 2
Iron
 answered on 30 Sep 2016
2 answers
43 views

Hello All, 

I'm using the self hierarchy rad grid, in the second and third level I'm hiding few columns programmatically but the grid render is not happening.

please help me on this, its bit urgent.

Attached the image for reference.

 

With Thanks

Amjath

Amjath
Top achievements
Rank 1
 answered on 30 Sep 2016
0 answers
63 views

Hi guys,

I have created a Pie Chart for my application but appearance does not look good. If I have at least 6 items the % is squeezed and cannot be seen.

Please see attached file.

Help me with this issue.

Thanks so much.

 

Vitaly
Top achievements
Rank 1
Iron
Iron
 asked on 30 Sep 2016
3 answers
220 views

I am very new to Telerik, so forgive my nearly total lack of knowledge in this area. I am coming from Selenium and having a difficult time trying to find the equivalent ways to do things in Telerik.

One example is simply invoking JavaScript by reference elements that are available in c#. For example,

C# fake code of what I'm trying to accomplish:

var inputbox = myclass.FindElement.ByXPath<HtmlInputText>("//*[@id='someid']//input[@type='someotherid']");
mybrowser.Actions.InvokeScript( inputbox.HowToReferToThisInJS?? +".some_method_like_click_or_whatever_in_js()" );

Sorry if this isn't clear and I'm missing something super obvious. This was relatively straight forward in Selenium (at least I was used to it) and I'm sure there is an easy way to do this using Telerik, I'm just having a hard time bridging the gap.

Something similar that works in Java+Selenium (the arguments[0-1] are magically brought in from the parameters in the method call - this is essentially what I'm trying to accomplish):

WebElement dropdown = driver().findElement(By.xpath(xpath)); // A dropdown box
int index = 5;
((JavascriptExecutor)driver()).executeScript("var select = arguments[0]; select.options[arguments[1]].selected = true;", dropdown, index);

 

Thanks.

Konstantin Dikov
Telerik team
 answered on 30 Sep 2016
2 answers
527 views

Hello,

What Im trying to do, is setting up a radgrid to use paging, and when the user selects the export to csv option it should export all of the records, not just the current page.

 

Ive looked into other posts, but ive tried everything and i just cant get it working. Right now it just exports the current page, when i try other things, the paging stops working and the export of all records works.

 

Here is my aspx:

<%@ Page Title="Nut Runners Data" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="NutRunnersReport.aspx.cs" Inherits="DataServer.Reports.NutRunnersReport" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <link href="../Css/print.css" rel="stylesheet">
    <link href="../Css/radGrid.css" rel="stylesheet">

    <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" EnableAjaxSkinRendering="true" Skin="Black" RenderMode="Mobile" AnimationDuration="500">

    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  OnAjaxRequest="RadAjaxManager1_AjaxRequest" DefaultLoadingPanelID="LoadingPanel1">

        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="StartDate">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="EndDate">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <div class="form-horizontal">
        <div class="row">
            <div class="col-md-12">
                <h3>Nut Runners Data</h3>
                <hr />
                The following nut runners data is between the range of dates selected.
               <br />
                From
                <telerik:RadDatePicker ID="StartDate" runat="server" OnSelectedDateChanged="StartDate_SelectedDateChanged" AutoPostBack="true"></telerik:RadDatePicker>
                To
                <telerik:RadDatePicker ID="EndDate" runat="server" OnSelectedDateChanged="EndDate_SelectedDateChanged" AutoPostBack="true"></telerik:RadDatePicker>
                <br />
            </div>

        </div>
        <div class="row" style="margin-top: 20px;">
            <div class="col-md-12">
                <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" OnAjaxRequest="RadAjaxPanel1_AjaxRequest" LoadingPanelID="LoadingPanel1"  ClientEvents-OnRequestStart="onRequestStart" >
                    <telerik:RadGrid ID="RadGrid1" runat="server" Width="100%" OnGridExporting="RadGrid1_GridExporting" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCommand="RadGrid1_ItemCommand" AllowFilteringByColumn="true"
                                     Skin="Office2010Black" GroupPanelPosition="Top" OnNeedDataSource="RadGrid1_NeedDataSource">
                        <ClientSettings> 
                            <Resizing AllowColumnResize="false" ResizeGridOnColumnResize="false" />
                            <ClientEvents OnCellSelected="" /> 
                            <Selecting AllowRowSelect="true" />
                            <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" ScrollHeight="500"/>
                        </ClientSettings>

                        <MasterTableView AllowAutomaticDeletes="false"
                                         AllowAutomaticInserts="false"
                                         AllowAutomaticUpdates="false"
                                         AllowFilteringByColumn="true"
                                         AllowMultiColumnSorting="true"
                                         AllowPaging="true"
                                         AllowSorting="true"
                                         HorizontalAlign="Center"
                                         ShowHeader="true"
                                         Font-Size="Large"
                                         CommandItemDisplay="Top"                      
                                         Width="100%"
                                         PageSize="20">
                            
                            <PagerStyle Position="Bottom"/>
                            
                            <CommandItemSettings ShowAddNewRecordButton="false" ShowCancelChangesButton="false" ShowExportToCsvButton="true" ShowExportToExcelButton="false" ShowRefreshButton="true" />
                        </MasterTableView>
                    </telerik:RadGrid>
                </telerik:RadAjaxPanel>
                <br />
            </div>
        </div>
    </div>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script src="../Scripts/initialize.js"></script>
        <script src="../Scripts/radChart.js"></script>
        <script src="../Scripts/radGrid.js"></script>
        <script src="../Scripts/radAjaxManager.js"></script>
    </telerik:RadCodeBlock>
</asp:Content>

And here is my c#:
using System;
using System.Linq;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataServer.App_Code;
using DataServer.Content.Models;
using Telerik.Web.UI;
using Telerik.Web.UI.GridExcelBuilder;

namespace DataServer.Reports
{
    public partial class NutRunnersReport : System.Web.UI.Page
    {

        public void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            RadDataGridControl.SetPageSizeForExport(sender, e);
        }

        public void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = e.Item as GridDataItem;
                TableCell dateCell = dataItem["Date"];

                dateCell.Text = Convert.ToDateTime(dateCell.Text).ToString("d");
            }
            RadDataGridControl.CenterFilterColumn(RadGrid1);
        }

        ~NutRunnersReport()
        {
        }

        public DateTime? StartDateTime
        {
            get
            {
                return this.StartDate.SelectedDate;
            }
            set
            {
                this.StartDate.SelectedDate = value;
            }
        }

        public DateTime? EndDateTime
        {
            get
            {
                return this.EndDate.SelectedDate;
            }
            set
            {
                this.EndDate.SelectedDate = value;
            }
        }

        public void EndDate_SelectedDateChanged(object sender,
            Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
        {
            this.GetProductionResults();
        }

        public void RadAjaxPanel1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
        {
            this.GetProductionResults();
        }

        public void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
        {
            this.GetProductionResults();
        }

        public void Page_PreRender(object sender, EventArgs e)
        {
            this.EditColumns();

            this.RadGrid1.Rebind();
        }

        public void EditColumns()
        {
            GridColumn[] columns = this.RadGrid1.MasterTableView.AutoGeneratedColumns;
            foreach (GridColumn column in columns)
            {
                switch (column.UniqueName)
                {
                    case "Date":
                        column.HeaderStyle.Width = Unit.Pixel(130);
                        column.FilterControlWidth = Unit.Pixel(90);
                        column.ItemStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
                        break;
                    case "Shift":
                        column.HeaderStyle.Width = Unit.Pixel(70);
                        column.FilterControlWidth = Unit.Pixel(30);
                        column.ItemStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
                        break;
                }

                column.HeaderStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
                column.HeaderStyle.VerticalAlign = System.Web.UI.WebControls.VerticalAlign.Middle;
                //column.ItemStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
                column.ItemStyle.VerticalAlign = System.Web.UI.WebControls.VerticalAlign.Middle;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            
            if (!this.IsPostBack)
            {
                this.StartDateTime = DateTime.Today;
                this.EndDateTime = DateTime.Today.AddDays(1);
            }

        }

        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            this.GetProductionResults();
        }

        public void RadGrid1_GridExporting(object source, GridExportingArgs e)
        {
            RadDataGridControl.GridExporting(source, e);
        }

        protected void StartDate_SelectedDateChanged(object sender,
            Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
        {
            this.GetProductionResults();
        }



        private void GetProductionResults()
        {
            this.RadGrid1.DataSource = null;
            using (var entities = new NutRunnersEntities())
            {
                this.RadGrid1.DataSource = entities.p_GetNutRunnersByDate(this.StartDateTime,
                                                                                   this.EndDateTime).ToList();
            }
        }
    }
}

The method SetPageSizeForExport:
internal static void SetPageSizeForExport(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
var grid = (Telerik.Web.UI.RadGrid)sender;
            int count = grid.Items.Count;
            if (count == 0)
            {
                count++;
            }

            grid.PageSize = count * grid.MasterTableView.PageCount;
}

And the method GridExporting:
internal static void GridExporting(object source, Telerik.Web.UI.GridExportingArgs e)
{
var grid = (Telerik.Web.UI.RadGrid)source;
grid.ExportSettings.IgnorePaging = true;
grid.ExportSettings.ExportOnlyData = false;
grid.ExportSettings.OpenInNewWindow = true;
grid.ExportSettings.HideStructureColumns = false;
grid.MasterTableView.CommandItemDisplay = Telerik.Web.UI.GridCommandItemDisplay.None;
grid.ExportSettings.FileName = string.Format("{0} Exported Grid Data",
(System.Web.HttpContext.Current.Handler as System.Web.UI.Page).Title);

switch (e.ExportType)
{
case Telerik.Web.UI.ExportType.Excel:
grid.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.Xlsx;
grid.MasterTableView.ExportToExcel();
break;
case Telerik.Web.UI.ExportType.Csv:
grid.MasterTableView.ExportToCSV();
break;
case Telerik.Web.UI.ExportType.Word:
grid.ExportSettings.Word.Format = Telerik.Web.UI.GridWordExportFormat.Html;
grid.MasterTableView.ExportToWord();
break;
case Telerik.Web.UI.ExportType.WordDocx:
grid.ExportSettings.Word.Format = Telerik.Web.UI.GridWordExportFormat.Docx;
grid.MasterTableView.ExportToWord();
break;
case Telerik.Web.UI.ExportType.Pdf:
grid.MasterTableView.ExportToPdf();
break;
}
}


Any suggestion of what im doing wrong? 

Sorry for all the mess.

 

Thanks,

Alex

Alejandro
Top achievements
Rank 1
 answered on 30 Sep 2016
3 answers
124 views

I am having issues adding a dropdown combo box to my UI grid.

Context: A user is setting up a batch of jobs. Each job is for a single customer. That is, a batch can have multiple jobs, each job is for one customer. My structure is ManageJobs, which holds JobDetails and each JobDetails has a Customer ID and Customer name.

The JobDetailsViewModel holds the Customer ID for whom the job is for and a name for display purposes. I have taken out any extraneous fields that are not relevant, there are other columns in the grid which do not require a dropdown. When the user is setting up a particular JobDetail, the dropdown needs to display a list of possible customers and select which one they want. ManageJobs contains a list of possible customers they can choose from, when selected this entry is stored on the JobDetails.

Here is where I am at:

 

BatchViewModel contains (amongst others) a list of JobDetails and the master customer list. The master customer list is populated by the controller.

public class BatchViewModel
{
    public List<JobDetailsViewModel> JobDetails { get; set; }
 
    public List<JobCustomerViewModel> MasterCustomerList { get; set; }
 
}

 

This is the view:

 
@(Html.Kendo().Grid<JobDetailsViewModel>()
.Name("Grid")
.NoRecords("No details")
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Columns(columns =>
{
    columns.Bound(c => c.CustomerName).Title("Customer Name")); // This is the dropdown column I want to show
    columns.Bound(c => c.FilePath).Title("File")); //extraneous detail
    columns.Command(c => { c.Edit().Text("Edit Job Details"); c.Destroy(); }).HtmlAttributes(new { style = "width: 30%" });  //my CRUD operations
})
.ToolBar(toolbar => { toolbar.Create().Text("Add New Job Detail"); })
.DataSource(dataSource => dataSource
    .Ajax()
    .Model(model => {
        model.Id(o => o.Id);
    })
        .HtmlAttributes(new { style = "display:table; width:100%; height: 100%;" })

//Omitted crud operations for simplicity

        .Pageable()
    )

 

 

My viewmodel:

public class JobDetailsViewModel
{
    public Guid Id { get; set; }
 
           // OTHER FIELDS
 
    public Guid CustomerId { get; set; }
 
    public string CustomerName { get; set; }
 
}

 

I have tried various things via tutorials and whatever else, but I cannot get the dropdowns working at all. Can you suggest which way I need to go for this? I am really stuck.

 

Many thanks

Viktor Tachev
Telerik team
 answered on 30 Sep 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?