473,406 Members | 2,343 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.

Editable Repeater

Hi, I have a repeater in which all rows are editable together (there is one
Save button at the top of the page).

When the page loads with the repeater populated, I change the value in one
of the textboxes and click on save. Instead of taking the newly entered
value I record the original value of the textbox. The code is below, thanks
for your help in advance:

private void lkbSave_Click(object sender, System.EventArgs e)
{

for(int count=0;count<ScoresRepeater.Items.Count;count++)
{
objReferralTestScore.TestScore[-1,
count].AssessmentInstanceScore=((TextBox)ScoresRepeater. Items[count].FindControl("tbxScore")).Text;
}

objReferralTestScore.Write();
Nov 19 '05 #1
1 2226
Jack:
My guess is that you are rebinding the control on postback, which is
overwriting the newly entered data. You need to wrap your binding code in a
if (!Page.IsPostBack){ }

if (!Page.IsPostBack){
ScoresRepeater.DataSource = GetAllScores();
ScoresRepeater.DataBind();
}

Remember, the Page_Load event occurs beforethe Save_Click event (even on
postback)....so if you don't do this you are rebinding the old data to the
repeater (it hasn't been saved yet) and thus overwriting the edited change.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:11**********************************@microsof t.com...
Hi, I have a repeater in which all rows are editable together (there is one Save button at the top of the page).

When the page loads with the repeater populated, I change the value in one
of the textboxes and click on save. Instead of taking the newly entered
value I record the original value of the textbox. The code is below, thanks for your help in advance:

private void lkbSave_Click(object sender, System.EventArgs e)
{

for(int count=0;count<ScoresRepeater.Items.Count;count++)
{
objReferralTestScore.TestScore[-1,
count].AssessmentInstanceScore=((TextBox)ScoresRepeater. Items[count].FindCon
trol("tbxScore")).Text; }

objReferralTestScore.Write();

Nov 19 '05 #2

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

Similar topics

0
by: Ed Allan | last post by:
http://ejaconsulting.com/nestedrepeater/NestedRepeater.txt >-----Original Message----- >Doh! The HTML has all been rendered . . . > >Right click on this link and select 'Save target as ..' >to...
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...
0
by: Amir | last post by:
Hi every one This is the problem: I have a UserControl that contains a Repeater and a few LinkButton. The Repeater generate some linkButton. I use this control for implementing paging solution...
3
by: sorCrer | last post by:
Hi All, Posted after extensive searching! I have a nested repeater control as follows: (Simplified ;-)) <table> <asp:repeater id=parent onItemDataBound=createChild> <tr><td>Level...
8
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server">...
2
by: Alan Silver | last post by:
Hello, I want to include a facility on a page whereby a grid of values is shown so the user can edit it. I want it so that all values are available for editing at all times, I don't want them to...
2
by: GD | last post by:
I'd like to use a Repeater to display data coming back from a cross-tab report. Because it's a cross-tab, I generally don't know how many columns are coming back. They do follow a certain format: ...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
0
by: uncensored | last post by:
Hello everyone, I'm fairly new at .Net and I have a repeater inside a repeater problem. I will attach my code to this message but basically what I am able to tell when I run my page it tells me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.