This is a migrated thread and some comments may be shown as answers.

[Solved] MVC 2 Grid in Visual Basic

4 Answers 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Donna Stewart
Top achievements
Rank 1
Donna Stewart asked on 21 May 2010, 09:36 PM
I am developing a new MVC 2 web app in VS 2010 and Visual Basic and am trying to use the Telerik Extensions for ASP.NET MVC2.  I am using the Grid control with Edit and Delete command columns and it is working fine, except the Edit is a link and the Delete is a button.  It looks really weird.  Has anyone else had this issue?   Here's my code:

View:
 
<%@ Page Title="" Language="VB" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage(Of IEnumerable (Of com.gmcps.Messaging.Domain.MessageDefinition))" %>  
 
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">  
    Index  
</asp:Content>  
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">  
    <h2>  
        Index</h2>  
    <p>  
        <%: Html.ActionLink("Create New""Create")%>  
    </p>  
    <%= Html.Telerik().Grid(Model).Name("Grid") _  
                                      .DataKeys(Function(keys) keys.Add(Function(c) c.MSG_ID)) _  
                                      .DataBinding(Function(dataBinding) dataBinding.Server() _  
                                          .Select("Details""MessageDefinition") _  
                                          .Insert("Insert""MessageDefinition") _  
                                          .Update("Save""MessageDefinition") _  
                                          .Delete("Delete""MessageDefinition")) _  
                                      .Columns(Function(columns) columns.Bound(Function(p) p.MSG_Title)) _  
                                      .Columns(Function(columns) columns.Bound(Function(p) p.MSG_Message)) _  
                                      .Columns(Function(columns) columns.Command(Function(commands) commands.Edit())) _  
                                      .Columns(Function(columns) columns.Command(Function(commands) commands.Delete()))  
    %>  
</asp:Content>  
 

 

 

 

 

Any advice anyone can give is very much appreciated!

 

4 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 24 May 2010, 09:02 AM
Hi Donna Stewart,

You can observe this online example, which uses the same approach. You probably will notice that the Edit link in the example is also link. Thus the Edit button (link) uses GET request and Delete or Save use POST requests. This is by design in order to be more secured.

All the best,
Georgi Krustev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Donna Stewart
Top achievements
Rank 1
answered on 24 May 2010, 04:14 PM
Thank you Georgi for your help.  I really appreciate it.  The example in the link you've given renders Edit as a button even though it is a link when I view source.  When I run my code, the Edit is rendered as a link (the word Edit underlined) and Delete is rendered as a button.  I am beginning to think it is a stylesheet problem.  But I am not sure as to how to fix it.  Here is my Site.Master.  Any help you can provide is very much appreciated.
<%@ Master Language="VB" Inherits="System.Web.Mvc.ViewMasterPage" %> 
<%-- The following line works around an ASP.NET compiler warning --%> 
<%: ""%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>  
    <link href="../../Content/Site.css" rel="stylesheet" type="text/css" /> 
    <%= Html.Telerik().StyleSheetRegistrar() _  
            .DefaultGroup(Function(group) group.Add("telerik.common.css")) _  
            .DefaultGroup(Function(group) group.Add("Site.css")) _  
            .DefaultGroup(Function(group) group.Combined(True)) _  
            .DefaultGroup(Function(group) group.Compress(True))  
    %> 
</head> 
<body> 
    <div class="page">  
 
        <div id="header">  
            <div id="title">  
                <h1>My MVC Application</h1> 
            </div> 
            <div id="logindisplay">  
                <% Html.RenderPartial("LogOnUserControl")%>                  
            </div>   
            <div id="menucontainer">             
                <ul id="menu">                
                    <li><%: Html.ActionLink("Home", "Index", "Home")%></li>  
                    <li><%: Html.ActionLink("About", "About", "Home")%></li>  
                </ul> 
            </div> 
        </div> 
        <div id="main">  
            <asp:ContentPlaceHolder ID="MainContent" runat="server" /> 
            <div id="footer">  
            </div> 
        </div> 
    </div> 
    <%= Html.Telerik().ScriptRegistrar() %> 
</body> 
</html> 
 

It was my understanding that Telerik was going to provide the examples in VB as well as C#.  Maybe I was mistaken.  Are there any plans on providing VB examples?  Thank you again for your help! 
Donna
0
Accepted
Atanas Korchev
Telerik team
answered on 24 May 2010, 05:36 PM
Hi Donna Stewart,

Indeed it looks like a CSS problem. You have forgotten to include the theme css file -only the common one is included as can be seen from the pasted code. Please include telerik.vista.css or any other theme file.

As for the VB examples - we do have plans to add such but it will be after the Q2 release. Do let us know if you have any trouble implementing any scenario in VB.

Best wishes,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Donna Stewart
Top achievements
Rank 1
answered on 24 May 2010, 05:56 PM
Thank you Atanas.  That was the problem.  Now the Delete button overlaps the rendered Edit button.  I will just have to play around with the CSS to get it to look right.  Thank you again for your help and I look forward to Q2 and the VB examples.  And in the meantime, I appreciate your help!

Sincerely,
Donna
Tags
Grid
Asked by
Donna Stewart
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Donna Stewart
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or