473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to make multiple datagrid rows invisible??

It's easy to make the last row in a datagrid (filled with a table)
invisible:
datagridObject.Rows[i].Visible = false

BUT if 'i' is not the last row then things go wrong.

I even tried:

for (int i = datagridObject.Rows.Count - 1; i >= 0; i-- )
{
dgrDeelleveringen.Rows[i].Visible = false;
}

And it doesn't want to work.

Someone please HELP

Nov 10 '06 #1
7 7007
What actually goes wrong?

Cheers,

Chris.

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
It's easy to make the last row in a datagrid (filled with a table)
invisible:
datagridObject.Rows[i].Visible = false

BUT if 'i' is not the last row then things go wrong.

I even tried:

for (int i = datagridObject.Rows.Count - 1; i >= 0; i-- )
{
dgrDeelleveringen.Rows[i].Visible = false;
}

And it doesn't want to work.

Someone please HELP

Nov 10 '06 #2
As long as it's the last Row it makes it invisible but whene the next
Row comes it gives an exception.

ChrisM schreef:
What actually goes wrong?

Cheers,

Chris.

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
It's easy to make the last row in a datagrid (filled with a table)
invisible:
datagridObject.Rows[i].Visible = false

BUT if 'i' is not the last row then things go wrong.

I even tried:

for (int i = datagridObject.Rows.Count - 1; i >= 0; i-- )
{
dgrDeelleveringen.Rows[i].Visible = false;
}

And it doesn't want to work.

Someone please HELP
Nov 10 '06 #3
Ok,

So what is the exception that it gives?

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
As long as it's the last Row it makes it invisible but whene the next
Row comes it gives an exception.

ChrisM schreef:
>What actually goes wrong?

Cheers,

Chris.

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegr oups.com...
It's easy to make the last row in a datagrid (filled with a table)
invisible:
datagridObject.Rows[i].Visible = false

BUT if 'i' is not the last row then things go wrong.

I even tried:

for (int i = datagridObject.Rows.Count - 1; i >= 0; i-- )
{
dgrDeelleveringen.Rows[i].Visible = false;
}

And it doesn't want to work.

Someone please HELP

Nov 10 '06 #4

Chris, Hier you are:

System.InvalidOperationException was unhandeld
Row associated with the currency manager's position cannot be made
invisible.

And hier the explanation:
An InvalidOperationException exception is thrown in cases when the
failure to invoke a method is caused by a reason other than an invalid
argument. This may be thrown by .NET Framework methods when the
underlying Win32 method cannot be invoked.

I hope that this says more to you then to me :)

ChrisM schreef:
Ok,

So what is the exception that it gives?

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
As long as it's the last Row it makes it invisible but whene the next
Row comes it gives an exception.

ChrisM schreef:
What actually goes wrong?

Cheers,

Chris.

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
It's easy to make the last row in a datagrid (filled with a table)
invisible:
datagridObject.Rows[i].Visible = false

BUT if 'i' is not the last row then things go wrong.

I even tried:

for (int i = datagridObject.Rows.Count - 1; i >= 0; i-- )
{
dgrDeelleveringen.Rows[i].Visible = false;
}

And it doesn't want to work.

Someone please HELP
Nov 10 '06 #5
I'm partially guessing here, but it seems to be saying that you cannot make
the currently selected row invisible, or more specifially the row that the
pointer is currently on.

You could try using

dgrDeelleveringen.CurrentRowIndex = x;

Before your loop that sets the visible property.

Where x is a row that you ARE NOT going to make hidden.

From what it seems to be saying, I don't think it's possible to hide ALL the
rows in the table...(?)
You will have to leave at least one row visible (the row the CurrentRowIndex
needs to be pointing at).

HTH??

Chris.

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
>
Chris, Hier you are:

System.InvalidOperationException was unhandeld
Row associated with the currency manager's position cannot be made
invisible.

And hier the explanation:
An InvalidOperationException exception is thrown in cases when the
failure to invoke a method is caused by a reason other than an invalid
argument. This may be thrown by .NET Framework methods when the
underlying Win32 method cannot be invoked.

I hope that this says more to you then to me :)

ChrisM schreef:
>Ok,

So what is the exception that it gives?

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegr oups.com...
As long as it's the last Row it makes it invisible but whene the next
Row comes it gives an exception.

ChrisM schreef:

What actually goes wrong?

Cheers,

Chris.

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegr oups.com...
It's easy to make the last row in a datagrid (filled with a table)
invisible:
datagridObject.Rows[i].Visible = false

BUT if 'i' is not the last row then things go wrong.

I even tried:

for (int i = datagridObject.Rows.Count - 1; i >= 0; i-- )
{
dgrDeelleveringen.Rows[i].Visible = false;
}

And it doesn't want to work.

Someone please HELP


Nov 10 '06 #6
Thanks a lot Chris,
You seem to be a guru ;)
ChrisM schreef:
I'm partially guessing here, but it seems to be saying that you cannot make
the currently selected row invisible, or more specifially the row that the
pointer is currently on.

You could try using

dgrDeelleveringen.CurrentRowIndex = x;

Before your loop that sets the visible property.

Where x is a row that you ARE NOT going to make hidden.

From what it seems to be saying, I don't think it's possible to hide ALL the
rows in the table...(?)
You will have to leave at least one row visible (the row the CurrentRowIndex
needs to be pointing at).

HTH??

Chris.

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...

Chris, Hier you are:

System.InvalidOperationException was unhandeld
Row associated with the currency manager's position cannot be made
invisible.

And hier the explanation:
An InvalidOperationException exception is thrown in cases when the
failure to invoke a method is caused by a reason other than an invalid
argument. This may be thrown by .NET Framework methods when the
underlying Win32 method cannot be invoked.

I hope that this says more to you then to me :)

ChrisM schreef:
Ok,

So what is the exception that it gives?

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
As long as it's the last Row it makes it invisible but whene the next
Row comes it gives an exception.

ChrisM schreef:

What actually goes wrong?

Cheers,

Chris.

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
It's easy to make the last row in a datagrid (filled with a table)
invisible:
datagridObject.Rows[i].Visible = false

BUT if 'i' is not the last row then things go wrong.

I even tried:

for (int i = datagridObject.Rows.Count - 1; i >= 0; i-- )
{
dgrDeelleveringen.Rows[i].Visible = false;
}

And it doesn't want to work.

Someone please HELP
Nov 13 '06 #7
Heh!
Wish I was. Just had a quite few run-ins with the DataGrid. The application
I spend most of my time developing/supporting uses it a lot... and I still
hate it(the datagrid, not my application).
So hard to make it do the simplest of tasks most of the time...

Chris.

"Nader" <na**********@gmail.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
Thanks a lot Chris,
You seem to be a guru ;)
ChrisM schreef:
>I'm partially guessing here, but it seems to be saying that you cannot
make
the currently selected row invisible, or more specifially the row that
the
pointer is currently on.

You could try using

dgrDeelleveringen.CurrentRowIndex = x;

Before your loop that sets the visible property.

Where x is a row that you ARE NOT going to make hidden.

From what it seems to be saying, I don't think it's possible to hide ALL
the
rows in the table...(?)
You will have to leave at least one row visible (the row the
CurrentRowIndex
needs to be pointing at).

HTH??

Chris.

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegr oups.com...
>
Chris, Hier you are:

System.InvalidOperationException was unhandeld
Row associated with the currency manager's position cannot be made
invisible.

And hier the explanation:
An InvalidOperationException exception is thrown in cases when the
failure to invoke a method is caused by a reason other than an invalid
argument. This may be thrown by .NET Framework methods when the
underlying Win32 method cannot be invoked.

I hope that this says more to you then to me :)

ChrisM schreef:

Ok,

So what is the exception that it gives?

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegr oups.com...
As long as it's the last Row it makes it invisible but whene the
next
Row comes it gives an exception.

ChrisM schreef:

What actually goes wrong?

Cheers,

Chris.

"Nader" <na**********@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegr oups.com...
It's easy to make the last row in a datagrid (filled with a
table)
invisible:
datagridObject.Rows[i].Visible = false

BUT if 'i' is not the last row then things go wrong.

I even tried:

for (int i = datagridObject.Rows.Count - 1; i >= 0; i-- )
{
dgrDeelleveringen.Rows[i].Visible = false;
}

And it doesn't want to work.

Someone please HELP

Nov 13 '06 #8

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

Similar topics

7
by: Billy Jacobs | last post by:
I am using a datagrid to display some data. I need to create 2 header rows for this grid with columns of varying spans. In html it would be the following. <Table> <tr> <td colspan=8>Official...
4
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. ...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
3
by: Richard | last post by:
After printing a userlist to a Datagrid i want some names not to be shown. I want to know how i can make a entire datagrid row invisible. I suspect its something with the OnItemDatabound but i am...
15
by: John Blair | last post by:
Hi, Code attached but the line that gives me an error is MyDataGrid.Columns(2).Visible = False It actually gives me an error for any value instead of 2 even when 9 bound columns of data exist....
4
by: NH | last post by:
Hi, I just cannot get this to work. I want to make a cell editable in a datagrid only if the value of another cell is something specific. I am able to capture the value of the other cell via the...
4
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure...
3
by: Phillip N Rounds | last post by:
I have a DataGrid in a web form (ASP1.1, C#, VS 2003) that I'm trying to add some functionality to, and I can't figure out how to do int. The existing DataGrid has several databound columns and a...
0
by: Nader | last post by:
Making the last row is easy: datagridObject.Rows.Visible = false But if it's not the last row then it goes wrong! :( I tried the next: for (int i = datagridObject.Rows.Count - 1; i >= 0;...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.