Telerik Forums
UI for ASP.NET MVC Forum
1 answer
83 views
Hi,

We have a grid with a foreignkey column. This column has to call an edit template Dropdownlist with cascade property .

columns.ForeignKey(f => f.CatalogReference, (System.Collections.IEnumerable)ViewBag.Cataleg, "Reference",          "Descripcio").EditorTemplateName("CatalegReferenceByType");

@model object
(Html.Kendo().DropDownList()
    .Name("CatalogReference")
    .AutoBind(true)
    .OptionLabel("Select reference...")
    .DataTextField("Descripcio")
    .DataValueField("Reference")
    //.HtmlAttributes(new { data_skip = "true", data_bind = "defferedValue: object" })           //.BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
    .DataSource(source => {
           source.Read(read => read.Action("PopulateReferences", "Catalog").Data("filterTypes"))
          .ServerFiltering(true); })
    .CascadeFrom("Tipus")
    .HtmlAttributes(new { id = Guid.NewGuid().ToString() })
)

It's possible show the value in dropdownlist when update state is selected.


Thanks for your responds.


Xavier.
Alexander Popov
Telerik team
 answered on 02 Mar 2015
1 answer
103 views
I just downloaded and installed UI for ASP.NET MVC - I'm evaluating it for a potential purchase.

Although I have VS 2012 Pro and VS 2013 Express for Web installed, the installed did not recognize the 2013 installation and therefore can't install the VS extensions. It did recognize VS 2012 but I'm planning to use 2013, so this is a handicap.

I've seen a few old messages on this topic but I believe it's supposed to be working now.

Any advice welcome!

Thanks, Tom
Steliyan
Telerik team
 answered on 02 Mar 2015
1 answer
175 views
Hello Guys,


I have the following dropdownlist with a custom template:

        Html.Kendo()
           .DropDownList()
           .HtmlAttributes(new { style = "width:100%; " })
           .BindTo(Model.FilterShops)
           .DataTextField("DisplayValue")
           .DataValueField("Id")
           .Template("<input type='checkbox' id='#=data.Id #' name='superPlayer#=data.Id #' value='#=data.IsSelected #' />" + "   " + "${ data.DisplayValue}")
           .Name("cb_SuperPlayer")
           .Events(ev => ev.Close("cb_SuperPlayer_closed"))
           .Filter(FilterType.Contains)

If i open the dropdownlist and check some of the checkboxes, on the close event i will correctly get the ones checked into an array. 
The problem is when i use the search textbox of the control to filter the items, if i check some of them, after the dropdownlist closes the selections are all cleared..

So for example lets say that my collection has: [Whatever, Test1, Test2, SomeOtherText]. If i just open the dropdownlist and select whatever and test1 and then close it, after i collapse it again, my checkboxes are still checked.

If i open the dropdownlist and search for "test", and check test1, test2, close the dropdownlist and then collapse it again, the two selections are cleared.

Hope you can help me figure this out.

P.S: This is the method for onclosed to get the checked selections

      function cb_SuperPlayer_closed() {
        var selShops = new Array();
        var doc = document.getElementById("cb_SuperPlayer_listbox");
        var chkBoxes = doc.getElementsByTagName("input");
        for (var i = 0; i < chkBoxes.length; i++) {
            if (chkBoxes[i].checked)
                selShops.push(chkBoxes[i].id);
        }

    }

Regards,


Fran









Alexander Popov
Telerik team
 answered on 02 Mar 2015
1 answer
134 views
Hi,

I'm reading from a dataset from a SQL database to my chart, I've managed all chart types except for one as the data coming back is dynamic. Essentially I am need to have the startDate that is already returned to be my x axis and then I want to stack by database column the monthly information. The problem is I don't know what the columns are called after the startDate and don't know how many there are. 

I've been looking now for over 24 hours at various solutions and have so far come up blank. My charts are written using the MVC approach but I've also been trying the JavaScript approach. All seems OK until I try to load the series information in. The data is going to be coming at me in the following format:

Public class websiteInformation
{
    public string DisplayDate { get; set; }
    public List<WebSiteInfo> WebSite { get; set; }
}
 
Public class WebSiteInfo
{
    public decimal Value { get; set; }
    public string WebSiteName { get; set; }
}

The razor looks like this:

@(Html.Kendo().Chart<websiteInformation>()
      .Theme("BlueOpal")
      .Name("WebSiteInfo")
      .ChartArea(chartArea => chartArea.Background("transparent"))
      .SeriesDefaults(sd => sd.Column().Stack(true))
      .DataSource(ds => ds
          .Read(read => read.Action("WebSiteInfo", "Home", new
          {
              param1 = "param1value",
              param2 = "param2value",
              param3 = "param3value",
              param4 = "param4value",
              param5 = "param5value"
          }))
          .Events(e => e.RequestStart("chart4LoadingStart").RequestEnd("chart4LoadingEnd"))
      )
      .Series(series =>
      {
        ?????????????????????????
      })
      .Legend(l => l.Position(ChartLegendPosition.Bottom))
      .Tooltip(tt => tt.Visible(true).Template("#= kendo.format('{0:P}', percentage) #").Color("white"))
)

What I need to know is how to dynamically configure the series so I can have the x axis as the DisplayDate then the Y stacked for each month all the WebSiteInfo so the Value and the WebSiteName will be used in the tooltip.

Hope this all makes sense,and hopefully someone can help?
Thanks in advance.
T. Tsonev
Telerik team
 answered on 02 Mar 2015
1 answer
87 views
Hi,

In the following code snippet you see that we are using the MVC Wrapper of kendo ui grid with odata mechanism that gets its data from a controller in server side.
We want to use custom command buttons but we are getting an exception that says that we cannot use custom commands if we are not using server binding. But when we are using odata mechanism with data binding at controller stage, why this is not a server binding ?

Please help.

Thanks.

<div>
    @(Html.Kendo().Grid<Item>()
          .Name("grid")
          .Columns(columns =>
          {
              columns.Bound(c => c.ItemCode);
              columns.Bound(c => c.ItemName);
              columns.Command(command => command.Custom("Details").Text("Details").Action("OpenDetailsForm", "Home")).Width(100);
          })
          .HtmlAttributes(new { style = "height: 380px;" })
          .Scrollable()
          .Selectable(o => o.Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Row))
          .Sortable()
          .Resizable(o => o.Columns(true))
          .Reorderable(o => o.Columns(true))
          .Filterable()
          .Pageable(pageable => pageable
          .Refresh(true)
          .PageSizes(true)
          .ButtonCount(3))
          .DataSource(dataSource => dataSource
          .Custom()
          .ServerSorting(true)
          .ServerFiltering(true)
          .ServerPaging(true)
          .ServerGrouping(true)
          .ServerAggregates(true)
          .Schema(s => s.Total("Total").Data("Data"))
          .Type("odata")
          .PageSize(10)
          .Transport(r => r.Read(c => c.Cache(true)).Read(a => a.Action("GetGridDataSource", "Home", new { entityName = typeof(Item).FullName }).DataType("json")))))
</div>







Alexander Popov
Telerik team
 answered on 02 Mar 2015
9 answers
387 views
I've just finished implementing the Export to Excel functionality from v2014.3.1411 in apps for two different clients. I held off until now because the first version of the functionality, while great, was unusable to me because if the grid had more than one page of data, the export only exported the current page. The latest version with AllPages functionality fully implemented is perfect. It completely meets my clients' needs for ad hoc reporting. Thank you so much and my compliments to the developers involved.
Jolene
Top achievements
Rank 1
 answered on 27 Feb 2015
5 answers
1.5K+ views
Hello,
How can I force the grid to refresh after saving an edit using your pop-up editor? 

After a user saves a new or edited record, its data is encrypted and passed to the database.  When we return to the grid, the new records data is displayed in its encrypted form, but the other records display properly.  After I hit the refresh button on the grid, everything displays properly.  This is the issue that I am trying to correct.

I would appreciate your help and suggestions,
Mike
Kelso
Top achievements
Rank 1
 answered on 27 Feb 2015
1 answer
168 views
In Razor view i have Three divs out of which Two divs are hidden,in hidden div i have declare one div for Grid and i am generating that Grid using html,When i am showing that hidden div then Grid in that div is coming at the left top corner with small size.
When i am clicking on it, it's showing that Grid properly.
I am Showing and Hiding these div using "js" file.

(When i am removing hidden property from that div and loading that div it's not giving me any Problem)i.e
Working Fine Without Hidden:
<div id="xyz" >
<div id="Grid_ID"/>
</div>

Issue  With Hidden Property:
<div id="xyz" hidden="hidden">
<div id="Grid_ID"/>
</div>

I have attached the Snap shot,Kindly Find those.
Dimo
Telerik team
 answered on 27 Feb 2015
1 answer
122 views
I have created a grid which is bound to a list of workgroups. Each workgroup has a list of Agents which I want to show as detail.

The only way I got this working was by doing a  client detail template and creating a new grid. This means doing another read of data which i did not really want to do. 

Can someone advise a better way to do this. Also suggest a good way to style my details as I don't want them shown as a standard grid but actually a list. 
  
Current code:

   <div id="clientsDb">
    <%: Html.Kendo().Grid<ASML_Scheduler.ScheduleService.WorkgroupViewData>()
        .Name("grid")
         .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("Workgroups_Read", "Home", new { name = ViewData["LoggedInUser"] }))
            )
        .Columns(columns =>
        {
            columns.Bound(c => c.WorkgroupName).Width(140);
            columns.Bound(c => c.TotalAgents).Width(75);
            columns.Bound(c => c.AgentsLoggedOn).Width(75);

        })       
        .HtmlAttributes(new { style = "height: 380px;" })
        .Scrollable()
        .Groupable()
        .Sortable()        
        .ClientDetailTemplateId("client-template")
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))     
     %>
 </div>

<script id=" Code:client-template" type="text/x-kendo-template">     
  <%: Html.Kendo().Grid<ASML_Scheduler.ScheduleService.AgentViewData>()
      .Name("grid_#=WorkgroupName#") 
        .DataSource(dataSource =>  
          dataSource.Ajax().Read(read => read.Action("Agents_Read", "Home", new {workgroupname= "#=WorkgroupName#", name = ViewData["LoggedInUser"] }))
      )      
      .Columns(columns =>
      {
          columns.Bound(product => product.AgentName);
          columns.Bound(product => product.IsLoggedOn);
      })       
      .ToClientTemplate()
    %>    
</script>
Alexander Popov
Telerik team
 answered on 27 Feb 2015
1 answer
331 views
Hi There,

I would like to do dynamic columns using list item from MyModel, can i change the column "title" base on MyModel?

MyModel
{
     List<Item> Items;
}


Please refer to code below : 

@(Html.Kendo().Grid<MyModel>()
    .Name("gridStudentList")
    .Columns(columns =>
    {


        for (int i = 0; i < 3; i++)
        {

            columns.Bound(c => c.Items[i].Product).Title("Can i use Mymodel property here?").Filterable(false); 
            columns.Bound(c => c.Items[i].ProductPrice).Filterable(false); 
        }

    })
Thanks for your time. Regards,






Dimo
Telerik team
 answered on 27 Feb 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?