473,382 Members | 1,692 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,382 software developers and data experts.

Problems with ItemDataBound event in Datagrid

I am using the ItemDataBound event of a Datagrid to color code table
cells according to data returned from a SQL stored procedure. At first
everything worked, but then I decided to customize the datagrid by
setting autogenerate columns to 'false' and defining my own column names
(in the aspx page), etc. The ItemDataBound event still fires but I
cannot get it to return the same values. In fact, after writing test
code to examine all of the columns returned, nothing seems to have any
of the same values that the datagrid returns. Any suggestions?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 2235
Hi Phil,

Are you inspecting the values with code like
e.Item.Cells[x].Controls[y]...?

If so, the indexes can be thrown off depending on the type of column
you are using. Perhaps you could post some code?

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

On Fri, 12 Nov 2004 15:02:12 -0800, Phil Townsend
<ph*******@yahoo.com> wrote:
I am using the ItemDataBound event of a Datagrid to color code table
cells according to data returned from a SQL stored procedure. At first
everything worked, but then I decided to customize the datagrid by
setting autogenerate columns to 'false' and defining my own column names
(in the aspx page), etc. The ItemDataBound event still fires but I
cannot get it to return the same values. In fact, after writing test
code to examine all of the columns returned, nothing seems to have any
of the same values that the datagrid returns. Any suggestions?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 16 '05 #2

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

Similar topics

11
by: Hrvoje Vrbanc | last post by:
Hello, I have the following problem: I have a DataGrid control on my page with a column with TextBox controls and another one with ImageButton controls. In order to force a call to JavaScript...
3
by: Clouds | last post by:
Hi ! How do I add the dynamic event handler for a dropdownlist present in the itemtemplate of a datalist !! I am doing it in the itemdatabound event of the datalist but it doesnt work... I am...
1
by: Roy | last post by:
Hey all, This is a fairly broad question, but why is it that my datagrid hits the ItemDataBound event 3 times? Basically, I placed a response.write in all sub and functions in my codebehind and...
4
by: Girish | last post by:
Im trying to create a grid within a grid programmatically. Ive been successful in doing this but I need the embedded grid to fire its ItemDataBound event so I can handle it. The event does not seem...
1
by: needin4mation | last post by:
Hi, I have a datalist. In this datalist I have a datagrid. The datalist is the master. The datagrid is the detail. It works fine. I populate the datagrid inside of the datalist using the...
3
by: Jon | last post by:
Hello everyone, We're using ASP.net 1.1 and when we load a control dynamically, using LoadControl, the ItemDataBound of the DataGrid that sits in this dynamically loaded control does not get...
1
by: greenb | last post by:
I'm using the ItemDataBound event of the DataGrid to highlight cells that are outside an acceptable range. Each row has a button column (CommandName='Select'), that is used to display addtional...
1
by: GaryDean | last post by:
It seems every time I try to use the GridView to do what I used to do with the DataGrid I run into differences that make me want to got back to the datagrid. for instance... the DataGrid...
4
by: GaryDean | last post by:
I'm up against something else I used to easily do in a DataGrid that is different in a GridView.... I used to access cells in non-visible columns in the ItemDataBound event. The data was there -...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.