473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

ItemDataBound of repeater... Before or after render?

I am trying to work out how to change some values of data during
itemdatabound.

MSDN states that the ItemDataBound is called BEFORE the render... so any
changes do the data SHOULD work..

however ihave the following example... and it doesnt work at all... the
text CHANGE_Value does not come up at any time...
public void rptList_ItemDataBound(Object Sender, RepeaterItemEventArgs e)

{

DataRowView drv = (DataRowView) e.Item.DataItem;

if (drv == null)

return;

drv["body"] = "CHANGE_Value";// + row["body"].ToString();

}
Nov 18 '05 #1
2 6770
Hi Darren:

This event happens before render but AFTER data binding for the item.
If you change the row in the underlying data source it won't be found
since the value was already bound to the control. You'll want to
change a value in e.Item.Controls collection at this point to a
different result to appear on the screen.

HTH,

--
Scott
http://www.OdeToCode.com

On Tue, 31 Aug 2004 10:57:15 +1000, "Darren Clark"
<dc******@hotmail.com> wrote:
I am trying to work out how to change some values of data during
itemdatabound.

MSDN states that the ItemDataBound is called BEFORE the render... so any
changes do the data SHOULD work..

however ihave the following example... and it doesnt work at all... the
text CHANGE_Value does not come up at any time...
public void rptList_ItemDataBound(Object Sender, RepeaterItemEventArgs e)

{

DataRowView drv = (DataRowView) e.Item.DataItem;

if (drv == null)

return;

drv["body"] = "CHANGE_Value";// + row["body"].ToString();

}


Nov 18 '05 #2
thanks.

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:dl********************************@4ax.com...
Hi Darren:

This event happens before render but AFTER data binding for the item.
If you change the row in the underlying data source it won't be found
since the value was already bound to the control. You'll want to
change a value in e.Item.Controls collection at this point to a
different result to appear on the screen.

HTH,

--
Scott
http://www.OdeToCode.com

On Tue, 31 Aug 2004 10:57:15 +1000, "Darren Clark"
<dc******@hotmail.com> wrote:
I am trying to work out how to change some values of data during
itemdatabound.

MSDN states that the ItemDataBound is called BEFORE the render... so any
changes do the data SHOULD work..

however ihave the following example... and it doesnt work at all... the
text CHANGE_Value does not come up at any time...
public void rptList_ItemDataBound(Object Sender, RepeaterItemEventArgs e)

{

DataRowView drv = (DataRowView) e.Item.DataItem;

if (drv == null)

return;

drv["body"] = "CHANGE_Value";// + row["body"].ToString();

}

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ben R. | last post by:
I've got a repeater that's bound to a datareader and I'd like to conditionally modify the text that is being outputted. Previously, I've done this by assigning a name to attribute to the...
8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
1
by: Kevin Hector | last post by:
Hi. Can anyone explain why, when setting the Text of a Label control in the ItemCreated event of a Repeater (example below), the Text value is NOT persisted to ViewState? I know this can be fixed by...
1
by: Matthew Law | last post by:
Hi, I have a repeater in my vb.net page which needs to render an image control (it's a mappoint linedrive map image). The repeater itself is bound to an array of object 'Directions' which ...
0
by: KJ | last post by:
I noticed the following behavior: With 2 repeaters nested, such as: <asp:repeater id=rptrParentRepeater runat="server"> <ItemTemplate> <asp:Repeater id="rptrChildRepeater" runat="server"...
0
by: roni | last post by:
hi. i create dataset that has 5 datatables in it. i set this dataset to repeater.datasource in the ItemDataBound event of the repeater i can access to the first table with : Dim dr As...
4
by: Dennis E. Jones, Jr. | last post by:
I'm creating a dynamic control for each row in a REPEATER based on database values. ItemDataBound creates the control for the initial load (not postback), but I cannot get the control recreated...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
1
by: Loading name... | last post by:
hey asp.net 2.0 I have a ItemDataBound event in my repeater control. My problem is that I don't know how to access the data in the ItemDataBound control. Lets say the datasource has a field...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.