Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > ASP.NET 1.x and 2.0 Application Design
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 20th, 2006, 12:26 PM
Registered User
 
Join Date: May 2006
Location: Bristol, CT, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't see data from boundcolumn visible=false

I can't get the data, with my code, from a BoundColumn that is visible=False.

<asp:BoundColumn visible="False" datafield="JobSiteID"></asp:BoundColumn>

DataGRid1_UpdateCommand(source: System.Object; e: System.Web.UI.WebControls.DataGridCommandEventArgs );

  for intgrCellsCounter := 0 to e.Item.Cells.Count do
  begin
      for intgrControlsCounter := 0 to e.Item.Controls.Count do
      begin
        if e.Item.Cells[intgrCellsCounter].Controls[intgrControlsCounter].GetType().ToString = 'System.Web.UI.WebControls.TextBox' then
        begin
          txtbxTextBox := TextBox(e.Item.Cells[intgrCellsCounter].Controls[intgrControlsCounter]);
          txtValue := txtbxTextBox.Text;
        end
      end;
  end;

If I make the BoundColumn visible=True, then txtValue receives the data. If the BoundColumn is visible=false, then txtValue does not reveice the data.

Help and Thank you in advance.


Isa Paine
Software Developer



Isa Paine
Software Developer
  #2 (permalink)  
Old June 20th, 2006, 02:54 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Unfortunalty the grid works differently in 2.0. If you set the visible property to false using the grid property builder, it won't work. If you set the visible property to false programatically, it will work.
EX:
Page_Load event
e.Row.Cells(1).Visible = False; 'Your column you want to hide

This will work. Just remember not to set the visible property to false in the grid designer.

Jim




Similar Threads
Thread Thread Starter Forum Replies Last Post
certain columns of a row in datagrid visible false nanu yaru VS.NET 2002/2003 0 March 31st, 2008 08:27 AM
Non-displacement of controls when visible="false" rsearing ASP.NET 2.0 Professional 2 January 26th, 2007 06:27 PM
<asp:boundcolumn DataFormatString=......> bnorg ASP.NET 2.0 Basics 0 August 27th, 2006 12:18 PM
set rpttext box visible false myth12345 VB How-To 0 March 4th, 2005 11:08 AM
Visible property of controls in data list acko ASP.NET 1.x and 2.0 Application Design 1 December 9th, 2003 10:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.