Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Can we inject rows in a repeater control?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gnewsgroup - 31 Oct 2007 17:58 GMT
OK, I am still trying to achieve something like what is shown in the
following PNG image.

http://farm3.static.flickr.com/2066/1808692173_ea202973a3_o.png

I thought about doing this with a plain Table server control, but the
problem is that this control does not provide enough events for us to
identify the row in which the button is clicked.

See a discussion I initiated in the following thread:

http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_t
hread/thread/5f829c6b82fd01e5/722b948a1e58d80d?hl=en#722b948a1e58d80d


Now that the plain Table control does not seem to work, I am thinking
of the repeater control.  I know that the repeater control has an
ItemCommand event, which will let us identify the row in which the
button is clicked.

But, is it possible to inject rows immediately below the row in which
the Button Click event takes place?  I haven't found anything about
this question.
Cowboy (Gregory A. Beamer) - 31 Oct 2007 18:22 GMT
Yes, but it is generally done on binding, which may not solve your issue
properly. If you can go this route, rebind the control on row click and then
use the row data binding event to create a second row when you bind. I have
not completed this particular task, so it may turn out to be a royal pain.
:-)

Signature

Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************

| Think outside the box!

*************************************************
> OK, I am still trying to achieve something like what is shown in the
> following PNG image.
[quoted text clipped - 17 lines]
> the Button Click event takes place?  I haven't found anything about
> this question.
gnewsgroup - 31 Oct 2007 18:36 GMT
On Oct 31, 1:22 pm, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@comcast.netNoSpamM> wrote:
> Yes, but it is generally done on binding, which may not solve your issue
> properly. If you can go this route, rebind the control on row click and then
> use the row data binding event to create a second row when you bind. I have
> not completed this particular task, so it may turn out to be a royal pain.
> :-)

Thank you.  Well, there are two data sources: one for the export total
and import total per year (what's shown before expanding), the other
for the breakdown of a particular year (the expanded part), as shown
in the image.

Will the row data binding event know where I want to insert the newly
created row?
Cowboy (Gregory A. Beamer) - 31 Oct 2007 19:24 GMT
To the question, it is not automagic. You will have to pull the rows out
with code to display the related data. The binding event will just allow you
to examine each row bound until you get to the selected row and you will
have to add the information.

If the data is related, you can look at some of the examples people have
done with hierarchical data controls. I believe Dino Esposito wrote one for
MSDN magazine. Will have to check. This sounds like it might be more up your
alley based on what you are doing.

NOTE: You may also find the DataSource controls a bit unwieldy as you step
outside of this box. They encapsulate a bit too much functionality when you
start getting creative.

Signature

Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************

| Think outside the box!

*************************************************
> On Oct 31, 1:22 pm, "Cowboy \(Gregory A. Beamer\)"
> <NoSpamMgbwo...@comcast.netNoSpamM> wrote:
[quoted text clipped - 14 lines]
> Will the row data binding event know where I want to insert the newly
> created row?
bruce barker - 31 Oct 2007 18:31 GMT
the table has enough events. the [+] can be a submit button with a
command arg. you are going to need to track the state of the buttons on
the serverside unles only one can be open at time.

note: the most common approach is to actually render the hidden rows but
set the display style to none. then javascript changes the style.

-- bruce (sqlwork.com)

> OK, I am still trying to achieve something like what is shown in the
> following PNG image.
[quoted text clipped - 17 lines]
> the Button Click event takes place?  I haven't found anything about
> this question.
gnewsgroup - 31 Oct 2007 18:40 GMT
> the table has enough events. the [+] can be a submit button with a
> command arg. you are going to need to track the state of the buttons on
[quoted text clipped - 4 lines]
>
> -- bruce (sqlwork.com)

Thank you.  Yes, I am aware that the [+] ImageButton can have a
command argument, which I actually tried, but what do we assign to the
CommandArgument property?  Is there anyway to assign the row index to
it?  I know that the row index can be captured this way for a GridView.
bruce barker - 31 Oct 2007 19:14 GMT
i assumed you'd set the command arg to the index, and assign the same
handler to all the buttons.

-- bruce (sqlwork.com)

>> the table has enough events. the [+] can be a submit button with a
>> command arg. you are going to need to track the state of the buttons on
[quoted text clipped - 9 lines]
> CommandArgument property?  Is there anyway to assign the row index to
> it?  I know that the row index can be captured this way for a GridView.
gnewsgroup - 31 Oct 2007 19:21 GMT
> i assumed you'd set the command arg to the index, and assign the same
> handler to all the buttons.
>
> -- bruce (sqlwork.com)

OK, so the problem loops back: How do we get the index of the row in
which the button is clicked?  In a GridView, we say
Container.DataItemIndex.  But what is it for a Table server control?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.