DropDowns/GridView Column
-
Hello All, Have a problem where I would like to display a column only if a particular item is selected in a drop down. To be more specific, I display some values in a gridview and the last column contains a link that removes (actually just archives by setting a bit flag) the row from being displayed in the "Active" view. If the user wants to see "Archived" rows, they would select it from the DropDownList and the page automatically posts and displays the archived items. But the last column with the link still appears. In this view, the "Remove" link is useless and somewhat unprofessional looking. What I need help with is NOT showing that column when the SelectedIndex of the DropDown is == 1. If it is == 0 then I want the last column to show as normal. I have tried "GridView.Columns.RemoveAt" which works the first time but doesn't show again. So, is there anyway to hide a column on a postback and make if visible again. Thanks in advance for any suggestions.
-
Hello All, Have a problem where I would like to display a column only if a particular item is selected in a drop down. To be more specific, I display some values in a gridview and the last column contains a link that removes (actually just archives by setting a bit flag) the row from being displayed in the "Active" view. If the user wants to see "Archived" rows, they would select it from the DropDownList and the page automatically posts and displays the archived items. But the last column with the link still appears. In this view, the "Remove" link is useless and somewhat unprofessional looking. What I need help with is NOT showing that column when the SelectedIndex of the DropDown is == 1. If it is == 0 then I want the last column to show as normal. I have tried "GridView.Columns.RemoveAt" which works the first time but doesn't show again. So, is there anyway to hide a column on a postback and make if visible again. Thanks in advance for any suggestions.