Hi,
Thanks for your quick reply! You gave me the right hint to continue
this 'problem'.

A gridview doesn't have an ItemDataBound event, I used the RowDataBound
event and it works! But not completely as hoped: the data/buttons in
the columns behind the 'Invisible' column move 1 column to the left,
filling the space of the 'invisible' column. That's not what I need,
this column should be left empty, 'not replaced'...
That's the only issue left now. Any solution to that?

"Jo" <>'s wild thoughts were
released on 7 Apr 2006 00:49:27 -0700 bearing the following
fruit:
>Hi,
>Thanks for your quick reply! You gave me the right hint to continue
>this 'problem'.
>
>A gridview doesn't have an ItemDataBound event, I used the RowDataBound
>event and it works! But not completely as hoped: the data/buttons in
>the columns behind the 'Invisible' column move 1 column to the left,
>filling the space of the 'invisible' column. That's not what I need,
>this column should be left empty, 'not replaced'...
>That's the only issue left now. Any solution to that?

"Jo" <>'s wild thoughts were
released on 7 Apr 2006 02:30:49 -0700 bearing the following
fruit:
>Hi,
>
>>
>>You don't want to remove the cell, only it's contents.
>>
>
>I thought I wasn't removing anything, just hiding
>("e.Row.Cells[7].Visible = false"),
>still the content of remaining cells in that row is taking the place of
>the content of the 'invisible' cell.
>
>So, maybe you can be more clear about this?
>

'I want a button in that row to be visible, otherwise no
button should be shown in that row'

So change the visible propery of the button to false.

Jan Hyde (VB MVP)

--
Could you say that a cannibalistic lion might swallow his pride?
(Ken Shurget)

First, I didn't know how to do that, but I've tried this code (see
below), and I got an ArgumentOutOfRangeException!
I guess that the row which gives the GridViewRowEventArgs haven't been
created in the GridView at that time, the row before this one does exit
in de Gridview, the current one not...
Maybe I have to try to do this in the rowcreated_event???

And tried "e.Row.Cells.RemoveAt(7);" in stead of
"e.Row.Cells[7].Visible = false", but that gives (visually) the same
results
That's something I can't explain: removing and making invisible isn't
the same!

I'm going of to enjoy my weekend. Hopefully someone can give me a
straight answer and a solution to my 'problem'.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!