Telerik Forums
UI for ASP.NET MVC Forum
4 answers
6.8K+ views

Hi,

I have read the following in the docs:

Kendo UI Grid Integrates a responsive pager, which automatically adjusts to different screen widths and provides the ability to define which columns to be hidden on small view ports. This makes them more flexible for mobile web usage.

  • How to define a specific column to be hidden on small view ports?

I use MVC Core Version of the grid and cannot find a property for the columns to set this?

robert

Rumen
Telerik team
 answered on 08 Dec 2016
1 answer
231 views

The text on the Cancel Changes button on an InCell batch editing toolbar changes to a blue color and it is underlined, much like a visited <a> when the text-decoration is not set to none.  See attached screenshot.

How can I overwrite this in a stylesheet so that when I move move the mouse off of the button it returns back to its original styling (like the Save Button in the screenshot)?

Thanks,

Shawn

Shawn
Top achievements
Rank 1
 answered on 08 Dec 2016
1 answer
87 views

I'm evaluating the spreadsheet component for possible use and I ran into an issue with saving changes to sorted data in the spreadsheet.  I'm binding a datasource into a sheet with CRUD references to the controller.  When the data is sorted and a user edits a row, on saving the update, the wrong row in the datasource is updated/sent to the controller.  Is this a known issue?  If so, do you know when this will be corrected?

Thanks.

Scott

 

Veselin Tsvetanov
Telerik team
 answered on 08 Dec 2016
1 answer
694 views

Enum class

public class Voltage
  {
      public int Id{ get; set; }
      public string RefNo { get; set; }
      public VoltageLevel VoltageLevel { get; set; }
  }
  public enum VoltageLevel
  {
      LV = 1,
      MV = 2,
      HV = 3  
}

 

Controller

public ActionResult Voltage_Read([DataSourceRequest]DataSourceRequest request)
     {
         IQueryable<Voltage> voltage= db.Voltage;
         DataSourceResult result = voltage.ToDataSourceResult(request, voltage=> new {
             Id = voltage.Id,
             RefNo = voltage.RefNo,
             VoltageLevel = voltage.VoltageLevel,
         });
         return Json(result);
     }

 

View

@(Html.Kendo().Grid<entities.voltage>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.RefNo);
columns.Bound(c => c.VoltageLevel); //here the voltagelevel didnt show.
})

 

 

Marin Bratanov
Telerik team
 answered on 08 Dec 2016
1 answer
85 views

Kendo Grid creates some dynamic id like 90gaedac-c800-4582-b530-4f7145383554 and they sometimes start with a number, which is against the standard.

https://css-tricks.com/ids-cannot-start-with-a-number/

Is there a way to fix this behaviour?

Konstantin Dikov
Telerik team
 answered on 08 Dec 2016
3 answers
245 views

Hello, I'm using a cascading combobox in an editor template.  The Id is set dynamically to avoid conflict with multiple instances of the editor on the same page.  So for example I might setup the editor like this:

 

@Html.EditorFor(o => o.MatterNum, "MatterComboBox", new { ControlId = "upload_Matter" })

 

It sets the Id dynamically and that works great ( see below ). The problem I'm having is with cascading, because the parent combobox is also dynamic, so I don't know what the ID will be in my additional data method.  I need to be able to somehow pass the ID of the parent combobox when setting up the child.  Here is how my child combo is defined (the parent is very similar):

 

@(Html.Kendo().ComboBoxFor(o => o)
          .DataTextField("MatterNumName")
          .DataValueField("MatterNum")
          .Placeholder("Select Matter")
          .HtmlAttributes(new { id = @ViewData["ControlId"], style = "width: 100%" })  
          .Filter("contains")
          .AutoBind(true)
          .MinLength(1)
          .DataSource(source =>
          {
              source.Read(read =>
              {
                  read.Action("GetFilteredMatters", "ClientMatter")
                      .Data("onAdditionalMatterData");
              })
                  .ServerFiltering(true);
          })
)

 

I've come at this from a few angles but coming up short each time. 

1. I can set the child/parent IDs to be similar so I could just infer the parent Id from the child.  However I haven't found a way to get the child combobox Id inside the onAdditionalMatterData js function, it seems to only contain the filter data (which I also need). If there was a way to get the sending control information out of that fitler object I think it would solve my issue.

2. I thought maybe I could pass the Id along from the template view to the onAdditionalMatterData function, something like this:

 .Data("eBillReady.ClientMatterLookups.onAdditionalMatterData('parentId')");

but I'm not sure how to do that without losing the filter data which is then no longer passed, also I would obviously need the name to populate dynamically perhaps from the viewdata.

3. I think if I dynamically set "CascadeFrom", then that may cause the Id to be part of that filters object passed to onAdditionalMatterData but I didn't get anywhere with that.  Maybe setting that manually in the page load would work?

 

 

Ivan Danchev
Telerik team
 answered on 07 Dec 2016
1 answer
283 views

Hi,

 

My notification is

 @foreach (SLEmailMessage x in Model.Notifications)
                {
                    @:var
subject = '@x.Subject';
                    @:var
body = '@x.Body';
                           @: notification.show({ title: subject, message:
body }, "upload-success");
                                 }


        });

In my controller

Where @x.Body =  "Building = 101" + Environment.NewLine +
                             "Manager Name: " + "Ali Baba";

The Environment.NewLine is causing an error. How to add a "end on line" in the notification?

I tried to replace the "end on line" by the <br> tag within a paragraph and it dit not work

A quick answer will be greatly appreciated

 

 

 

 

 

Slav
Telerik team
 answered on 07 Dec 2016
1 answer
447 views

I have a DDL  (below that is not binding to my controller (also below).   The contact controller/View are part of an area.

 

Please assist.

 

Thanks in advance

 

 

Controller

public ActionResult GetCountries([DataSourceRequest] DataSourceRequest dsRequest)
{
List<DropDownListModel> result = new List<DropDownListModel>();
foreach (DataRow dr in CommonWf.getLocationByTypeId(4).Tables[0].Rows)
{
if (!string.IsNullOrEmpty(dr["Name"].ToString()))
{
DropDownListModel returnModel = new DropDownListModel();
returnModel.Name = dr["Name"].ToString();
returnModel.Value = dr["LocationId"].ToString();
result.Add(returnModel);
}
}


DataSourceResult crapData = result.ToDataSourceResult(dsRequest);
return Json(crapData, JsonRequestBehavior.AllowGet);
}

 

 

Dropdown List

 

 

@(Html.Kendo().DropDownList()
.Name("CountryId")
.DataTextField("Name")
.DataValueField("Value")
.Events(e =>
{
e.Select("onChangeCountry"); //.DataBound("onCountryBound");
})
.OptionLabel("Select Country...")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetCountries", "Contact");
})
.ServerFiltering(true);
})

)

Peter Milchev
Telerik team
 answered on 07 Dec 2016
1 answer
84 views

Trying to apply (default filter) active.
where plu.pluActive is a boolean

I have tried:

.Filter(filters => { filters.Add(plu => plu.pluActive == true); })
 
.Filter(filters => { filters.Add(plu => plu.pluActive).Equals(true); })
 
.Filter(filters => { filters.Add(plu => plu.pluActive).Equals("true"); })

They all filter out all the rows.
If I comment out:

//.Filter(filters => { filters.Add(plu => plu.pluActive == true); })

 

I get all the rows.

???

 

Dan
Top achievements
Rank 1
 answered on 05 Dec 2016
1 answer
334 views

Hi, i've a treelist with custom command, 

and i'm trying to change the button template with the databound event like the Grid

the visual result it's ok, but the event click doesn't fire, probably because i remove the k-button class.

but if leave the class the button doesn't template.

columns.Add().Command(command =>
                 {
                     command.Custom().ClassName("k-grid-EditCustom").Text(" ").Name("EditCustom").Click("editGroup");
                     command.Custom().ClassName("k-grid-DeleteCustom").Text(" ").Name("DeleteCustom").Click("deleteGroup");
 
                 }).Width(150);
 
function treeGridGroup_DataBound(e) {
     e.sender.tbody.find(".k-grid-EditCustom").removeClass("k-button")
     e.sender.tbody.find(".k-grid-EditCustom").addClass("btn btn-warning btn-outline fa fa-pencil");
 
     e.sender.tbody.find(".k-grid-DeleteCustom").removeClass("k-button")
     e.sender.tbody.find(".k-grid-DeleteCustom").addClass("btn btn-danger btn-outline fa fa-trash-o m-l-5");
 }
Kostadin
Telerik team
 answered on 05 Dec 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?