Solved

firefox rowcommand gridview

Posted on 2010-08-13
6
1,078 Views
Last Modified: 2013-12-07
ASP = 2.0

ie 8+  Everything works great.

In Firefox my rowcommand is not firing

Here is the code behind

    Protected Sub MYGRIDVIEW_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles QueryNameList.RowCommand
        Dim rowIndex As Integer = Integer.Parse(e.CommandArgument.ToString())
        Me.MYGRIDVIEW.SelectedIndex = rowIndex
 response.write(e.commandname)
         
    End Sub

    Protected Sub MYGRIDVIEW_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles QueryNameList.RowDataBound
              e.Row.Attributes.Add("onclick", _
       Page.ClientScript.GetPostBackEventReference(sender, "Select$" + e.Row.RowIndex.ToString))
 
   End Sub

THE  MYGRIDVIEW_RowDataBoundIS WHERE IT BREAKS. THE JAVA INSERTION "   Page.ClientScript..." seems to trump the row command. If I take out this code the EDIT button works but I need this in order to select a row and have it appear selected -  Yellow(see below)



Here's the aspx - remember it works correctly in IE 8
Notice there is a hidden select field -Not sure if it is needed, Choosing rows works in firefox. The select command is what is sent regardless if I press the edit button or not.(see response.write(e.commandname) above.

  <asp:GridView ID="MYGRIDVIEW" runat="server" onmouseout = "document.body.style.cursor = 'pointer'"  AutoGenerateColumns="False"     DataSourceID="MYDATA" ">
              <Columns>
                         <asp:BoundField DataField="MYFIELDNAME"   >
                  </asp:BoundField>
                      <asp:ButtonField CommandName="EDIT" Text="EDIT">
                        </asp:ButtonField>
            <asp:CommandField ShowSelectButton="True" >
                       <HeaderStyle CssClass="HiddenColumn" />
                       <ItemStyle CssClass="HiddenColumn" />
                   </asp:CommandField>
              </Columns>
<SelectedRowStyle BackColor="Yellow" />
                                               
                       </asp:GridView>


WOULD THIS BE RESOLVED BY GOING TO asp 3.x???
0
Comment
Question by:janmishkin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 41

Expert Comment

by:guru_sami
ID: 33432409
Actually I once used and it worked well.

Page.ClientScript.GetPostBackClientHyperlink(this.GridView1, "Select$" + e.Row.RowIndex)

http://www.codeproject.com/KB/webforms/JavaRowSelect.aspx
0
 

Author Comment

by:janmishkin
ID: 33456356
I have all of that in my code. There is something not working with FireFox. The problem is just with Firefox.
0
 
LVL 41

Expert Comment

by:guru_sami
ID: 33456391
just to be sure... you noticed the difference between the two codes:
you have GetPostBackEventReference and I have GetPostBackClientHyperlink ...not sure how much it matters because I have it working in IE and FF.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:janmishkin
ID: 33458122
heres the problem
 e.Row.Attributes("onclick") =
trumps all my gridview commands in firefox so the only command read is a "Select"
0
 

Author Comment

by:janmishkin
ID: 33458140
I changed to GetPostBackClientHyperlink  and its the same problem. It reads all onclick events as a "Select" even if I am clicking a command button.
0
 

Accepted Solution

by:
janmishkin earned 0 total points
ID: 33505305
I got rid of the java when the browser is firefox. It works well enough now.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question