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

Tip: Looking for answers? Try searching our database.

ReportGrid.Rows(i).Visible = False VC Currency Manager

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ToyMaker - 24 Aug 2005 12:37 GMT
I bind my datagridview to a dataset returned from a web service:

ds = WS.testReport(param1, param2)
ReportGrid.DataSource = ds.Tables(0)

The data displays fine.
Now, what I want to do is to hide all rows that match some specific
criteria (every row whose column has a value of 1).
So I try: ReportGrid.Rows(i).Visible = False

At row 0 (and only for that row) I get this error:
"Row associated with the currency manager's position cannot be made
invisible."

I have searched everywhere for a hint to cope with this error and
haven't found anything. How can I access this manager's properties?
Any help will be greatly appreciated.
Bjarke Lindberg - 24 Aug 2005 13:32 GMT
> I bind my datagridview to a dataset returned from a web service:
>
[quoted text clipped - 5 lines]
> criteria (every row whose column has a value of 1).
> So I try: ReportGrid.Rows(i).Visible = False

You should bind the grid to a DataView instead. Like:
[...]
DataView dv = new DataView(ds.Tables[0], "visible = 1", null,
                DataViewRowState.CurrentRows);

ReportGrid.DataSource = dv;
[...]

The second parameter to the constructor is the RowFilter.

/B :)
ToyMaker - 24 Aug 2005 14:18 GMT
Thank you very much for your answer.
The point is that I cannot use a dataview. Once I reset the grid's
datasource, I lose a lot of grid formatting - coloring I do after the
binding, depending on the data each row has. Plus the fact that this
formatting takes quite some time (although I am positive my code is
correct, hope it is a beta performance issue).

The only thing that I need is a checkbox to show some rows of the
datagrid or not, just toggle their visibility on-off. I can do it in
all the rows EXCEPT the first one (getting the aforementioned error).

Thank you in advance for any further help.
ToyMaker - 24 Aug 2005 14:40 GMT
Got it.
The currency manager's position is the current datagridview row whose
cell that has focus.
So, I did a ReportGrid.currentCell = ... to a cell whose row is no way
it would hide, and everything worked ok...

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.