L
L-E Eriksson
Hello!
I have a simple gridview. I am using stored procedures and a my own Data
Access Layer. Now I want to delete a row.
Gridview code:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns=false
AllowPaging="true" PageSize="5" DataKeyNames="KonsultID">
<Columns>
<asp:CommandField ButtonType="Button" ShowDeleteButton="true" />
<asp:BoundField DataField="ConsultantID" Visible="false" />
<!--PrimaryKey-->
<asp:BoundField DataField="FirstName"/>
<asp:BoundField DataField="LastName"/>
<asp:TemplateField><ItemTemplate>
</Columns>
</asp:GridView>
and then I have the code behind:
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles
GridView1.RowDeleting
Dim iVal As Integer = e.RowIndex
'Code missing here!
End Sub
'Now I know which row was clicked, but how do I get the value of the
ConsultantID?
Regards
Clarkie
I have a simple gridview. I am using stored procedures and a my own Data
Access Layer. Now I want to delete a row.
Gridview code:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns=false
AllowPaging="true" PageSize="5" DataKeyNames="KonsultID">
<Columns>
<asp:CommandField ButtonType="Button" ShowDeleteButton="true" />
<asp:BoundField DataField="ConsultantID" Visible="false" />
<!--PrimaryKey-->
<asp:BoundField DataField="FirstName"/>
<asp:BoundField DataField="LastName"/>
<asp:TemplateField><ItemTemplate>
</Columns>
</asp:GridView>
and then I have the code behind:
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles
GridView1.RowDeleting
Dim iVal As Integer = e.RowIndex
'Code missing here!
End Sub
'Now I know which row was clicked, but how do I get the value of the
ConsultantID?
Regards
Clarkie