Wrox Programmer Forums
|
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
 
Old December 24th, 2003, 03:40 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default how do i hide a column from grid

Hay :D,
i have a datagrid read from a datasource and autogenerate the columns and i made a link column and the url have another field Text in the
 URl like:
<asp:HyperLinkColumn DataNavigateUrlField="ColumnID" DataNavigateUrlFormatString="grid1.aspx?id={0}" DataTextField="ColumnDisplayed" HeaderText="link" NavigateUrl="b"></asp:HyperLinkColumn>

, so i need to hide this id column how do i?????

Note: the datagrid autogenerate the columns and i need not to redifine template columns... If any Know plz help


Ahmed Ali
Software Developer
__________________
Ahmed Ali
Senior Software Developer
 
Old December 28th, 2003, 12:21 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

the only way to do this is to remove the autogenerate feature, then select each column individually that you want to see in the grid. You can also include the ID field in the grid and then uncheck the visible checkbox in the property builder screen.

Hope this helps

Jim

 
Old December 28th, 2003, 05:40 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

thx jbenson,
but how can i handle an event of button in template column , i needn't to do that in aspx file , is there a way to do it visually like property builder and code for event done in code behind

Ahmed Ali
Software Developer
 
Old December 29th, 2003, 10:38 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You can use the itemcommand event on the datagrid. Then use the e (DataGridCommandEventArgs) to do what you want. You can use e.CommandArg, e.CommandName, and e.CommandSource






Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView - Hide column and retrieve value snufse ASP.NET 2.0 Basics 1 July 24th, 2008 03:22 PM
unable to hide a column sameer123 ASP.NET 1.0 and 1.1 Professional 2 September 25th, 2007 08:48 AM
hide certain column in a table lscjtw XSLT 2 August 2nd, 2007 01:26 PM
hide column in rnage where values found greg85374 Excel VBA 2 February 13th, 2005 10:08 AM
could i hide a column at run time from datagrid alyeng2000 ASP.NET 1.0 and 1.1 Basics 10 January 17th, 2004 03:26 PM





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