Solved

firefox rowcommand gridview

Posted on 2010-08-13
6
1,055 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
  • 4
  • 2
6 Comments
 
LVL 41

Expert Comment

by:guru_sami
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:janmishkin
Comment Utility
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
Comment Utility
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
Comment Utility
I got rid of the java when the browser is firefox. It works well enough now.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now