Telerik Telerik
The Telerik Blogs

The Grid in Microsoft ASP.NET MVC Beta

Friday, October 17, 2008 by Vladimir Enchev | Comments 9

As you know this week Microsoft released ASP.NET MVC Beta and I've updated my last grid example to the latest ASP.NET MVC version.

I needed to change only two things:

- Ajax.Form changed to Ajax.BeginForm/Ajax.EndForm
- Html.SubmitButton changed to plain <input type="submit" />

and everything worked instantly!

Untitled

[Live | Download]

9 Comments

  • Thomas Gorissen 08 Feb
    Hey Vladimir,

    love Teleriks efforts on  MVC! I'm currently trying to get your Grid Ajax example running with the RC1 of MVC. The BindingHelperExtension is not existant anymore, so I want to figure out another working solution.

    Are you planning to update this example to the RC1? It would help me a lot.
    Will there be a version of your Controls that will not need the code behind anymore?

    Thanks and keep up the good work!

    Thomas
  • Pawan 28 Mar
    Hi Vladimir,
    Thank you very much for this grid example. I am building a POC for one of the coming projects. I want to have a more detailed pager template as Telerik offers usually for a normal form based radgrid.
    Another point--have you upgraded this example to the latest release of asp.net mvc..
  • Pawan 31 Mar
    How can we generate hyperlinks on column values to open the different pages in the application.
  • Quan Nguyen 17 Apr
    How can I convert all components to code-behind components like things in your sample project above~2ci~27ve try to search it but still can~27t find the answer.~3cbr /~3e ~3cbr /~3e Thank~2cand plz mail me your reply~3cbr /~3e
  • Gilberto 10 Jun
    Slight bug on the live example,  when i click on edit i get an error window saying 'sys' is undefined
  • Simon 05 Nov
    How can I use filter in Grid? In the example isn't use. Thank You
  • Simon 05 Nov
    How can I use filter in Grid? In the example isn't use. Thank You
  • Vlad 10 Nov
    Hi,

    This demo is related to old version on Microsoft ASP.NET MVC + RadGrid for ASP.NET AJAX. Please check this link for more info about our new MVC grid:
    http://www.telerik.com/products/aspnet-mvc.aspx

    Vlad
  • Hilda Fabiola Bernard 30 Nov
    Hi Vladimir,

    I am new to using Telerik and asp.net.
    The application I'm trying to build uses telerik ajax controls in asp.net MVC2 application.
    I have used a Telerik RadGrid of Ajax in my view of the mvc2 application as follows:

     

    <form runat="server" id="form1" method="post">  
     
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
     
    </telerik:RadScriptManager> 
     
    <h2>Index</h2> 
     
     
    <telerik:RadGrid ID="RadGrid1" runat="server"   
     
    DataSourceID="SqlDataSource1" AllowPaging="True" GridLines="None"   
     
    AllowMultiRowSelection="True" Skin="Web20" AutoGenerateColumns="False">  
     
    <MasterTableView DataSourceID="SqlDataSource1" AllowFilteringByColumn="True"   
     
    DataKeyNames="Val1">  
     
     
    <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings> 
     
    <RowIndicatorColumn> 
     
    <HeaderStyle Width="20px"></HeaderStyle> 
     
    </RowIndicatorColumn> 
     
    <ExpandCollapseColumn> 
     
    <HeaderStyle Width="20px"></HeaderStyle> 
     
    </ExpandCollapseColumn> 
     
    <Columns> 
     
    <telerik:GridBoundColumn DataField="Val1" HeaderText="Val1"   
     
    SortExpression="Val1" UniqueName="Val1">  
     
    </telerik:GridBoundColumn> 
     
    <telerik:GridBoundColumn DataField="Val2" HeaderText="Val2" ReadOnly="True"   
     
    SortExpression="Val2" UniqueName="Val2">  
     
    </telerik:GridBoundColumn> 
     
     
    </Columns> 
     
    </MasterTableView> 
     
    <ClientSettings ActiveRowIndex="0" AllowKeyboardNavigation="True" > 
     
    <Selecting AllowRowSelect="True" /> 
     
    </ClientSettings> 
     
    </telerik:RadGrid> 
     
     
       
     
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"   
     
    ConnectionString="<%$ ConnectionStrings:SomeConnectionString %>"   
     
    SelectCommand="SELECT * FROM [someTable]"></asp:SqlDataSource> 
     
     
    <input type="submit" value="Submit"/>  
     
     
     
     
    </form> 
     

     

    I want to access the selected values from the RadGrid in my controller(atleast the key value). How can I do that?

    Thanks in advance,
    Hilda

     

Add comment

  1. Formatting options
       
     
     
     
     
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)