jknj72
asked on
Gridview User Control event not firing
I have a gridview user control that does everything I need it to except for one thing. I can NOT get the SelectedIndexChanged or Changing events to fire. I have put it in the user control but still cannot get it to fire so that I can use it for my needs. I do have this code on RowDataBound
I wanted to mention the RowDataBound but Im not sure if that is going to help anyone fix my issue but thought I would mention it anyway.
If anyone needs anymore info please ask.
Thanks in advance...
'e.Row.Attributes("onclick") = Page.ClientScript.GetPostBackClientHyperlink(myGridview, e.Row.Cells(7).Text & "|" & e.Row.Cells(5).Text & "|" & e.Row.Cells(8).Text)
'e.Row.ToolTip = "Click to select this row."
and my markup code is <asp:GridView ID="gvGeneric" runat="server" AutoGenerateColumns="false" AllowPaging="true"
AllowSorting="True" SelectedIndex="0"
OnSorting="GridView_Sorting"
OnRowDataBound="GridView_RowDataBound"
OnDataBound="GridView_DataBound"
OnRowDeleting="GridView_RowDeleting"
OnRowEditing="GridView_RowEditing"
OnRowUpdating="GridView_RowUpdating"
OnRowCancelingEdit="GridView_RowCancelingEdit"
OnSelectedIndexChanged="GridView_SelectedIndexChanged"
OnSelectedIndexChanging="GridView_SelectedIndexChanging"
PagerSettings-Visible="false" Width="95%">
<RowStyle HorizontalAlign="Center" Height="25px" CssClass="hover_row" />
<AlternatingRowStyle HorizontalAlign="Center" CssClass="hover_row"/>
<EditRowStyle cssClass="GridViewEditRow" />
<EmptyDataRowStyle Height="40px" HorizontalAlign="Center" />
<EmptyDataTemplate>
<b>No Data Found</b>
</EmptyDataTemplate>
</asp:GridView>
I wanted to mention the RowDataBound but Im not sure if that is going to help anyone fix my issue but thought I would mention it anyway.
If anyone needs anymore info please ask.
Thanks in advance...
ASKER
Im what event are you trapping the clicks? Are you using the RowCommand event? Thanks for your help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you for your help
and you dont have
Open in new window
so the select button never shows up.also can create your own Select button in any location...
<asp:buttonfield buttontype="Button"
CommandName="Select"
headertext="Select Item"
text="Your Custom Text"/>
i add my own buttons in cells and trap those clicks.