Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Can we inject rows in a repeater control?

Reply
Thread Tools

Can we inject rows in a repeater control?

 
 
gnewsgroup
Guest
Posts: n/a
 
      10-31-2007
OK, I am still trying to achieve something like what is shown in the
following PNG image.

http://farm3.static.flickr.com/2066/...202973a3_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/micro...2b948a1e58d80d

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.

 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      10-31-2007
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.


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

*************************************************
| Think outside the box!
|
*************************************************
"gnewsgroup" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> OK, I am still trying to achieve something like what is shown in the
> following PNG image.
>
> http://farm3.static.flickr.com/2066/...202973a3_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/micro...2b948a1e58d80d
>
> 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.
>



 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      10-31-2007
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)

gnewsgroup wrote:
> OK, I am still trying to achieve something like what is shown in the
> following PNG image.
>
> http://farm3.static.flickr.com/2066/...202973a3_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/micro...2b948a1e58d80d
>
> 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.
>

 
Reply With Quote
 
gnewsgroup
Guest
Posts: n/a
 
      10-31-2007
On Oct 31, 1:22 pm, "Cowboy \(Gregory A. Beamer\)"
<(E-Mail Removed)> 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?

 
Reply With Quote
 
gnewsgroup
Guest
Posts: n/a
 
      10-31-2007
On Oct 31, 1:31 pm, bruce barker <(E-Mail Removed)> wrote:
> 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)
>


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.

 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      10-31-2007
i assumed you'd set the command arg to the index, and assign the same
handler to all the buttons.

-- bruce (sqlwork.com)

gnewsgroup wrote:
> On Oct 31, 1:31 pm, bruce barker <(E-Mail Removed)> wrote:
>> 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)
>>

>
> 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.
>

 
Reply With Quote
 
gnewsgroup
Guest
Posts: n/a
 
      10-31-2007
On Oct 31, 2:14 pm, bruce barker <(E-Mail Removed)> wrote:
> 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?

 
Reply With Quote
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      10-31-2007
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.


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

*************************************************
| Think outside the box!
|
*************************************************
"gnewsgroup" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> On Oct 31, 1:22 pm, "Cowboy \(Gregory A. Beamer\)"
> <(E-Mail Removed)> 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?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
inject does not inject last value Peņa, Botp Ruby 4 08-07-2006 09:26 AM
How can I inject code to all pages viewed andysideas@gmail.com Javascript 2 10-05-2005 02:44 PM
convert rows to columns and columns to rows helpful sql ASP .Net 0 05-19-2005 06:03 PM
script for moving rows up and down and traverse thru rows of HTML table Subba Rao via DotNetMonster.com ASP .Net 0 03-19-2005 06:46 AM
How can a control inject a style (or javascript reference) in the page HEADer? ~~~ .NET Ed ~~~ ASP .Net Building Controls 1 11-03-2004 12:34 PM



Advertisments