Binding GridView to dynamic LINQ queries
am 31.12.2007 20:44:09 von zainabHello;
I'm giving my first steps in asp.net and so i've decided to integrate
LINQ also to it.
What I intend to do is to have a GridView that can receive and display
any sort of linq queries' results I feed to it through the DataSource
property (and later Bind it to them) and to let me work over that data
afterwards (namely hiding columns based on their rowheader name).
But the problems arise when I try to manipulate the data there.
If I choose to have the columns automatically added, they dont get
inserted in the Columns property and i can't work with them in order
to hide them. I've used the RowCreated event to try and hide it, but i
can't read from the RowHeader and extract the column names.
If I don't have them automatically added, I lose the dynamic aspect to
it.
I also tried using the automatic DataSource property from the GridView
but it makes things static again.
Am I asking too much of the GridView's binding?