Hi Cor,
Just a quick reply & thanks for your info :D !! I'll try the datagrid and
listview see which one is better for my case. Coz there're other issues I
need to consider if I use datagrid.
Also a question... in your example:
DataGridView1.DataSource = dt2
What is the > DataGridView1 < ?
Kay :)
"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:u3YESIQ9FHA.3776@TK2MSFTNGP10.phx.gbl...[color=blue]
> Kay,
>
> I made a sample from it, I thougth it works.
>
>
http://www.vb-tips.com/default.aspx?...3-8a9529b2b38b
>
> I hope this helps,
>
> Cor
>
>
> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> schreef in bericht
> news:OfuMtRM9FHA.2792@TK2MSFTNGP11.phx.gbl...[color=green]
>> Kay,
>>
>> Don't be afraid for looping that is done so many times behind the scene
>> and you don't see it.
>>
>> Another approach (I did not test it) is setting an extra columns to your
>> table "Author"
>>
>> Than you can use in that an expression to the parent.
>>
>>
http://msdn.microsoft.com/library/de...ionColumns.asp
>>
>> Than use the expression
>>
http://msdn.microsoft.com/library/de...ssionTopic.asp
>>
>> And than this part in it.
>> PARENT/CHILD RELATION REFERENCING
>>
>> A parent table may be referenced in an expression by prepending the
>> column name with Parent. For example, the Parent.Price references the
>> parent table's column named Price.
>>
>> Than you can use that datatable to use in a datagrid, and with nice
>> columnstyles you get in my opinion a nicer view on it than with a
>> listview.
>>
>> I would give it a try in your case.
>>
>> Cor
>>
>>
>>
>>
>> "Kay" <kk@micxsoft.com> schreef in bericht
>> news:OuLgAkG9FHA.1028@TK2MSFTNGP11.phx.gbl...[color=darkred]
>>> Hi Cor,
>>>
>>> I though of datagrid before but user must click on a link to see the
>>> child's data - since I simply want to show the Agent's name (instead of
>>> AgentKey), it seems listview may do the job - if I can retrive the data
>>> from a child table, let me explain :
>>>
>>> In roster table it has all the shift info like
>>> AgentID/date/time/campaign etc, so a roster record in the listview will
>>> looks like that
>>>
>>> Agent Name/Shift Date/Shift Start/Shift End
>>> Kay/01-11-2005/10.00/18.00
>>>
>>> They're in one row although the Agent name is coming from a different
>>> table. I've created a relation in a dataset, after I done a bit more
>>> reseach I found the GetChildRows method, however I need to loop thru the
>>> whole Agent table to get the name. I'm worring on the performance coz I
>>> need to link to 3 different table to display one roster record, and
>>> there may hundreds or roster records in the listview...
>>>
>>> Do you think I'm on the right track?
>>>
>>> Thanks!
>>> Kay
>>>
>>>
>>> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
>>> news:O4Rn42$8FHA.2264@tk2msftngp13.phx.gbl...
>>>> Kay,
>>>>
>>>> I first did not see that Bill gave you the correct answer.And now I see
>>>> he does not need the sample I have given him in a latter post.
>>>>
>>>> What I wanted to write to you was, that you would benefit not using the
>>>> listview for data-objects. (System.data). In that is the DataGrid and
>>>> the DataGridView optimalized. The listview will give you only as mostly
>>>> all who tried this sooner or later a lot of trouble.
>>>>
>>>> However if you persist, while I think that even the TreeView can be
>>>> better about what you wrote to Bill.
>>>>
>>>> You can get from every datarow with relations its childs and it parent
>>>> if those exist.
>>>>
>>>> Just my thought,
>>>>
>>>> Cor
>>>>
>>>>
>>>
>>>[/color]
>>
>>[/color]
>
>[/color]