In your case
write the following code in  GridView1_RowEditing Event
Dim CategoryID as String=GridView1.Rows(e.NewEditIndex).Cells(0).Text


2009/4/18 visavadiya hiren <[email protected]>

> suppose, i have an grid view which has below data, like
>
> 1 ABC ABC ABC 09876 09876 Edit Delete
>
> Here Edit and Delete are hyperlinks for editing and deleting the data .
> But problem is that how can i catch the ID from binding data..
>
>
> code like this :
> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
> DataKeyNames="CategoryID"
>             DataSourceID="SqlDataSource1" Style="left: 243px; position:
> relative; top: -154px" Width="465px">
>             <Columns>
>                 <asp:BoundField DataField="CategoryID"
> HeaderText="CategoryID" InsertVisible="False"
>                     ReadOnly="True" SortExpression="CategoryID" />
>                 <asp:BoundField DataField="AddedDate"
> HeaderText="AddedDate" SortExpression="AddedDate" />
>                 <asp:BoundField DataField="AddedBy" HeaderText="AddedBy"
> SortExpression="AddedBy" />
>                 <asp:BoundField DataField="Title" HeaderText="Title"
> SortExpression="Title" />
>                 <asp:BoundField DataField="Importance"
> HeaderText="Importance" SortExpression="Importance" />
>                 <asp:HyperLinkField
> NavigateUrl="~/CategoryAddEditDelete/CategoryAddEdit.aspx" Text="Edit" />
>                 <asp:CommandField ShowDeleteButton="True" />
>             </Columns>
>         </asp:GridView>
>



-- 
Regards
*******************
*C.Arun Kumar *
*******************

Reply via email to