Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bound Column Data

Status
Not open for further replies.

abu22b

Programmer
Mar 19, 2001
8
SA
I have a DataGrid named as dgVideo with two columns:

a BoundColumn DataField="ID"

a template column which has
<%# Container.DataItem("DATA_FILE")%>"
<%# Container.DataItem("DATA_SOURCE")%>"
<asp:Button id="Button1" runat="server" Text="Add to Favorite" OnClick="Button1_Click" ></asp:Button>

I want to insert the BoundColumn("ID") data into a table called 'Favorites' on this button click event.

I Use 'dgVideo.SelectedItem.Cells(0).Text' to retrive the data. But I got error that "Object reference not set to an instance of Object'

Can anyone help me fix this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top