views:

50

answers:

1

Hello,

I Have a gridview object and i want to bind it to Object..

My Object is

namespace DataBinding
{

public class BindingObject
{
   public ColorInfo Color { get; set; }
    public string Name { get; set; }

   public struct ColorInfo {
        public string Red { get; set; }
        public string Green { get; set; }
        public string Blue { get; set; }
    }
}

}

I want that in the gridview i will see only the Name Property And Red property.. Now when i bound it my gridview see like this: Color column and Name Column and i want Red column and Name Column..

How i do this..

Thanks..

A: 

ok Thank but if i want to add a set propery.. when i do it: public string Red { get { return this.Color.Red; } set { this.Color.Red = value; } } there is error : Error 1 Cannot modify the return value of 'DataBinding.BindingObject.Color' because it is not a variable Thank you for the fast rply

liran