473,395 Members | 2,010 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,395 software developers and data experts.

datagrid_itemdatabound

8
I have this code where if the value is 1 then format the out put to yes else no.
When I run my page the datagrid just displays the numerical values 1 and 2. When I run in debug mode my breakpoint at ** doesn't run. So I can't figure out what is happening...

** protected void MyDataGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item)
{

Label lbl = (Label)e.Item.Cells[3].FindControl("cLabel");

if (lbl.Text == "1")
{
e.Item.Cells[3].Text = "yes";
}
else
{
e.Item.Cells[3].Text = "no";
}
}
}
Jul 30 '07 #1
0 909

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Newbie | last post by:
Hello! I am working with 2 webforms. The first webform has a 2 weborm textboxes that I use as a placeholders. The second webform is a popup window that has a DataGrid in it. The DataGrid has 2 ...
4
by: CGuy | last post by:
Hi, I have a datagrid that has one ButtonColumn which is bound to a database field. My requirement is that when the page containing the datagrid is loaded, I would like the ButtonColumn to be...
2
by: Stephen | last post by:
Hi, I have a datagrid which displays a list of names and a button next to each name. In the Datagrid_ItemDataBound event I attach an attribute to each button which sets the onclick event of...
2
by: rodchar | last post by:
Hey all, how do i get to the fields of the datarow of the datasource thats about to be bound to the datagrid row? e.item.cells(2).text = ??? datarow.field.value hope this makes sense,...
1
by: rodchar | last post by:
hey all, i was just wondering about ItemDataBound (and the other similar events ItemCommand for that matter), I notice that in my brief experience that these procedures can get pretty lengthy. ...
10
by: david | last post by:
Hi, all: I need a help from you about DataGrid control. I created a DataGrid, dg, in design view of .NET visual Stadio and use the builder to add a Hyperlink column to dg. I want to try to assign...
1
by: geronimi | last post by:
I want to create a linkbutton in a cell because not every row needs one (so I can't setup a linkbuttoncolumn instead of a boundcolumn.) First, i create a linkbutton in the datagrid_ItemDataBound...
15
by: Laser Lu | last post by:
Hi, all, I was tangled by the DataGridItem.DataItem property. I tried to invoke that property to get and display the contents that was bound to the currently selected row. However, an exception...
2
by: IndiraPriyaDarshini | last post by:
Hello, am devoloping a project.. i wanna to uswe the ItemDataBound property to my project.. but i can not find that property..i tried a lot.. am new to this field.. pls help 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: 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
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...
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
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
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,...

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.