Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 10th, 2006, 05:57 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default Change a Datagrid cell background

Hello all
I'm trying to change a cell of a datagrid background when a condition becomes true.let me explain more:
I have a datagrid with different columns.one of these columns is a string that contains "0"s and "1"s.i want to check this cell.for example if the first character was "1" then the first cell should have a different background column and so on.
I wrote my codes like this:
1-a datagrid that has OnDataBinding(it calls a sub)
2-my sub is like this:
sub Changebg(s As Object,e As System.EventArgs)
for each myItem As DataGridItem in DataGrid1.Items
if first char="1" then
change the first cell background
if second char="1" then
change the second cell background
and so on ......
but it doesn't change any cell background
and this is the code for accessing the string field:
c=myItems.cells(12).text
and for changin the background i used:
myItem.cells(1).BackColor=skyblue
would you please help me.I'm not familiar with .net and i think i didn't use these codes correctly
i would be very happ if some one help me
thank you

Reply With Quote
  #2 (permalink)  
Old September 12th, 2006, 07:56 AM
Registered User
 
Join Date: Sep 2006
Location: Isfahan, Isfahan, Iran.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have the sme problem,so if you were answered please send me.

Reply With Quote
  #3 (permalink)  
Old September 12th, 2006, 11:23 PM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

Isn't there any one can help me please

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
change color of background meena88 C# 2005 3 December 1st, 2009 04:48 AM
Setting background image for gridvew cell anup_daware .NET Framework 2.0 0 September 17th, 2007 05:18 AM
Change a Datagrid cell background hastikeyvan ASP.NET 2.0 Professional 2 October 7th, 2006 06:48 AM
change background color of cell based on value vurtman ASP.NET 1.0 and 1.1 Basics 4 February 26th, 2004 03:52 PM
change background Frank1111 ASP.NET 1.0 and 1.1 Basics 5 October 16th, 2003 06:14 PM



All times are GMT -4. The time now is 06:10 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.