HI,
 
Use a data grid inside another data grid. The first grid will hold the master 
data and the inner grid will hold the detail data.
 
Get the results in a dataset and using two SQL queries, one will fetch the 
master data and the other will fetch the child data(Use stored proc). So your 
dataset will have two tables. and use the following code

dsResult.Relations.Add("ProductRel", ds.Tables(0).Columns("ProductId"), 
ds.Tables(1).Columns("ProductId"))

datagrid1.datasource = dsResult

datagrid1.DataBind.
 
Then write a function 
 

Protected Function GetChildRelation(ByVal dataItem As Object, ByVal relation As 
String) As DataView

Dim drv As DataRowView = CType(dataItem, DataRowView)

If Not IsNothing(drv) Then

Return drv.CreateChildView(relation)

Else

Return Nothing

End If

End Function

Then in the ASPx page go to html view and on the datasouce property of the 
inner grid set datasource as the above function inside aspx tabgs
 
For example
 
DataSource= GetChildRelation(Container.DataItem, "VendorEvents")
 
This will work
 
Thanx
Anoop
 


Keerthy <[EMAIL PROTECTED]> wrote:
Hi,

U won't be needing a datatable as I said earlier.
Once u populate the grid go thru each row and see if
the product id is repeating. If yes, then set that
cell's text to nullstring

Rgds,
Keerthy

--- Tommaso Esmanech <[EMAIL PROTECTED]> wrote:

> Hi, 
> 
> thank you for the help...could you share an example?
> thanks
> Tom
> 
> --- Keerthy <[EMAIL PROTECTED]> wrote:
> 
> > 
> > Hi Tom,
> > 
> > I would suggest you to populate a datatable from
> the
> > resultset. Loop thru the datatable and set the the
> > repeating row/column to null string.
> > After which, this datatable can be set as the
> > datasource to the datagrid to obtain the data in
> the
> > format u require.
> > 
> > 
> > Bye,
> > Keerthy
> > 
> > --- Tom <[EMAIL PROTECTED]> wrote:
> > 
> > > 
> > > 
> > > I have to admit I am notice at ASP.NET though I
> > have
> > > been doing some 
> > > cool staff. 
> > > I am writting because I need support in
> something
> > > that some of you 
> > > might define as really easy..
> > > 
> > > I am creating a dynamic webpage in ASP.NET in VB
> > > linked to an access 
> > > database. The links with the database is
> > > perfect, I can use datalist, datagrid and
> > > dataitem.container...
> > > 
> > > The problem I have is a way to display the info
> I
> > > get from the 
> > > database. 
> > > 
> > > I have two tables
> > > 
> > > Product
> > > -----------
> > > Product_id         Name_P  
> > > 1                       P1
> > > 2                       P2
> > > 
> > > 
> > > Sub_Product
> > > ------------------
> > > Product_id          Name_SP  Sub_Product_id
> > > 1                        SP1          1
> > > 1                        SP2          2
> > > 1                        SP3          3
> > > 2                        SP4          4
> > > 2                        SP5          5
> > > 
> > > The two tables are linked in a Access Query
> where
> > it
> > > should take all 
> > > the
> > > subproducts.product_id=product.product.id that
> are
> > > equal to 
> > > 
> > > Query:menu_query
> > > Sub Product                              
> Product
> > > ------------------                              
> > > -------------
> > > Product_id    ------------------------     
> > > Product_id
> > > Name_SP                                    
> Name_P
> > > Sub_Product_id
> > > 
> > > 
> > > In ASP I have not problems to display them like
> > this
> > > 
> > > P1          SP1
> > > P1          SP2
> > > P1          SP3...
> > > P2          SP4....  and so on...
> > > 
> > > What I want to achieve is a grouping by, and it
> > > should display like 
> > > this
> > > 
> > > 
> > > P1        
> > >               SP1
> > >               SP2
> > >               SP3
> > > P2     
> > >               SP4
> > >               SP5
> > > 
> > > 
> > > I have tried to use the nesting of datagrid in a
> > > datagrid, though it 
> > > does not give me the level of flexebility I want
> > in
> > > the design of 
> > > the webpage.
> > > 
> > > Do you have a piece of code to share that should
> > > work
> > > I can share the all aspx file and mdb file as
> well
> > > if it helps
> > > 
> > > thanks
> > > Tom 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > 
> > 
> > 
> >             
> > __________________________________ 
> > Do you Yahoo!? 
> > Take Yahoo! Mail with you! Get it on your mobile
> > phone. 
> > http://mobile.yahoo.com/maildemo 
> > 
> > 
> >  
> > Yahoo! Groups Links
> > 
> >
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
> > 
> >    
> > [EMAIL PROTECTED]
> > 
> >  
> > 
> > 
> > 
> > 
> 
> 
> 
>             
> __________________________________ 
> Do you Yahoo!? 
> Send holiday email and support a worthy cause. Do
> good. 
> http://celebrity.mail.yahoo.com
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Yahoo! Groups SponsorADVERTISEMENT


---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
  
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


Yahoo! India Matrimony: Find your life partneronline.

[Non-text portions of this message have been removed]






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to