Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • How do I add a link as a field (column) in the new grid view. I am working in MVC razor. I did the following code but it is giving error.

                                    @Html.DevExpress().GridView(
                                     settings =>
                                    {
                                    ......
                                    ......
                                    var myColumn = settings.Columns.Add("Link name","#");myColumn.SetDataItemTemplateContent(c =>
                                    (DataBinder.Eval(c.DataItem, "Advisor").ToString(), "Details", new { id = DataBinder.Eval(c.DataItem, "userId") });

                                    });

                                You must  log in  or  register  to leave comments

                                1 Solution

                                0

                                Hi,

                                Your code should be as follows:


                                	
                                [C#]
                                settings.Columns.Add(column => { column.FieldName = "YourFieldName"; column.Caption = "YourCaption"; column.ColumnType = MVCxGridViewColumnType.HyperLink; var hyperLinkProperties = column.PropertiesEdit as HyperLinkProperties; //Specify hyperLinkProperties here });

                                If you wish to specify content of the DataItem template, refer to the GridView - How to track changes made with an unbound CheckBox in the DataItemTemplate example

                                See Also:
                                HyperLinkProperties

                                • Priyesh DR 08.07.2012

                                  Thanks. It worked.

                                You must  log in  or  register  to leave comments

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners