Telerik Forums
UI for ASP.NET MVC Forum
12 answers
588 views
Hi,

I have a grid with many columns.  All columns don't fit on 1 screen so the horizontal scroll bar appears automatically.  The grid has data in the footer (column totals etc..).  The problem is when I scroll left/right, the footer does not scroll so I can never see that part of the grid end of the footer.

Is there anyway to make the footer scroll with the rest of the column the way the header works?

Thanks,

pt
Pierre
Top achievements
Rank 1
 answered on 19 Oct 2012
1 answer
149 views
Disassembled code with ILSpy:
// Kendo.Mvc.Extensions.QueryableExtensions
private static DataSourceResult CreateDataSourceResult(this IQueryable queryable, DataSourceRequest request, ModelStateDictionary modelState, LambdaExpression selector)
{
. . . .   

Should replace
List<AggregateDescriptor> aggregates = new List<AggregateDescriptor>();
    if (aggregates != null)
    {
        aggregates.AddRange(request.Aggregates);
    }

by
List<AggregateDescriptor> aggregates = new List<AggregateDescriptor>();
    if (request.Aggregates != null)
    {
        aggregates.AddRange(request.Aggregates);
    }

Petur Subev
Telerik team
 answered on 19 Oct 2012
1 answer
682 views
Hi Everyone

I want to know if someone can help me out a bit, i am trying to use the foreign key columns, which is working just fine, accept, for some reason my kendo grid shows numeric text boxes instead of comboboxes, and i have followed the examples, but with no luck could i get them right :( attached is the code i am using

@{
        Html.Kendo().Grid<EasyAssets.Model.DTO.HomologationItemDTO>()
            .Name("itemsGrid")
            .Columns(c =>
                {
                    c.Bound(e => e.HomologationItemPriceID).ClientTemplate("<input id='#=ItemPriceID#' type='checkbox'/>").Template(t => "<input id='" + t.ItemPriceID + "' type='checkbox'/>").Title("").Width(30);
                    c.Bound(e => e.ItemPriceID).Filterable(false).Visible(false);
                    c.Bound(e => e.Item);
                    c.Bound(e => e.ItemPrice).Width(120);
                    c.ForeignKey(e => e.PriorityID, (System.Collections.IEnumerable)ViewData["priorities"], "id", "datatext").Title("Priority").Width(170);
                    c.ForeignKey(e => e.StatusID, (System.Collections.IEnumerable)ViewData["statuses"], "id", "datatext").Title("Status").Width(170);
                })
            .Editable(e => e.Mode(GridEditMode.InCell))
            .Sortable()
            .Pageable()
            .Filterable()
            .Scrollable()
            .Selectable(e => e.Mode(GridSelectionMode.Multiple))
            .AutoBind(false)
            .DataSource(e =>
                e.Ajax()
                .Batch(true)
                .ServerOperation(false)
                .PageSize(7)
                .Events(g => g.Error("ItemGridError"))
                .Model(m =>
                {
                    m.Field(f => f.ItemPrice).Editable(false);
                    m.Field(f => f.Item).Editable(false);
                    m.Id(i => i.HomologationItemPriceID);
                })
                .Read(r =>
                    {
                        r.Action("GetItems", "StockInspection");
                        r.Data("GetItemGridData");
                    }
                )
            )
            .Render();
    }

ViewData gets populated like this, the ModuleViewListDTO string(for values) and long(for ID's) properties
ViewData["priorities"] = _priorities = JsonConvert.DeserializeObject<ModuleViewListDTO>(GetOrPost("get", ApiUrl + "/api/Items?lookup=Priority", "")).data;
                ViewData["statuses"] = _statuses = JsonConvert.DeserializeObject<ModuleViewListDTO>(GetOrPost("get", ApiUrl + "/api/Items?lookup=ItemStatus", "")).data;

Attached is the results



Regards
Gregory
Rosen
Telerik team
 answered on 19 Oct 2012
1 answer
848 views
Guys,

How do I set the width of the datepickerFor?

Thanks

Vik
Mk
Top achievements
Rank 1
 answered on 19 Oct 2012
0 answers
52 views

Requirements

Kendo UI Suite and Version


jQuery Version


Supported Browsers and Platforms


Components/Widgets used 



PROJECT DESCRIPTION 
[enter description here, together with step-by-step instructions on how to use the project]
Zinnia
Top achievements
Rank 1
 asked on 19 Oct 2012
0 answers
138 views
Migrate to ASP.net platform to build a better product. ASP.Net is a free web framework to build great web-based applications. The three main advantages of ASP.net are ease of development, better efficiency with master pages and the availability as well as security of the source code. ASP.Net development helps you achieve better performance, higher scalability and improved agility. ASP to ASP.net Migration will help you work on a flexible platform and will facilitate product enhancements at a later stage. If you want to build a robust and well-architected software product using the ASP.Net framework, contact us today!
Poushali
Top achievements
Rank 1
 asked on 18 Oct 2012
2 answers
986 views
I've declared a NumericTextBox using the MVC helpers, and specified a custom HTML attribute as follows:

@(Html.Kendo().NumericTextBoxFor(a => costRow.FTE)
    .Name(costRow.CostRowId + "_FTE")
    .Step(new decimal(0.5))
    .Events(e => e
        .Change("fteChanged")
        .Spin("fteChanged")
        )
    .HtmlAttributes(new { guid=costRow.CostRowId })
)

Is there any way of getting the value of the 'guid' attribute from the 'fteChanged' function in JavaScript? I've tried $(this).attr('guid') but that doesn't give me anything.
Atanas Korchev
Telerik team
 answered on 18 Oct 2012
1 answer
984 views
Hello I am using Kendo grid to edit price lists.

I am trying to edit single value in table:

@(Html.Kendo().Grid(Model).Name("PriceList")
    .Columns(columns =>
    {
        columns.Bound(p => p.Id).Hidden();
        columns.Bound(p => p.Name);
        columns.Bound(p => p.ValidFrom).Format("{0:dd.MM.yyyy h:mm:ss}");
        columns.Bound(p => p.ValidTill).Format("{0:dd.MM.yyyy h:mm:ss}");
        columns.Bound(p => p.Created).Format("{0:dd.MM.yyyy h:mm:ss}");
        columns.Bound(p => p.UserName);
        columns.Bound(p => p.FilePath);
        columns.Command(command => { command.Edit(); command.Destroy(); });
    })
    .DataSource(dataSource => dataSource.Ajax()
            .Model(model =>
            {
                model.Id(p => p.Id);
                model.Field(p => p.ValidFrom).Editable(false);
                model.Field(p => p.ValidTill).Editable(true);
                model.Field(p => p.Created).Editable(false);
                model.Field(p => p.UserName).Editable(false);
                model.Field(p => p.FilePath).Editable(false);
                model.Field(p => p.Name).Editable(false);
        })
        .Read("PriceList_Read", "Admin")       
        .Destroy("PriceList_Editing_Destroy", "Admin")
        .Update(update=>update.Action("PriceList_Editing_Update", "Admin"))
        .Events(e=>e.Error("error_handler"))
    )   
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .AutoBind(true)
)

And I am having troubles passing edited value in grid to my controller:

public ActionResult PriceList_Editing_Update([DataSourceRequest] DataSourceRequest request, PriceListViewModel model)
        {
             
                    int Id = model.Id;
                    string Name = model.Name;
                    DateTime date = model.ValidTill; // 0001 00:00:00 value all the time
          
            return View("Index", GetViewResult());
        }

I am always getting back empty datetime value (by empty I mean {1. 1. 0001 0:00:00}) same problem is with 2 other columns using DateTime property (Created and ValidFrom). Rest of the values are posted back correctly. I was trying to get those values using string DateTillStr = Request.Params["ValidTill"]; but if I check my GET in firebug I can see grid is not sending back this value inside Request it sends only NON Datetime values of my model object. Like this:

Actual  false
FilePath    D:\Projects\CPSkla\CPSkla\App_Data\Cen°k 2012_10.xlsx
Id  23
Name    Testovací ceník
User    0
User1   null
UserName    djezek

Nothing more nothing less, only these 7 attributes I am missing rest 4 from my model:

public partial class PriceListView
    {
        public int Id { get; set; }
        public int User { get; set; }
        public string Name { get; set; }
        public System.DateTime ValidFrom { get; set; }
        public System.DateTime ValidTill { get; set; }
        public string FilePath { get; set; }
        public Nullable<System.DateTime> Created { get; set; }
        public Nullable<System.DateTime> Updated { get; set; }
        public bool Actual { get; set; }
        public string UserName { get; set; }
    }


Is there some other way to post these data back? I figured out I can attach additional data to Update request but I had an issue how to identify edited row in the table in javascript function (I know how to identify selected value but not edited).

Please help me I am quite desperate.

David Ježek
ANDREW REED
Top achievements
Rank 1
 answered on 18 Oct 2012
0 answers
232 views
Hi,
Im trying the telerick mvc chart control:
<% Chart<CollectionItem<decimal?>> chart =
                                            Html.Telerik().Chart(Model.GraphData)
                                                .Name("chart")
                                                .Title(title => title
                                                    .Text(Model.GraphTitle)
                                                    .Visible(false)
                                                )
                                                .Legend(legend => legend
                                                    .Position(ChartLegendPosition.Top)
                                                    .Visible(false)
                                                )
                                                .SeriesDefaults(series =>
                                                {
                                                    series.Column().Stack(false);
                                                })
                                                .Series(series =>
                                                {
                                                    series.Column(s => s.Value)
                                                        .Name("Totalen")
                                                        .Color("#1f3975")
                                                        .Labels(labels => labels
                                                            .Margin(-6)
                                                            .Visible(true)
                                                            .Template("<#= value #>")
                                                            .Position(ChartBarLabelsPosition.OutsideEnd));
                                                })
                                                .CategoryAxis(axis => axis
                                                    .Categories(s => s.Text)
                                                    .Color("#000000")
                                                    .Labels(labels => labels.Margin(-6).Visible(true))
                                                    .MajorGridLines(majorGridLines => majorGridLines.Color("#ddd"))
                                                )
                                                .ValueAxis(axis => axis
                                                    .Numeric().Labels(labels => labels.Margin(0).Format("{0:#,##0}")).Min(0)
                                                    .MajorUnit(Model.GraphMajorUnit)
                                                    .Color("#000000")
                                                    .Labels(labels => labels.Visible(false))
                                                    .MajorGridLines(majorGridLines => majorGridLines.Color("#ddd"))
                                                                 )
                                                .Tooltip(tooltip => tooltip
                                                    .Visible(false)
                                                    .Template("<#= category #>: <#= value #>")
                                                    .Format("{0:#,##0}")
                                                )
                                                .HtmlAttributes(new { style = "width: 225px; height: 78px;" });
 
               chart.Render();
            %>


The problem is that when one of my bars, has 0 as value, i dont' see the value on the bar, it's then empty. How can i show the 0 on the bar? i tried :
.ValueAxis(axis => axis
                                                   .Numeric().Labels(labels => labels.Margin(0).Format("{0:#,##0}")).Min(0)
                                                   .MajorUnit(Model.GraphMajorUnit)
                                                   .Color("#000000")
                                                   .Labels(labels => labels.Visible(false))
                                                   .MajorGridLines(majorGridLines => majorGridLines.Color("#ddd"))
But it does not work. 
A
Top achievements
Rank 1
 asked on 18 Oct 2012
0 answers
313 views
Is it even possible to create hierarchy tables using local data with MVC Razor? Doesn't appear so. The examples don't work. I've had no trouble with any of the other Kendo controls until now and I'm pulling my hair out...
    @(Html.Kendo().Grid<TaskDTO>(Model.Tasks)
    .Name("tasksTable")
    .Columns(columns =>
    {
        columns.Bound( p => p.ID ).Width( 300 );
        columns.Bound( p => p.Name );
        columns.Bound( p => p.TaskType );
    })
    .ClientDetailTemplateId( "testTemplate" )
    .Pageable()
    .Sortable()
    .Resizable( resize => resize.Columns( true ) )
    .Events( events => events.DataBound( "dataBound" ) )
)

This all works fine without the client template, but when I add in the ClientDetailTemplateId and it's corresponding script, all the columns in the parent table shift one column to the left. DataBind is NOT being called and in fact the template is never even executed.

I was hoping something like this would work

    <script id="testTemplate" type="text/kendo-templ">
@(Html.Kendo().Grid<CustomFieldDTO>( Model.Tasks.Where( f => f.ID == Guid.Parse( "#=ID#" ) ).FirstOrDefault().CustomFields )
        .Name( "CustomTaskFields_#=ID#" )
        .Columns( columns =>
        {
            columns.Bound( q => q.PropertyID );
            columns.Bound( q => q.FieldName );
            columns.Bound( q => q.Value );
        } )
        .Pageable()
        .Sortable()
        .ToClientTemplate()
)
    </script>

but doesn't appear so.

I got it working almost working using DataSource to the controller but I need to send both the Project and Task IDs and ProjectID is not in the bound data that the template gets. I can't find anyway to pass additional data to the template.

Tag
Top achievements
Rank 1
 asked on 17 Oct 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?