468,733 Members | 1,622 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,733 developers. It's quick & easy.

GridView / ButtonType - Strange behaviour.

Hi,

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 fine...no 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
else.

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,

MJ

Oct 18 '06 #1
0 1188

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by NateDawg | last post: by
reply views Thread by Mike P | last post: by
4 posts views Thread by Wannabe | last post: by
1 post views Thread by =?Utf-8?B?Q2hyaXM=?= | last post: by
3 posts views Thread by =?Utf-8?B?SmVu?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.