This is a migrated thread and some comments may be shown as answers.
Basic filtering example
2 Answers 45 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ben
Top achievements
Rank 1
Ben asked on 27 Mar 2012, 01:16 AM
Hi guys, we've been trying to get a basic search working on the grid, but with no luck. The example I tried to follow was:

http://demos.telerik.com/aspnet-mvc/razor/grid/filtering 

Which contains the code:

@using (Html.Configurator("Filter by ...")
              .PostTo("Filtering", "Grid")
              .Begin())
   {
    <p>
        <label for="startsWith"><strong>Contact Name</strong> starts with:</label>
        @Html.TextBox("startsWith", "Paul")
    </p>
     
    <button class="t-button t-state-default" type="submit">Apply</button>
 }

Now after fishing around I found out the Html.Configurator class isn't actually included and supposedly isn't needed either. So how do you do this then?

2 Answers, 1 is accepted

Sort by
0
Dadv
Top achievements
Rank 1
answered on 27 Mar 2012, 01:27 PM
Hi,

Html.Configurator is a warp of Html.BeginForm :

@using (Html.Configurator("Filter by ...")
             
.PostTo("Filtering", "Grid")
             
.Begin())
   
{
   
<p>
       
<label for="startsWith"><strong>Contact Name</strong> starts with:</label>
       
@Html.TextBox("startsWith", "Paul")
   
</p>
   
    <button class="t-button t-state-default" type="submit">Apply</
button>
 
}

Is the same than

@using (Html.BeginForm("Filtering", "Grid",FormMethod.Post,new{@class="configurator"})
   
{ <div> <h3 class="legend">Filter by ...</h3>
   
<p>
       
<label for="startsWith"><strong>Contact Name</strong> starts with:</label>
       
@Html.TextBox("startsWith", "Paul")
   
</p>
   
    <button class="t-button t-state-default" type="submit">Apply</
button> </div>
 
}
0
Ben
Top achievements
Rank 1
answered on 27 Mar 2012, 11:58 PM
Thanks Dadv, that's cleared it up. The examples need a few comments to help out the new guys (the ones that usually need examples) IMHO.
Tags
Grid
Asked by
Ben
Top achievements
Rank 1
Answers by
Dadv
Top achievements
Rank 1
Ben
Top achievements
Rank 1
Share this question
or