473,546 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid Events

Which event would I use to reformat a date which is databound to a field in
my data table? I have a column which has a date of 12/31/9999 which is a
default date meaning no date has been entered and I want the grid to show
this date as spaces if it contains that value, otherwise I want to format the
date.

So should I use a Datagrid event to perform this action or is there some
other way which is more appropriate?

Thanks
Nov 19 '05 #1
1 1014
You can use either ItemDataBound or PreRender event. ItemDataBound gets a
reference to a grid row that is being databound. In PreRender event all rows
are already built, you can loop through them.

Eliyahu

"Jim Heavey" <Ji*******@disc ussions.microso ft.com> wrote in message
news:C2******** *************** ***********@mic rosoft.com...
Which event would I use to reformat a date which is databound to a field in my data table? I have a column which has a date of 12/31/9999 which is a
default date meaning no date has been entered and I want the grid to show
this date as spaces if it contains that value, otherwise I want to format the date.

So should I use a Datagrid event to perform this action or is there some
other way which is more appropriate?

Thanks

Nov 19 '05 #2

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

Similar topics

2
4330
by: Dan | last post by:
When I put a datagrid on a form in VB.NET, and then go to the code page, I can select the datagrid in the left-hand dropdown, and see all the available events for the datagrid in the right hand dropdown. I can then select the event I want to implement and start coding. However, if I do the same thing in C#, there doesn't seem to be a...
7
2249
by: TT (Tom Tempelaere) | last post by:
Hi there, I'm struggling to get the right event. I want to be notified of a change in a cell in a DataGrid made by a user. I need following information about the change: * the row index * the column index * the newly entered value I need this information to update another DataGrid. I have checked the
2
4323
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know how to use this code? please help! http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20862953.html
5
12212
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. The ID is a member of the keys array. I then create a DataView dv over the table, and sort it by Display and ID column (in case of duplicate...
8
1705
by: Brent Burkart | last post by:
My datagrid OnCancelCommand event is not firing. HTML OnCancelCommand="AdminGrid_Cancel" 'Code Behind Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) AdminGrid.EditItemIndex = -1 BindData()
2
2378
by: andla | last post by:
Hi, How does events fire in a datagrid. I know about the problem if turning the viewstate off the events wil not fire properly even if I rebind the control in every postback. S then I started to think how does .Net do it if I turn the viewstat on. If you use the Request.Form then you can get all the controls tha
2
2372
by: Carl Tribble | last post by:
Is there any way to reliably catch KeyUp events for Function keys in particular while inside a datagrid? I have a form with KeyPreview=True and I am using the Form.KeyUp event to handle several function keys (F5, F6, etc.) The problem is I have a datagrid on this form and it seems whenever the datagrid has the focus, it consumes most of...
5
6682
by: Jeff User | last post by:
Hello ..NET 1.1, VS 2003, C# & asp.net I have tried to follow msdn instructions and samples but I can not get an event to fire for this button on the datagrid. There has to be something obvious missing here, but after 2 days I am ready to explode ! Please help. To create the Delete button I selected the grid in design view, clicked the...
4
2117
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a Delete button on the end of each row. I am unable to gain access to the event when the button is clicked. I don't fully understand how the click...
0
1654
by: WhiteWizard | last post by:
I am trying to implement standard multi-select of rows in a datagrid. That is, allow the user to use the CTRL & SHIFT keys to select multiple rows in a datagrid. Then I'll loop through them and process the selected rows. The problem is that the KEY events don't seem to be firing on the datagrid. When I just click on a column of the datagrid,...
0
7504
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7694
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7461
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6026
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5360
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3491
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.