473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,324 developers and data experts.

Change Datagrid Cell Value in ItemDataBound Event

Here i give sample code to change datagrid in ItemDataBound Event.


DataRowView drv = (System.Data.DataRowView)e.Item.DataItem;
string Node_MAC = drv["Node_MAC"].ToString().Trim();
if (Node_MAC.Length == 16)
{
e.Item.Cells[0].Text = Node_MAC.Substring(0, 4);
}

By
S.Suresh
Feb 25 '11 #1
0 5321

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

Similar topics

3
by: Dav | last post by:
I have a Winform with a derived datagrid and a button that adds a row to the datagrid in its Click event. The button has a shortcut text "&New Row". When I enter a value in a datagrid cell and...
1
by: esroinc | last post by:
By creating an event that fires when I click on a cell, I am able to obtain the coordinates of that cell, but I have not been able to get the data or value in that cell. cellCoordinates =...
2
by: Robert | last post by:
I'm sure this is a fairly basic question, but I've been looking all over the web for days for suggestions on how to do this. I've got a datagrid that's bound to a dataset on my form. It includes...
1
by: Allen Hubatka | last post by:
Is it possible to change the data grid cell value from the client side script? The cell value I am talking is not a template column. I am using .Net Framework 1.1, Vb.Net, IE5.5+ and Java script....
0
by: keys4worship | last post by:
I have a datagrid that contains among other things an SSN and a button. I have added an onclick attribute to the button that works with vbscript to query information on 3270 Pcomm emulator. The...
3
by: Richard | last post by:
I'm trying to change a value of a cell based on another before the grid is displayed. I'm using the ItemDataBound event like this for a simple test: Select Case e.Item.ItemType Case...
0
by: Antonio | last post by:
Hello, everyone. Is there a way to not display a certain value in a datagrid cell? I have a datagrid for subscriptions and ebooks and if there isn't an e-book listed, the value from the...
2
by: harry | last post by:
Hi all, I have a datagrid (language C#) populated using a stored procedure. I want one of the column to display complete name instead of abbreviation. Can I change the display dynamically in the...
0
by: mvenkatesan | last post by:
Hi how to get selected cell value in datagrid? I am using c# 2005 (windows appl) Pl. help Advance thanks Venky
16
by: tarunkhatri | last post by:
Hi. I have a javascript function to change the value of the cell on chnage event of a dropdown list.My code is workin but the problem is that the value of the cell is chaning but not respective to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.