Avatar of thamilto0410
thamilto0410
 asked on

How to set repeater dataitem value to string variable in codebehind

I have a repeater I am databinding to the results of a query that pulls 1 record from the database in my codebehind. I want to take the value of one of the dataitems in the repeater and assign it to a variable.  I then want to use the variable in the table that loads the reader in the aspx file to determine whether to change the font color of the row.  

I have searched and not been able to find it.  So if someone could provide me a link to an example or the example itself that would be great.  

I am new to the .net environment so if what I ask is worth more points than I am assigning please say so.

Thanks.

ASP.NET.NET Programming

Avatar of undefined
Last Comment
Member_2_4913559

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Member_2_4913559

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
thamilto0410

ASKER
ddayx10,  

Thank you for your response.  Exactly what I need I think.  Just need a little more help.  How would I apply if the repeater is bound to a query using the sqldatasource?  Recordset has only 1 row with about 15 columns and I am looking to check the column expedite for a value of yes which will then change the entire rows color.  Also considering you needed to do a custom write I am uping the points.  Thanks.
thamilto0410

ASKER
Appears to me considerable effort went into this solution and we are not done yet.  Increasing points.
thamilto0410

ASKER
ddayx10:
Never mind.  Got it.  Was able to use what you gave above in conjunction with converting the dataitem to a DBDataRecord and then using the item property with the column name of expedite to determine if it had a yes or no.  Working great.  You are awesome.  Thanks so much.
Your help has saved me hundreds of hours of internet surfing.
fblack61
thamilto0410

ASKER
I had to convert the above to a datasource recordset but did not take much.  The example above is excellent if you need to change row color based on a column value.
Member_2_4913559

Glad it helped. Sorry I didn't get back until now, but seems like you handled it fine.