Forum Moderators: buckworks

Message Too Old, No Replies

Gridview tabular data display

I want to display data in gridview in tabular format

         

ashish21cool

6:07 am on May 13, 2008 (gmt 0)

10+ Year Member



Hi,

I have a gridview. I need to display data in gridview in tabular format.
It goes something like this:

¦Game1¦Game2¦.....
Tech1¦ 5 ¦ 10 ¦.....
Tech2¦ 45 ¦ 77 ¦.....
.........
......

Games can be anything from 1 to n
Also Tech can be anything from 1 to n.

games & tech will be dependent on the user when they enter it in the db.

Also 5, 10 are the numbers that are referenced like this:
Game1, Tech1 - 5
Game2, Tech1 - 10
Game1,Tech2 - 45.......

So I am not understanding what shud be best used for this purpose.

Please throw some light and help me out.

Thanks for you time.

lorax

11:28 am on May 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm not sure I understand what you're asking for. Are you looking for a better way to present the results?

Perhaps this?

--------- tech 1 --- tech 2
Game 1------ 5 ------ 45
Game 2 ---- n -------- n

ashish21cool

12:19 pm on May 13, 2008 (gmt 0)

10+ Year Member



No.

I want the data to be displayed in tabular format.
But my problem is neither my rows, columns are fixed. Basically i need to display data in such a way that there is an intersection of the data is correct.
For e.g:
Tech1
¦
¦
Game1-- 5 .....
.
.
.
.
.

How shud i display all the values properly. The tech1 and game1 shud intersect to give 5.
When tech2 and game1 comes it shud give 45

Tech1 Tech2....
¦ ¦
¦ ¦
Game1-- 5 45......
.........
.........

How shud i store data so that each value comes correct with the corresponding tech and game names.

Let me know if you still dont get it.

I went thrugh controls like gridview but they can display all the data vertically.

lorax

12:45 pm on May 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>> want data displayed in tabular format

but that's what I'm trying to show you. Maybe the -- were throwing you. I used them for spacing.

Let's use words instead.

What I think you're asking for:

Rows for each game. purpose: holds the name of the game and intersects with columns for techs.

Column for each Tech. purpose: holds the name of each tech and intersects with the rows for each game.

At the intersection: Where the game row and the tech column intersect will be the score the tech had for that game.

Yes?

And you refer to Gridview like it was a program or special format. What do you mean by this? To me grids are essentially tables.

ashish21cool

5:59 am on May 14, 2008 (gmt 0)

10+ Year Member



Yes u r correct.

But my issue is i dont know how many games or techs will be entered by the user. So how shud i display the data.
If i make a column named games. Then i can store all the names of the games in it. But if i use gridview and bind it to the games column then I will get all the columns in 1 column. But what i want is all the games names in games column to come as a header for each column.

One option is to set the column headers programmatically.
But then how shud i add the intersection values?
Because if i write the query for each intersection then it will be too long.

Hoper this might help u in better understanding.

lorax

12:48 am on May 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well you either need to limit the number of inputs or use pagination to control the current view - or let it be. So what if they put on 100 techs and 1000 games. Scroll bars work if need be.

If you want the data to be confined within a 980px screen width, then you'll need to define the limits. I'd personally allow the user to choose from sets of data. For instance, display the first ten columns (1-10) and then have pagination links for 11-20, 21-30, and so on. THis way you can control how much is displayed yet give the user the ability to see more.

ashish21cool

10:10 am on May 15, 2008 (gmt 0)

10+ Year Member



Well, thanks for you reply, but I have actually not got the answer to my question.
It looks like i am unable to explain you properly. Sorry for that.
Anyways cheerzzzzz

lorax

12:24 pm on May 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm glad you got it sorted.

ashish21cool

12:38 pm on May 15, 2008 (gmt 0)

10+ Year Member



No Lorax, its not yet sorted.
I dont know what I am going to do with it but i will do something that's for sure.

ashish21cool

10:57 am on May 17, 2008 (gmt 0)

10+ Year Member



Hi Lorax,

I got the solution.

Just for ur info:

I will pull the data and insert into datatable.
Then, that data will be inserted into another datatable but horizontally into just first row.

Till here, I will get table structure (column names and rows) created.
On similar grounds, all the other data will be fed into another (temp kind of)datatable and will be inserted horizontally into the main datatable.

Hope this will get you some clearity.

Sorry, if I had confused u.

Best regards,
Cheerzzzzz