Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > DataGrid - Multiple values in single Row

Reply
Thread Tools

DataGrid - Multiple values in single Row

 
 
malavika reddy
Guest
Posts: n/a
 
      11-03-2004

Hi,

Been stuck on this one for a bit. Would really appreciate any help on
this one.

In Regards to ASP.NET

To start. I have a dataset al like this (ex)

------------------------------------
category | category type
------------------------------------
categ1 type-1
categ1 type-2
categ1 type-3
categ2 type-4
categ3 type-6
categ3 type-7
categ3 type-8


I need to display this in a way (DataGrid)


It will need to look something like this:

------------------------------------------
category | category type
------------------------------------------
categ1 type-1
type-2
type-3
-----------------------------------------
categ2 type-4
---------------------------------------
categ3 type-6
type-7
type-8
---------------------------------------



Has anybody got something like this working.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      11-03-2004
The directions:

In PreRender event loop through the data rows. When you detect a new value
for category, save it. For the next row check if the category value matches
the saved one. If it does, replace it with an empty string. If it doesn't,
add a border-top css rule.

Eliyahu

"malavika reddy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Hi,
>
> Been stuck on this one for a bit. Would really appreciate any help on
> this one.
>
> In Regards to ASP.NET
>
> To start. I have a dataset al like this (ex)
>
> ------------------------------------
> category | category type
> ------------------------------------
> categ1 type-1
> categ1 type-2
> categ1 type-3
> categ2 type-4
> categ3 type-6
> categ3 type-7
> categ3 type-8
>
>
> I need to display this in a way (DataGrid)
>
>
> It will need to look something like this:
>
> ------------------------------------------
> category | category type
> ------------------------------------------
> categ1 type-1
> type-2
> type-3
> -----------------------------------------
> categ2 type-4
> ---------------------------------------
> categ3 type-6
> type-7
> type-8
> ---------------------------------------
>
>
>
> Has anybody got something like this working.
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
 
Rajesh Tiwari
Guest
Posts: n/a
 
      12-02-2004
you can set a global variable say "categ"

then

loop through the items in itemdatabound event of datagrid and
set the value of categ to the new value. and compare the value of categ and
the value you get fom database and based upon that set the contents of the
cell to empty.
e.g
dim categ as string=""
public sub onitemdatabound( sender as object ,e as datagriditemeventargs)
if e.itemtype=itemtype.item or e.item.itemtype=itemtype.alternatingitem then
catfromDB=e.item.dataitem("category")
if catFromDB =categ and categ<>"" then
e.item.cells(0).text=""
else
e.item.cells(0).text=catFromDB
end if
categ=catFromDB
end sub

the code may not work exactly as it is written but it is just to give you
some idea how to proceed.

"malavika reddy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Hi,
>
> Been stuck on this one for a bit. Would really appreciate any help on
> this one.
>
> In Regards to ASP.NET
>
> To start. I have a dataset al like this (ex)
>
> ------------------------------------
> category | category type
> ------------------------------------
> categ1 type-1
> categ1 type-2
> categ1 type-3
> categ2 type-4
> categ3 type-6
> categ3 type-7
> categ3 type-8
>
>
> I need to display this in a way (DataGrid)
>
>
> It will need to look something like this:
>
> ------------------------------------------
> category | category type
> ------------------------------------------
> categ1 type-1
> type-2
> type-3
> -----------------------------------------
> categ2 type-4
> ---------------------------------------
> categ3 type-6
> type-7
> type-8
> ---------------------------------------
>
>
>
> Has anybody got something like this working.
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
resolve single line with multiple items into mutliple lines, single items ela Perl Misc 12 04-06-2009 06:47 PM
[Datagrid,web form]: How the get the correct row values after sorting datagrid by header AlainCD ASP .Net Datagrid Control 0 01-12-2006 09:07 AM
BoundColumn single DataBind equiv but not in a single row? Randall Parker ASP .Net 1 12-12-2005 04:11 PM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
How to add a new row to a datagrid with values of the selected row =?Utf-8?B?U3VyZXNo?= ASP .Net 1 11-22-2004 09:04 AM



Advertisments