PDA

Click to See Complete Forum and Search --> : datagrid and object


Borry
Jul 10th, 2003, 07:28 AM
Hello everybody,


I have a design problem :(

I created two objects.
A Package object and a good object. One package object contains a public collection of good objects. (one-to-many relation)

I also have more than one package. So I have one page where I put my described packages in a datagrid. I also activated the edit button.

What I want to achieve is that a person clicks on the edit button, this opens a new page and there I see the goods in the package (also on a datagrid).

Right now I'm looking for an easy solution so I can 'hang' each corresponding package object to the corresponding edit button in the datagrid. (I hope I explained it well)

So I can jump to a new page together with the package object.

I really hope someone can help me out, cause I've been looking for a technique, but I can't figure on out !

Thanks in advance,

Bjorn

hellswraith
Jul 10th, 2003, 11:38 AM
You just need to find out which row was clicked right? Well, you use the ItemCommand event of the datagrid and you can get one of the cells contents to match up or do what you want with.

Dim cellContents As TableCell = e.Item.Cells(0)
Dim cellContentsInStringForm As String = cellContents.Text


Look for something unique, like the primary key. This way you pass the primary key to the new page via querystring or something and it can take that and look up the right 'good' values.

Borry
Jul 10th, 2003, 01:11 PM
Indeed,

that's the way how I've implemented it right now. I asked the question here cause there was maybe an easier way for it.

Thanks