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

Keeping property from showing up in RadGridView

3 Answers 127 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bradley
Top achievements
Rank 1
Bradley asked on 06 Dec 2011, 05:21 PM
In MyBusinessObject I have 3 properties:

MyValue
Name
and ID

ID is required by an interface I'm interfacing, but I don't want it to actually show up on the GridView.  I tried

        [Browsable(false)]
        public string Id

but it still shows up, and I didn't see anything in the demo that would help.  Any advice?  Thanks.

3 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 06 Dec 2011, 05:26 PM
Hello Bradley,

There are two options that you can choose. The first if to turn of Column Autogenerating on the grid view and create just the columns that you need manually. The second is to hook up to the AutoGeneratingColumn event and cancel the creation of the "ID" column there. 

Hope this helps!

Kind regards,
Nik
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Bradley
Top achievements
Rank 1
answered on 06 Dec 2011, 05:45 PM
Went with 2nd option, word perfect.  Thanks!
0
Tyree
Top achievements
Rank 2
answered on 08 Dec 2011, 12:58 AM
Perhaps I am misunderstanding the question but a 3rd option would be using a decorator before the property.

using System.ComponentModel.DataAnnotations;
  
[Display(AutoGenerateField = false)] 
public string Id { get; set; }
No?
Tags
GridView
Asked by
Bradley
Top achievements
Rank 1
Answers by
Nick
Telerik team
Bradley
Top achievements
Rank 1
Tyree
Top achievements
Rank 2
Share this question
or