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

[Solved] how to configure the grid columns from the controller.

2 Answers 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jignesh
Top achievements
Rank 1
Jignesh asked on 29 Jun 2011, 09:30 AM

When I configure grid from Controller then Display button for Edit & Delete, But I wants to display image for Edit & Delete. So please help me “ How to display image for Edit & Delete”. My Source Code is below. Now what I wants to change in my code.

public ActionResult Index()

        {

            var columns = new[] 

             { 

                 new GridColumnSettings

                 {                  

                     Member = "RoleName",

                     Width = "200px" ,

                    

                 },

                 new GridColumnSettings

                 {                  

                     Member = "RoleGroupID",

                     Width = "130px",

                     Title ="RoleGroupName"

                    

                 }, 

                 new GridColumnSettings

                 {                  

                     Member = "IsActive",

                     Width = "130px" 

                 },             

                                              

                 new GridCommandColumnSettings 

                 {                 

                     Commands =   

                     {               

                         new GridEditActionCommand(),

 

                         new GridDeleteActionCommand()

                     },                  

                     Width = "200px",   

                     Title = "Commands"

                     

                    

                 }        

             };

            ViewData["Columns"] = columns;

            ViewBag.rList = rms.GetRoles();

            ViewBag.RoleGroupList = RoleList();

            return View();

 

        }

 

 

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 30 Jun 2011, 12:33 PM
Hi Jignesh,

Instead of writing

Commands =   
{               
      new GridEditActionCommand(),
      new GridDeleteActionCommand()
}


you can define the grid action commands beforehand and set their ButtonType property., e.g. set it to GridButtonType.Image.

Best wishes,
Dimo
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
Jignesh
Top achievements
Rank 1
answered on 01 Jul 2011, 12:04 PM
But , How????
Tags
General Discussions
Asked by
Jignesh
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Jignesh
Top achievements
Rank 1
Share this question
or