Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 September 29th, 2004, 12:19 PM
Registered User
 
Join Date: Sep 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datagrid column buttons disappear on databind

I created an application with a datagrid that allows users to place an entire column in edit mode. There is also a hyperlink column that
allows them to drilldown to a more detailed datagrid.

The editable columns are template columns and I defined edit, update and cancel buttons for the template column's footer. Initially, the edit button is visible in the footer. When the edit button is clicked, every cell in the column hides its label and unhides a textbox through the itemcreated event so that the column is in edit
mode. In the itemcommand event, I hide the edit button in the footer
and display the update and cancel buttons. This works very well and I am able to change the data and update the entire column.

I wanted to be able to stop users from clicking on the hyperlink column while a column is in edit mode. So when the edit button is clicked, I change the hyperlink url to a Javascipt alert command for each row through the itemcreated event. But in order to get the alert reflected in the datagrid, I need to bind the data. And the alert works perfectly, clicking on the hyperlink displays a message telling the user that drilldown is not allowed in edit mode. The problem is when I bind the data, I lose the update and cancel buttons and the edit button appears in the column that's in edit mode. If I don't bind the data, the update and cancel buttons are there, but the hyperlink column reflects the original url and not the javascript alert command. It doesn't matter whether I place the databind command before or after I make the update and cancel buttons visible. I can confirm in debug mode that they are set to visible, yet they do not appear.

I've searched forums, newsgroups, msdn, etc. and but can't figure it out. Does anyone have any ideas how I can get this to work? Is there a different approach I can take?
 
Old September 29th, 2004, 12:27 PM
Authorized User
 
Join Date: Sep 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

instead you can have 2 hyperlinks

one that drillsdown and the other for alert box

and show and hide in editmode



 
Old September 29th, 2004, 01:37 PM
Registered User
 
Join Date: Sep 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the quick response. That's a pretty good idea. I'll see if I can implement that.
 
Old September 29th, 2004, 03:17 PM
Registered User
 
Join Date: Sep 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by pran
 instead you can have 2 hyperlinks

one that drillsdown and the other for alert box

and show and hide in editmode
Pran,

Thanks so much. Having two hyperlink columns worked like a charm. I don't know how I could have missed such a simple solution.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Buttons disappear from dialog form j0hnyager Visual Basic 2005 Basics 2 March 3rd, 2008 02:24 PM
Radio buttons disappear JoeBob49 ASP.NET 2.0 Basics 2 November 27th, 2006 09:57 AM
Buttons in DataGrid Template Column divsalar ASP.NET 1.x and 2.0 Application Design 1 February 1st, 2005 03:37 PM
Datagrid command buttons badgolfer ASP.NET 1.0 and 1.1 Basics 22 July 27th, 2004 02:42 AM
Buttons in datagrid msrnivas .NET Web Services 1 May 23rd, 2004 06:31 AM





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