Telerik Forums
UI for ASP.NET MVC Forum
1 answer
505 views

I have the following grid

<div class="actualGrid" id="actualGrid">
        @(Html.Kendo().Grid<AVNO_KPMG.Models.Bench>()
            .Name("grid")
 
        .Columns(columns =>
        {
            columns.Bound(p => p.name).Title("Bench").Filterable(ftb => ftb.Cell(cell => cell.Operator("contains"))).Width(125);
            columns.Bound(p => p.freeSeats).Title("Free Seats").Width(350);
 
            columns.Command(command => { command.Custom("checkBench1 ").Text(" AM ").Click("doCheckIn"); command.Custom("checkBench 2").Text(" PM ").Click("doCheckIn"); command.Custom("checkBench3").Text("All Day").Click("doCheckIn"); }).Width(250).Title("Check in");
 
        })
 
 
        //.Editable(editable => editable.Mode(GridEditMode.PopUp))
        .Pageable()
        .Sortable()
 
        .Scrollable()
                .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
        .HtmlAttributes(new { style = "height:530px;" })
                .Events(events => events.DataBound("onDataBound"))
        .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.id))
                        .Read(read => read.Action("GetBenches", "Home"))
 
 
                )
        )
    </div>

 I would like to know if there is a way to change the size of the grid according to the number of results i have when i use filter

for Example if i filter first column and get 1 result grid would be small, and if i had 10 results i would be larger.

Radoslav
Telerik team
 answered on 17 Sep 2015
1 answer
128 views

Hello,

 

Could you please let me know how one can control the placement of the slider tooltip? By default it is to bottom and the ask is to have it placed above.

 

Thanks!

Petyo
Telerik team
 answered on 17 Sep 2015
4 answers
114 views

Hello, I'm currently evaluating the MVC controls. I've created a custom control panel where the user can filter  or create new items on the table.  Currently the filter is working perfectly using javascript. The create button is not.  I added the class k-grid-add but no luck. I look at the link the grid creates when using the standard create button in the toolbar and it looks something like this: tblAgents_Read?grid-mode=insert  . I've tried adding this link to my custom link but it will return all data in a json file.  Any help?

 

MiracleMan
Top achievements
Rank 1
 answered on 17 Sep 2015
1 answer
180 views

Hi,

we need to bind datatables to a grid. For that we found the following example code:

http://www.telerik.com/support/code-library/binding-to-datatable-0191a594e359

This is working fine with the following exception:

We need a custom popup editor. But this requires a model we do not have because the grid is <dynamic>. What can we do?

 Best regards,

Thomas

 

Boyan Dimitrov
Telerik team
 answered on 16 Sep 2015
2 answers
1.0K+ views
@(Html.Kendo().MobileView()
    .Title("Yeni Yazı")
    .Name("TextProsess")

    .Content(@<text> 
          @model TelerikMvcApp1.Models.NewTextModel
                @using (Html.BeginForm("textadd", "Newtext"))
                {
                
                    <table border="0" cellpadding="0" cellspacing="2" style="width: 100%">
                        <tr>
                            <td style="width: 90px">
                                Yazı Adı:
                            </td>
                            <td>
                                @Html.TextBoxFor(NewTextModel => NewTextModel.Name)
                            </td>
                        </tr>
                        
                        
                        <tr>
                            <td>
                            </td>
                          
                            <td>
                            </td>
                        </tr>
                    </table>
                                   
                    <br />
                    <input type="submit" value="Kaydet" class="k-button" />
                                       
                }
            
</text>)
 
)

Dimo
Telerik team
 answered on 16 Sep 2015
1 answer
84 views

Hi,

I have a frustrating issue with fields in my model not being populated in the Update action callback in my controller.  The model:

public class CountsPerMonthModel
{
   [Editable(false)]
   public int Id { get; set; }
   public UserModel User { get; set; }
   public int January { get; set; }
   public int February { get; set; }
   public int March { get; set; }
   public int April { get; set; }
   public int May { get; set; }
   public int June { get; set; }
   public int July { get; set; }
   public int August { get; set; }
   public int September { get; set; }
   public int October { get; set; }
   public int November { get; set; }
   public int December { get; set; }
}

The User property is being correctly populated.  Integer fields January through December are not.

The callback:

[HttpPost]
public ActionResult CountsPerMonthUpdate([DataSourceRequest] DataSourceRequest request, CountsPerMonthModel model)
{
   // model has User set, but January through December are always 0
   // digging into request, the values are set correctly
}

And finally, the code for the popup template:

@model App.Models.​CountsPerMonthModel
 
<ul class="errors"></ul>
 
<div class="editor-label">
    @Html.LabelFor(m => m.​User)
</div>
 
<div class="editor-field">
    @(Html.Kendo().DropDownListFor(m => m.​User)
        .Name("​User")
        .OptionLabel("Select ​user...")
        .DataTextField("DisplayName")
        .DataValueField("UserId")
        .DataSource(source =>
        {
            source.Read(read =>
            {
                read.Action("Get​Users", "Management", new { includeReadOnly = false });
            });
        })
    )
</div>
 
<div>
    <p>@Html.Label("​Counts Per Month")</p>
</div>
 
<div class="editor-label">
    @Html.LabelFor(m => m.January)
</div>
 
<div class="editor-field">
    @Html.EditorFor(m => m.January)
    @Html.ValidationMessageFor(m => m.January)
</div>
 
<div class="editor-label">
    @Html.LabelFor(m => m.February)
</div>
 
... snipped for brevity ...
 
<div class="editor-field">
    @Html.EditorFor(m => m.February)
    @Html.ValidationMessageFor(m => m.February)
</div>
 
<
<div class="editor-label">
    @Html.LabelFor(m => m.December)
</div>
 
<div class="editor-field">
    @Html.EditorFor(m => m.December)
    @Html.ValidationMessageFor(m => m.December)
</div>
 
@Html.HiddenFor(m => m.Id)

When given a populated model, the values are displayed correctly in each field, it is only when Update is clicked, any updated values in the fields are not populated into the model object in the callback.

Any thoughts on what the issue might be?  I've used similar code in other places, this is the first time though that any fields have been an int type, so am wondering if I'm missing something somewhere...

Also, the editor template for Integer is as follows:

@model int?
 
@(Html.Kendo().IntegerTextBoxFor(m => m)
      .HtmlAttributes(new { style = "width:100%" })
      .Min(int.MinValue)
      .Max(int.MaxValue)
)

 

Thanks,

Craig.

 

Rosen
Telerik team
 answered on 16 Sep 2015
3 answers
275 views

I have a DataSet that I'm generating on the fly.

I'm doing this by collecting all of my data and then building a DataTable and then using the DataTable as a DataSource for my Kendo Grid.

The Grid is set up to use AutoGenerated columns, like this ...

@(Html.Kendo().Grid(Model.Data)
  .Name("grid")
  .Columns(c =>
  {
    c.AutoGenerate(true);
  }
  .Scrollable()
  .Resizable(a =>
  {
    a.Columns(true);
  })
)

I want to freeze the first column in this Grid (I will always know what this column is).

I haven't found a way of manipulating the Columns at all when using AutoGenerated columns and have had to resort to a number of jQuery/CSS 'fudges' to get the Grid looking and behaving the way that I want it to.

However, I'm at a loss as to how I might be able to freeze a column when the Grid uses AutoGenerated columns.

Is is actually possible?

If it is, would you care to give me a hint as to how I might go about it?

Stuart
Top achievements
Rank 1
 answered on 16 Sep 2015
1 answer
198 views

Hello,

sometimes when I try to Upload files via the upload-control the upload ends up in 103% without the save and onsuccess-events firing. It doesn't seem to have anything to do with the file itself, as I'm always using the same. Sometimes it works, sometimes it doesn't.

function onSuccess(e) {
    var gridNotification = $("#gridNotification").data("kendoNotification");
    var crmType = $("#ddlCrmType").data("kendoDropDownList");
    var csvHeadRow = e.response.csvHeadRow
    var url = '@Url.Action(MVC.Mapping.ReturnMappingGrid())';
    $.ajax({
        type: "POST",
        url: url,
        data: JSON.stringify({ csvHead: csvHeadRow, crmType: crmType.text() }),
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            $('#gridContainer').html(data);
            gridNotification.show("Die Auswahl der jeweiligen Eigenschaft erfolgt durch Klicken des jeweiligen Eigenschaft-Felds!")
            var container = $(gridNotification.options.appendTo);
 
        },
        error: function (xmlHttpRequest, textStatus, errorThrown) {
            debugger;
            console.log(xmlHttpRequest.responseText);
            console.log(textStatus);
            console.log(errorThrown);
        },
        async: false
    });
}

@(Html.Kendo().Upload()
    .Name("upMappingFile")
    .Multiple(false)
    .ShowFileList(true)
    .TemplateId("fuCsvTemplate")
    .Async(a => a
        .AutoUpload(true)
        .Save("SaveFile", "Mapping")
        .Remove("RemoveFile", "Mapping")
    )
    .Enable(false)
    .Events(e => e
        .Success("onSuccess"))
    .Messages(m => m
        .Select("Durchsuchen...")
        .HeaderStatusUploading("Uploading...")
        .HeaderStatusUploaded("Fertig"))
)

Dimo
Telerik team
 answered on 16 Sep 2015
3 answers
133 views
I have a problem with Gantt chart. Our application is deployed on a server with its timezone set to UTC. I'm hitting the application from US Pacific timezone, and when I update or add new task, the data submitted to the server is in UTC as oppose to my local time. So when I open Task edit form and set a Start time of 9/8/2015 12:00:00 AM (which should be Pacific, since my browser is in pacific), the data being posted to server shows it as 9/8/2015 12:00:00 AM UTC. How can I overcome this?
Bozhidar
Telerik team
 answered on 16 Sep 2015
1 answer
743 views

I've following code in razor view. How do I use Kendo Radio button to render the same? I'm struggling to assign enum to radio button value.

@if (Model == declaredEnum.​Val1) //declaredEnum is Enum
{
    @Html.RadioButtonFor(l => l, (int)declaredEnum.​Val1, new { @checked = "checked" });
    
}
else
{
    @Html.RadioButtonFor(l => l, (int)declaredEnum.​Val1);   
}
@Html.LabelFor(l => l, "Label")​

Daniel
Telerik team
 answered on 16 Sep 2015
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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
DateTimePicker
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
+? 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?