Making a datagrid's boundcolumn visible?

Rx31

New Member
I have a datagrid for a shopping cart. The grid shows the product name, qty, and price.<BR><BR>In some cases, based on a variable being set to X, I want to include a 4th column for weight.<BR><BR>Now, I have no problem adding this 4th bound column to my grid and making it show the weight. But I have no idea how to programatically turn this column on and off. I know the VISIBLE attribute works but since boundcolumns don't have ID's how do I turn this column on and off within a sub-routine?try this<BR><BR>My_DG1.Columns(3).Visible = 1 or 0<BR><BR>or <BR><BR><asp:BoundColumn visible = "False" DataField="STKDESC"></asp:BoundColumn><BR><BR><asp:BoundColumn visible = "<%# GETCOLSTATUS('EDIT_MODE')%>" DataField="STKDESC"></asp:BoundColumn><BR><BR><BR><BR>Function GETCOLSTATUS(mvMODE)<BR>'------------------------------------<BR>If mvMODE = "EDIT_MODE" Then<BR> Return = 0<BR>Else<BR> Return = 1<BR>end if<BR><BR>End FunctionOnce again you saved me!!! Thanks a ton!
 
Back
Top