Re: Attaching Event With Parameters to image control created dynam
From: WebMatrix (WebMatrix_at_discussions.microsoft.com)
Date: 12/07/04
- Next message: John M Deal: "Re: Problem with asp.net app only allowing 1 user at a time"
- Previous message: Ken Dopierala Jr.: "Re: deploying asp.net application"
- In reply to: Karl Seguin: "Re: Attaching Event With Parameters to image control created dynam"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 7 Dec 2004 07:21:07 -0800
I just glimpsed over your tutorial... I think it's exactly what I was looking
for!! and it's a great tutorial, very concise and to the point. Thanks.
I can put together dataReapeter with nested databinding, no problems. Now I
need to figure out how to retrieve all the data entered into the repeater's
controls. I think I have some ideas on how do to that, pobably looping
through ItemTemplates and .FindControls for what I need, right? I have a
feeling I'll be posting again.
"Karl Seguin" wrote:
> If you are using a Repeater, you can hook into the ItemDataBound event and
> easily do that in codebehind (the tutorial I pointed you to has details on
> that), something like:
>
> sub ItemDataBound(...)
> dim ddl as DropDownList = ctype(e.Item.FindControl("dropdown"),
> DropDownList)
> ddl.DataSource = yourOtherDataSource;
> ddl.DataBind()
> ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items.FindByValue("TheValue"))
> end sub
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
>
> "WebMatrix" <WebMatrix@discussions.microsoft.com> wrote in message
> news:676649DA-1EAA-404A-83FB-71F6B969F75B@microsoft.com...
> > Ok, How can I add a dropdwon control populated by another data source to
> > ItemTemplate and select one of the dropdown's item based on the value from
> > database.
> > All this information is contained within XML. That's why I am look for
> > custom programming solution, but if Reapeter can handle above requirement,
> > I'll go with that.
> >
> > "Karl Seguin" wrote:
> >
> > > Well, each delete button can be hooked into the same event, and you can
> > > simply set the RowId to the commandArgument so you'll know which row to
> > > delete.
> > >
> > > Karl
> > >
> > > --
> > > MY ASP.Net tutorials
> > > http://www.openmymind.net/
> > >
> > >
> > > "WebMatrix" <WebMatrix@discussions.microsoft.com> wrote in message
> > > news:9AC999D4-D4EC-49A8-B9C7-97A364CBA623@microsoft.com...
> > > > Thank you for your response.
> > > >
> > > > I guess data Repeater could work, but .....
> > > > This control is a little more complicated than simply displaying rows
> of
> > > > data and deleting one row at a time:
> > > > 1. It's source is a custom XML string (I guess I has to be converted
> to
> > > > dataset to be databound.)
> > > > 2. Dropdown is driven by data that varies by RowID
> > > > 3. After user adds new row or removes existing rows each row must be
> > > > validated.
> > > >
> > > > I am not sure if Repeater can satisfy these requirements. I'd rather
> > > develop
> > > > my own logic that parses XML and creates each control
> programmatically. I
> > > > will look into repeater if nothing else works. Thanks.
> > > > Any other sugestions?
> > > >
> > > > "Karl Seguin" wrote:
> > > >
> > > > > Why not use a repeater and simply use the ItemCommand event of the
> > > repeater?
> > > > >
> > > > > The delete button's event will bubble up to the ItemCommand event,
> which
> > > you
> > > > > can catch, and figure out which row was clicked via a number of ways
> > > > > (commandARgument, using a hidden field)...
> > > > >
> > > > > You can check out more about this at:
> > > > > http://openmymind.net/databinding/index.html#8 (might wanna read the
> > > whole
> > > > > thing though).
> > > > >
> > > > > Karl
> > > > > --
> > > > > MY ASP.Net tutorials
> > > > > http://www.openmymind.net/
> > > > >
> > > > >
> > > > > "WebMatrix" <WebMatrix@discussions.microsoft.com> wrote in message
> > > > > news:43BD84A2-ABDD-491F-8232-34592574113F@microsoft.com...
> > > > > > Hello,
> > > > > >
> > > > > > Here's the situation (I'll try to be brief as possible)
> > > > > > I am working on the control which is created dynamically based on
> XML
> > > > > > string. This control consists of a table with number of rows with
> 3
> > > > > columns;
> > > > > > TextBox, dropdown and a button ("Delete" button) in each column.
> Also
> > > > > there's
> > > > > > one button at the bottom of the table that allows users to add
> more
> > > rows.
> > > > > So
> > > > > > more controls will be added programmatically as user adds more
> rows.
> > > > > > What's the easiest way to associate an event with each Delete
> button
> > > which
> > > > > > will take rowID as a parameter. So when a particular button is
> clicked
> > > > > > appropriate row will be removed.
> > > > > >
> > > > > > Thank you guys for any feedback...
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>
>
- Next message: John M Deal: "Re: Problem with asp.net app only allowing 1 user at a time"
- Previous message: Ken Dopierala Jr.: "Re: deploying asp.net application"
- In reply to: Karl Seguin: "Re: Attaching Event With Parameters to image control created dynam"
- Messages sorted by: [ date ] [ thread ]