Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Getting data value in GridView.RowDeleting

Reply
Thread Tools

Getting data value in GridView.RowDeleting

 
 
David C
Guest
Posts: n/a
 
      01-09-2009
I am trying to get the DataKey value from the GridView during a RowDeleting
event but I am getting nothing returned in my strid variable. Below is part
of my code if someone can help. Thanks.
-David

Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewDeleteEventArgs)
Dim strSQL As String = ""
Dim strText As String = ""
Dim row As GridViewRow = GridView1.Rows(e.RowIndex)

Dim strid As String = Convert.ToString(DataBinder.Eval(row.DataItem,
"AssigneeID"))

End Sub

Below is first part of my GridView


<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" BackColor="White"
BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
CellPadding="4" DataKeyNames="AssigneeID"
DataSourceID="SqlDataSource1"
EmptyDataText="There are no Assignee records to display."
AllowSorting="true"
onrowdeleting="GridView1_RowDeleting">
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<Columns>
<asp:CommandField ShowEditButton="True" >
<ItemStyle Width="70px" />
</asp:CommandField>
<asp:BoundField DataField="AssigneeID" HeaderText="ID"
ReadOnly="True" SortExpression="FileTypeID" Visible="False" />


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
getting pixel data from image as single value jimgardener Java 1 07-08-2008 08:52 PM
Getting ID, calling url, search for value, return value Tim Fröglich ASP .Net Web Services 1 01-10-2006 09:18 PM
Getting Value out of a data repeater checkbox jim.long@vanderbilt.edu ASP .Net 4 12-15-2005 07:30 PM
Getting value from asp:label into javascript input value Dwizz Javascript 10 08-07-2005 02:28 AM
Getting the data key field value when selecting a row in a datagrid... Stu ASP .Net 1 08-01-2003 07:32 PM



Advertisments