Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView / ButtonType - Strange behaviour.

Thread Tools

GridView / ButtonType - Strange behaviour.
Posts: n/a

I have a strange problem that hopefully someone can advise me on...

I have a Gridview which is not bound to a dataset etc. I populate the
gridview manually by constructing my own table, defining grid columns
then binding it to my table etc. Several of the columns in the gridview
are of type ButtonField with ButtonType set to "Button"

Now, all of this is working problems whatsoever.

I decided later that rather than a button I wanted a link instead, so I
simply changed "MyCol.ButtonType = ButtonType.Button" to
"MyCol.ButtonType = ButtonType.Link"

My problem is that by making this simple change, the page does not
work. The page still renders exactly as expected, but when I click on
one of the link buttons, none of the events are fired...instead, I get
the icon at the bottom left of explorer indicating an error on the
page. When I look at the error all I get is:

Line: 1
Char: 1
Error: Object expected
Code: 0
URL: xxxxxxxxxx

Remember, the only change I made was to change the ButtonType, nothing

Can anyone advise as to what could be the problem please. I've looked
at the properties of the ButtonField column to see if there are
properties specific to a link type button that I should be setting, but
there doesn't appear to be any.

Please note that I do not want a HyperLinkField, which would require me
to set a NavigateURL...I want to be able to catch the OnClick event of
the Button (which looks like a link)

Thanks in advance,


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid ButtonColumn ButtonType? Arpan ASP .Net 0 08-17-2006 12:13 AM
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM
How to change color,width,style of Edit,Dlete,add of buttontype =?Utf-8?B?UGF0cmljay5PLklnZQ==?= ASP .Net 3 10-05-2004 06:29 AM
Bug in DataGrid - ItemCommand event does not fire for ButtonColumnif ButtonType="PushButton" Nick Gilbert ASP .Net Datagrid Control 4 12-16-2003 06:39 AM
Bug in DataGrid - ItemCommand event does not fire for ButtonColumnif ButtonType="PushButton" Nick Gilbert ASP .Net 2 12-15-2003 08:10 AM