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

Nested Grids

1 Answer 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rosco
Top achievements
Rank 1
Rosco asked on 29 May 2010, 04:48 AM
Hi,

I am currently having a few problems with nested RadGrids. I have created a custom class called "Project" which has the following properties:

  • ProjectId (Guid)
  • ProjectName (string)
  • Status (string)

I then retrieved all Projects from a database, and stored them within a List<Project> object. I then bound my RadGrid to this list. This displays the grid in the following way:

ProjectID                                                                               ProjectName                                Status
4304e5b6-6264-df11-8942-00155d031a14                         Test 1                                          In Development

I don't want to show the ProjectId column from the grid. I cannot remove the ProjectId property from the Project class because I need to set this value so I can later on retrieve all "Tasks" belonging to the Project. Is there any way I can remove the column from the grid?

Thanks,
Roshan

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 01 Jun 2010, 07:57 AM
Hello Rosco,

You can access the column by using GetColumn method and make its visibility as false. Check out the following code snippet.

C#:

  
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        RadGrid1.MasterTableView.GetColumn("ProjectID").Visible = false
    } 

Thanks,
Princy.


Tags
Grid
Asked by
Rosco
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or