GridView RowDataBound question

T

Tina

I'm accustomed to doing just about anything in the GridView RowDataBound
event but how do I completely eliminate the row from showing? I have a very
difficult filtering application to do.
Thanks,
T
 
T

Tina

Mark,
Sure that could work. so could using alternate SQL for each filter view. I
was asking if it can be done in the RowDataBound event. Do you know the
answer to my question?
thanks,
T


Mark Rae said:
I'm accustomed to doing just about anything in the GridView RowDataBound
event but how do I completely eliminate the row from showing? I have a
very difficult filtering application to do.

How about a different approach? If you're trying to prevent a row from
showing, how about removing it from the data which to which the GridView
is bound before the process gets as far as firing the RowDataBound event?

DataSet MyDS = <..........>;
MyDS.Tables[0].DefaultView.RowFilter = "MyColumn < 10";
MyGridView.DataSource = MyDS.Tables[0].DefaultView;
MyGridView.DataBind();
 
B

Ben Amada

Tina wrote:
I'm accustomed to doing just about anything in the GridView RowDataBound
event but how do I completely eliminate the row from showing? I have a
very difficult filtering application to do. Thanks, T

In RowDataBound, set e.Row.Visible = false;
 
T

Tina

Mark:
Sorry, you were helpful as that is one way to skin the cat. But see Ben's
post...
e.row.visible = false !!
T
Mark Rae said:
I'm accustomed to doing just about anything in the GridView
RowDataBound event but how do I completely eliminate the row from
showing? I have a very difficult filtering application to do.

How about a different approach? If you're trying to prevent a row from
showing, how about removing it from the data which to which the GridView
is bound before the process gets as far as firing the RowDataBound
event?

DataSet MyDS = <..........>;
MyDS.Tables[0].DefaultView.RowFilter = "MyColumn < 10";
MyGridView.DataSource = MyDS.Tables[0].DefaultView;
MyGridView.DataBind();

Sure that could work. so could using alternate SQL for each filter view.
I was asking if it can be done in the RowDataBound event.

I don't believe so: http://www.vbforums.com/showthread.php?t=525867
Do you know the answer to my question?

Just trying to be helpful...
 
T

Tina

Mark,
I've been testing the dickens out of this (i'm not doing paging as I spin it
in a div) and it works. Assuming that paging is not used under what
conditions can it fail?
Thanks,
T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top