Binding GridView to dynamic LINQ queries

Z

zainab

Hello;

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Data binding with linq query 0
LINQ and Gridview 2
Linq 5
LINQ to SQL - DataContext 3
Linq to entites 13
linq and asp.net 6
linq to object query 1
linq to DataTable issues 0

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top