Telerik Forums
UI for ASP.NET MVC Forum
2 answers
236 views
Hi , can you point me to some samples , documentation to go about a keyword search implementation.
We have a textbox and search button which is supposed to filter the data on the grid. 
On the button click, we pass the keyword but how do I pass it to the grid controller? 
The grid by default calls the controller to fill all the values but if they enter a keyword search,
how do I pass that value to the grid by default lists all the values. 
It's a simple keyword filter on the grid but I haven't found any help. RIght now , we use class level variables 
to make it work but there is probably a better way. 
DAR
Top achievements
Rank 1
 answered on 05 Feb 2013
2 answers
372 views
Hi

I'm struggling to get a tabstrip to get it's content from a partial view when it's in a details template of a grid view as I get an invalid template error.

If I take the tabstrip out of the grid details view it works fine.

The code:

<script id="expscenDetail" type="text/kendo-tmpl">
    @(Html.Kendo().TabStrip()
           .Name("TabStrip")
           .SelectedIndex(0)
           .Items(items =>
            {
                items.Add().Text("Chart")
                    .LoadContentFrom("_eDetail", "Tray")
                    .Selected(true);
                items.Add().Text("Text")
                    .LoadContentFrom("_eDetail", "Tray");
            }))
</script>

_eDetail - partial view
<div >
    <ul>
        <li><label>Code:</label></li>
    </ul>
</div>
Controller
public ActionResult _eDetail()
 {
            return PartialView();
 }

If I put a break point on the controller it doesn't even get hit, so I believe it's a problem with how the loadcontent() part is parsed.

The error:
<div class="k-widget k-tabstrip k-header" id="TabStrip"><ul class="k-reset k-tabstrip-items"><li class="k-item k-state-default k-state-active"><a class="k-link">Chart</a></li><li class="k-item k-state-default"><a class="k-link">Text</a></li></ul><div class="k-content k-state-active" id="TabStrip-1" style="display:block"></div><div class="k-content" id="TabStrip-2"></div></div><script>
    jQuery(function(){jQuery("#TabStrip").kendoTabStrip({"contentUrls":["/Tray/_eDetail","/Tray/_eDetail"]});});
' Generated code:'var o,e=kendo.htmlEncode;with(data){o='\n    <div class="k-widget k-tabstrip k-header" id="TabStrip"><ul class="k-reset k-tabstrip-items"><li class="k-item k-state-default k-state-active"><a class="k-link">Chart</a></li><li class="k-item k-state-default"><a class="k-link">Text</a></li></ul><div class="k-content k-state-active" id="TabStrip-1" style="display:block"></div><div class="k-content" id="TabStrip-2"></div></div><script>\n\tjQuery(function(){jQuery("';TabStrip").kendoTabStrip({"contentUrls":["/Tray/_eDetail","/Tray/_eDetail"]});});
;o+=;}return o;'
Is there anyway around this? Or am I just trying to take it a step too far?

Thanks
Daniel
Telerik team
 answered on 05 Feb 2013
1 answer
143 views
Just don't see what I'm doing wrong here.

The data is returned perfectly when viewing in Firebug - The progress spinner on the dropdown runs and then turns into an arrow.....just nothing when I click on the dropdown.

@(Html.Kendo().DropDownListFor(model=>model.UserId)
.Name("UserId")
.DataTextField("Name")
.DataValueField("Id")
.OptionLabel("Select User")
.DataSource(source => {
source.Read(read =>
{
read.Type(HttpVerbs.Post);
read.Action("GetUserDropDown", "Admin");
});
}))
Daniel
Telerik team
 answered on 05 Feb 2013
1 answer
102 views
From the documentation about autocomplete 
.
Filter("contains") //Define the type of the filter, which autocomplete will use.

I noticed that the Filter method has some hard-coded values.What are the other filter types?
if other controls also have this kind of hard-coded values,where can i find them?also,they are case-sensitive?

Regards,
Daniel
Dimiter Madjarov
Telerik team
 answered on 05 Feb 2013
2 answers
181 views
How can I invoke an edit controller from a grid?  I have tried adding a custom command with an Action("Edit","Customers") but there does not seem to be a way to pass the CustomerID to the action.  I got the javascript code from the sample custom command grom the grid demo, but I don't seem to be able to make it work.  This is what I have, but it doesn't seem to execute the click.

@model IEnumerable<LightRouteDB.Customer>
 
@{
    ViewBag.Title = "Customer List";
}
 
@(
 Html.Kendo().Grid(Model)
    .Name("CustomerGrid")
    .Pageable()
    .Sortable()
    .Filterable()
    .Columns(cols =>
    {
        cols.Bound(c => c.CustomerNum).Width(100).Groupable(false);
        cols.Bound(c => c.CustomerName).Width(200);
        cols.Bound(c => c.BillAddr1).Width(200).Title("Address");
        cols.Bound(c => c.BillCity).Width(100).Title("City");
        cols.Bound(c => c.TotalDue).Format("{0:c}").Title("Balance");
        cols.Command(cmd => cmd.Custom("Edit").Text("Edit").Click("editCustomer"));
    })
)
 
<script type="text/javascript">
    function editCustomer(e) {
        e.preventDefault();
                 
        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
        window.nav("/customers/edit/" + dataItem.CustomerID);
    }
</script>
Deon
Top achievements
Rank 1
 answered on 05 Feb 2013
2 answers
64 views
I was wondering if there was a way to specify a particular tab animation as the default across my entire MVC project without having to explicitly specify it on each tabstrip.  Or would I have to put the same fluent markup in all my tabstrips?

Thanks for your assistance.

Regards,
Brian
Brian Roth
Top achievements
Rank 1
 answered on 04 Feb 2013
3 answers
116 views
Hi,
When closing the edit popup in grid, you should just close it, not cause a postback. Or is there a reason why it causes a postback?

Regards,
Mattias
Daniel
Telerik team
 answered on 04 Feb 2013
3 answers
89 views
I want the user to be able to make a selection in my grid and then when they close the grid I want the selection passed back to a text box on my page.  My grid is actually in a window.  So the user clicks a button, it opens my grid and shows a table.  I have all of this code working, but now I need to have the selected item passed back to the text box.  I have tried this function on the close event of the window.
function onClose() {
    var selected = $.map(this.select(), function(item) {
        return $(item).text();
    });
    $("#safekeep").text = selected.toString;
}

Any suggestions? Or is there a tutorial somewhere for this?

 

 

 

Daniel
Telerik team
 answered on 04 Feb 2013
1 answer
77 views
It is possible to hit the Add New button 3 times to get the blank lines and then let the user enter all the values?  Currently you have to hit add new, then add one, hit add new again then add one..

Thanks
Chris
Petur Subev
Telerik team
 answered on 01 Feb 2013
2 answers
406 views
Hello,

Is possible show a data base image (for example product photo) to a grid's popup template 
I try Try this in my editor template view, but id is always 0:
<img src='@Url.Action( "ShowFoto", "Pacientes", new {id = Model.Id} )' />
The controller action is:

public ActionResult ShowFoto(int id)
{
    var imageData = _db.Pacientes.Find(id).Foto;
 
    if (imageData != null)
    {
        return File(imageData, "image/jpg");
    }
    return null;
}
Another question is how to add a new image from the template popup window?

Thanks!
LUIS
Top achievements
Rank 1
 answered on 01 Feb 2013
Narrow your results
Selected tags
Tags
+? 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?