PC Review


Reply
Thread Tools Rate Thread

Add Row to datatable bound to gridview inside a gridview

 
 
Elmo Watson
Guest
Posts: n/a
 
      17th Aug 2006
OK - main gridview - gvTV
In one column - I have another Gridview - gvTRPTV - function:


Public Function AddTRPRow() As DataTable
dtHeader = CType(ViewState("Header"), DataTable)
If dtHeader Is Nothing Then
dtHeader = New DataTable("Header")
ViewState("Header") = dtHeader
End If
Row = dtHeader.NewRow()
dtHeader.Rows.Add(Row)
AddTRPRow = dtHeader
End Function

In RowDataBound event of Main GridView, I have:
Dim TRPgv As GridView = CType(e.Row.FindControl("gvTRP"), GridView)
TRPgv.DataSource = AddTRPRow()
TRPgv.DataBind()

What I also have is a Linkbutton, above the internal Gridview, for the user
to add another Row to the Datatable, and thus, add it to the internal
GridView.

I have tried for hours and have not come up with a way to do this - can
someone help me out here?


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
DataTable Bound to GridView Control Mel Microsoft ASP .NET 0 27th Oct 2008 07:51 PM
GridView bound to a Datatable results in runtime error on attempts topage. Options chike_oji@yahoo.com Microsoft ASP .NET 2 29th Jan 2008 09:22 AM
GridView bound to a Datatable results in runtime error on attempts topage. chike_oji@yahoo.com Microsoft C# .NET 1 25th Jan 2008 07:45 PM
Gridview bound to Datatable. Update doesn't work, need help eric.dehaan@gmail.com Microsoft ASP .NET 2 19th Feb 2007 02:24 PM
GridView bound DataTable - how to get updates working? Tomasz Jastrzebski Microsoft ASP .NET 4 8th Dec 2006 12:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:35 AM.