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 / April 2005

Tip: Looking for answers? Try searching our database.

CurrencyManager Position issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pete Davis - 07 Apr 2005 21:24 GMT
I'm asking to see if anyone has found a way to deal with the issue of
"non-selection" with the CurrencyManager. In particular, we have a grid
control that we've created. When you have a parent and child grid, the
CurrencyManager for each is set to the first row, so if the first row of the
parent data has child rows, the child rows are displayed by default in the
child grid.

The problem is, we want the grid to come up with no rows selected. If there
is data in the CurrencyManager, then you can't set the position to -1. Doing
so simply sets it to 0, and thus any related CurrencyManagers will have
child data.

How have others dealt with this problem? Has anyone dealt with it?

If we don't actually show the row as selected, then it's confusing to the
user where the data in the child table comes from, so if the child table is
showing data, then you want to be showing a selection in the parent table so
that the source of the child data is obvious.

I tried using reflection to set the internal "listposition" of the
CurrencyManager to -1, but it didn't like that. It crapped out later on in
the child CurrencyManager with an invalid index exception.

Thanks for any ideas anyone can offer.

Pete
David Lei - 07 Apr 2005 22:11 GMT
You can by default highlight the first row as selected,
using DataGrid.Select(rowIndex) method.

David

> I'm asking to see if anyone has found a way to deal with the issue of
> "non-selection" with the CurrencyManager. In particular, we have a grid
[quoted text clipped - 22 lines]
>
> Pete
Pete Davis - 07 Apr 2005 22:44 GMT
Sorry, maybe I wasn't entirely clear. Our grid is a custom grid, not the MS
DataGrid.

Our grid has a requirement that the current row also be selected. However,
we also have a requirement that non-selection be possible (in our case,
current row = -1)

But, if we tie the current row to the CurrencyManager, a current row of -1
is impossible. Furthermore, there's no way for us to prevent data from being
displayed in the child table if the first parent row has child records.

So my question is, has anyone found a way around this? Some way to represent
non-selection in the CurrencyManager?

Pete

> You can by default highlight the first row as selected,
> using DataGrid.Select(rowIndex) method.
[quoted text clipped - 32 lines]
> >
> > Pete

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.