Telerik Forums
UI for ASP.NET MVC Forum
3 answers
1.5K+ views
I'm trying to change the color of the grid command button but the CSS is not taking effect.  The CSS is being called because the font size is changing.  The color is not for some reason.  Any ideas.


CSS:
.editButtonChangeColor
{
background-color: Red;
color: Red;
border-color: Red;
font-size: 20px;
}

Databound function of grid:
$(".k-grid-edit").addClass("editButtonChangeColor");
Dimiter Madjarov
Telerik team
 answered on 09 Jul 2013
2 answers
215 views
I looked at the code sample at http://www.kendoui.com/code-library/mvc/grid/export-grid-to-excel.aspx
It uses AJAX binding.
Can this be done using server binding? I am having some issues with ajax binding.

Thanks

Jagdish
Top achievements
Rank 1
 answered on 08 Jul 2013
1 answer
47 views
The Model has 4 properties, Description, Amount, Note and a boolean, NoteRequired.
I have a grid with 3 columns, Description, Amount and Note.  
If NoteRequired is True for a row and the Amount > 0, how do I show them a message that a Note is Required and set the focus in the Note field?

Dimo
Telerik team
 answered on 08 Jul 2013
5 answers
146 views
I created MVC 3 web application and then convert it to Kendo UI for ASP.NET MVC application. Plz see attached project.

There is a simple grid on index page, add new item button is on grid toolbar, edit and destroy buttons are in column.

I could add new row successfully, but when I try to edit existing row, another create action is posted again. Refresh page, two rows in grid. the same thing happens when I try to delete a row.

Why? Am I missing anything there?

Please advise.
Jason
Top achievements
Rank 1
 answered on 08 Jul 2013
0 answers
87 views
hello all, 
i need to work on new project and we are planning to have rich data grid functionality. i searched for telerik controls for Data Grid and came to this Kendo UI . our platform would be Asp.net Mvc4. please help.
Sandeep
Top achievements
Rank 1
 asked on 08 Jul 2013
2 answers
213 views
I have a panelbar in which the content is loaded via ajax.

I would like to reload the content based on the change event in a dropdown list.  However, it doesn't appear that I can do this.

I tried the reload() method on the panelbar object but it didn't do anything so I figured there was some caching involved.

Can I trigger a reload to occur?

Below is my client-side code and the panelbar.

thanks
var panelbar = $("#HomePanelBar").data("kendoPanelBar");
panelbar.reload();
 
 @(Html.Kendo().PanelBar()
        .Name("HomePanelBar")
        .HtmlAttributes(new { style = "width:400px;" })
        .ExpandMode(PanelBarExpandMode.Single)
        .Items(panelBar =>
        {
            panelBar.Add()
                .Text("Notification")
                .HtmlAttributes(new { id = "item1" })
                .Expanded(true)
                .LoadContentFrom("_Announcement", "Help");
        })
    )
 


William Dunn
Top achievements
Rank 1
 answered on 08 Jul 2013
3 answers
259 views
Hej

Im trying to use the Kendo Grid for a minor project, where i want to show the column summary in the groupheader. But I cant get it to Work :-(. When i use the Groupfooter, then it works fine.

Anyone got any suggestions?

************************************************************************************
@(Html.Kendo().Grid((IEnumerable<FTEReport>)ViewBag.Test) 
     .Name("grid")
     .Columns(columns =>
{
 columns.Bound(FTEReport => FTEReport.Jan)
.ClientGroupHeaderTemplate("#=sum#");

columns.Bound(FTEReport => FTEReport.Feb)
.ClientGroupFooterTemplate("#=sum#"); 
}
 .DataSource(ds => ds.Ajax()
.Aggregates(aggregates =>
{
aggregates.Add(p => p.Jan).Sum();
aggregates.Add(p => p.Feb).Sum();
 })
.Group(g =>
{
g.Add(c => c.Allocated);
g.Add(c => c.Project);
g.Add(c => c.Department);
})
.Read(read => read.Action("Aggregates_Read", "grid"))
 )
)

Regards
Lennart
Vladimir Iliev
Telerik team
 answered on 08 Jul 2013
2 answers
160 views
I use a splitter with a left and a right pane within a window widget. If I create the window with “Visible(true)” everything works as it should.
But since the window is supposed to be displayed, when the user clicks on a button, I have to use “Visible(false)” and make it visible after the click occurred.
 In this case the given pane size of the left pane seems to be ignored and the right pane is not displayed at all(see attached picture).

After manual resize of the splitter, it seems to work. But when I close the window and reopen it via Javascript, the size parameter is still ignored. Instead the
manual chosen size is used. It makes no difference if I use Ajax Loading or direct rendering. My Code:

Window:
@( Html.Kendo().Window()
       .Name("popupSplitter")
       .Title("Popup Splitter")
       .Draggable(true)
       .Modal(true)
       .Content(
           @<text>
<div>
    @RenderSplitter()
</div>
    </text>
)
        .Width(600)
        .Height(450)
        .Visible(false)
)
Splitter:
@helper RenderSplitter()
{
   @Html.Kendo().Splitter()
   .Name("MySplitter")
   .Orientation(SplitterOrientation.Horizontal)
   .HtmlAttributes(new { style = "width: 100%; height: 400px; " })
   .Panes(hPanes =>
       {
            hPanes.Add()
                  .Size("200px")
                  .MinSize("100px")
                  .Content(
                      @<text>
                           @RenderTreeView()
  </text>
                  )
                  .HtmlAttributes(new { id = "left_pane" });
 
            hPanes.Add()
                  .Scrollable(true)
    .HtmlAttributes(new { id = "right_pane" });
                  .Content(
                      @<text><p>test</p></text>
                );
        })
}
Button:
<button class="k-button" id="btnAdd" onclick="addSomething()"><span class="k-icon k-add"></span></button>
Javascript:
function addSomething() {
        var window = $("#popupSplitter ").data("kendoWindow");
        window.center();
        window.open();
}

Am I missing something here?
KRichter
Top achievements
Rank 1
 answered on 08 Jul 2013
6 answers
113 views
Dear KendoUI Team!
In one of my Views I alwas get a javascript error when I leave the focus of the Dropdownlist.

The error occurs in parseJSON in this line:
{return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)}

The Model looks like this:
[Required]
        [LocalizedDisplayName("Language")]
        public int PreferredLanguageId { get; set; }

And the cshtml is here:

div class="type-text">                            
                            @(Html.Kendo().DropDownListFor(m => m.PreferredLanguageId)
                            .Name("PreferredLanguageId")
                            .SelectedIndex(Model.PreferredLanguageId)
                            .BindTo(LeoHelper.GetLanguages())
                            .DataTextField("Text")
                            .DataValueField("Value")
                            )
                        </div>

Although the javascript Exception is thrown, the value is correctly saved.

brgds
Malcolm Howlett
Christopher
Top achievements
Rank 1
 answered on 08 Jul 2013
6 answers
276 views
Hello,

I have an editable grid and added a filter dropdown on the toolbar

       .ToolBar(c=>
        {
            c.Template(Html.Kendo().DropDownList()
               .Name("tb_factory_list")
               .DataTextField("factoryname")
               .DataValueField("factoryid")
               .Events(e => e.Change("onChange"))
               .SelectedIndex(0)
               .DataSource(source =>
                   {
                       source.Read(read =>
                           {
                               read.Action("GetFactories", "Home");
                           });
                   })
               .HtmlAttributes(new { style = "width:300px;float:right" })
               .ToHtmlString());
        })


problems :

1) How do I get the 'add new item' button back  ?
.ToolBar(tb => { tb.Create();  })

2) the width of the dropdown is whatever the width of the initial displayed item.
I had to manually force the dropdown to be wider to accomodate the widest item in the dropdown (see above 300px)
Is that normal ? can the dropdown resize to the widest item in the dropdown ?

3) when the page is opened, the dropdown displays the first item, but the onchange event is not called.
So initially, the results are not filtered by whatever the dropdown shows.
after I select another item in the dropdown, then the onchange is fired and filtering happens.
How can I filter correctly when the page is first loaded ?

Thanks
Marcel



Dongfen
Top achievements
Rank 1
 answered on 05 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?