Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2007

Tip: Looking for answers? Try searching our database.

Seeking advice for DataGridView with several Unbound Columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joseph Geretz - 30 Jul 2007 22:32 GMT
Hi,

I'm looking for advice or samples regarding the implementation of what is
essentially a bound grid, most columns are bound, however there are a couple
of unbound columns which are basically calculated totals (read-only) of data
in the bound columns (which are read/write).

I've implemented the CellValueNeeded event for the unbound columns. This
works when each row is first loaded. However, I then need to be responsive
to changes that that the user may make to the values of the bound columns.
when this happens, I need to recalculate the values of the bound columns. I
know whenever the user makes a change to a cell; CellValueChanged. At that
point, how to I 'invalidate' the current row so that it will refetch all of
the calculated columns (thus causing the recalculated values to appear). So
here's what I really need to understand how to do:

1. Force an Unbound cell to refresh its value.
2. Force all Unbound cells in a given Row to refresh their values.
3. Force all Rows in a Grid to refresh all of their respective unbound
columns.

(and if someone can show me a link, I'd really appreciate it. I'm usually
pretty good with Google but for some reason in this case, I'm turning up
documentation on Bound and Unbound modes, but really very little on the
mixed mode of binding which I'm trying to implement.)

Thanks for your advice!!!

Joseph Geretz
Nicholas Paldino [.NET/C# MVP] - 30 Jul 2007 22:45 GMT
Joseph,

   It looks like you can use the UpdateCellValue method to force a firing
of the CellValueNeeded event for the unbound cells that you wish to update.
I don't see an overload which will take whole rows or columns, but you
should be able to figure that out easily.

   Here is a link to the UpdateCellValue documentation:

http://msdn2.microsoft.com/en-us/library/system.windows.forms.datagridview.updat
ecellvalue.aspx


Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Hi,
>
[quoted text clipped - 25 lines]
>
> Joseph Geretz

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.