PC Review


Reply
Thread Tools Rate Thread

Accessing DataGridView row loads

 
 
RDA
Guest
Posts: n/a
 
      10th Apr 2009
This seems so trivial, but I am new to C#...

In a C# windows form I have a DataGridView that pulls from a database
(via an adapter), how can I access the event that loads each row? I
wish to format one of the cells based upon the data in another cell on
the same row (a very normal programmatic task) but cannot accomplish
this! What am I missing here?

Thanks much
 
Reply With Quote
 
 
 
 
Pavel Minaev
Guest
Posts: n/a
 
      11th Apr 2009
On Apr 10, 1:39*pm, RDA <roy.ander...@gmail.com> wrote:
> This seems so trivial, but I am new to C#...
>
> In a C# windows form I have a DataGridView that pulls from a database
> (via an adapter), how can I access the event that loads each row? I
> wish to format one of the cells based upon the data in another cell on
> the same row (a very normal programmatic task) but cannot accomplish
> this! What am I missing here?


If you need to change the way cells are displayed to the user, you
should handle the DataGridView.CellFormatting event.

Naturally, you can access the data source from your handler of that
event; or you can get the DataGridViewRow object of the cell using
e.RowIndex, and then use DataBoundItem to get the actual DataRow.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2007 loads open/loads very SLOWLY, even blank new docs Ted Microsoft Word Document Management 6 9th Jun 2008 06:08 AM
Accessing DataGridView column data as an IList =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= Microsoft C# .NET 3 20th Mar 2007 04:53 PM
Refreshing datagridview contents after a failed delete in bound datagridview Bob Microsoft VB .NET 0 5th Jan 2006 06:34 PM
Accessing a DataGridView cell Kenan Ecevit Microsoft C# .NET 0 28th Nov 2005 01:54 PM
Internet Explorer loads pages fine, but loads pop-ups slow Joe Windows XP Internet Explorer 1 11th Sep 2003 02:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:18 PM.