473,395 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Add Row to datatable bound to gridview inside a gridview

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?
Aug 17 '06 #1
0 4294

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: witek | last post by:
I am lost. There is a dataTable with data which I want to dispaly in GridView. dataTable is not connected to any database. Just dataTable with data. There is a class wich is used as column...
4
by: Tomasz Jastrzebski | last post by:
Hello Everyone, I have a GridView control bound to a plain DataTable object. AutoGenerateEditButton is set to true, Edit button gets displayed, and RowEditing event fires as expected.
2
by: eric.dehaan | last post by:
Hello. I have a Gridview on my webpage. To this gridview, I bind a datatable. The results are correctly displayed. But after I edit some values and trigger the event, the values & are empty....
1
by: weird0 | last post by:
I have created a GridView and dynamically added data to it by creating a DataTable(as advised) and bound it with a reader. Then, assigned the DataSource of GridView to DataTable. But even that aint...
2
by: chike_oji | last post by:
Please can someone help me. I am writing a web application, that allows for the upload of an excel sheet into the database. I have an upload button and a save button. The upload button allows...
2
by: DC | last post by:
Hi, I am using a GridView to present data in a DataTable, which I store only in ViewState and when the user hits the "OK" button the rows in the DataTable will be used to execute transactions. ...
2
by: tonymcq | last post by:
I am very new to VB.net / ASP and have spent hours and hours trying to solve what must be a simple problem - hopefully someone can point me in the right direction. I have a gridview bound to an...
0
by: Mel | last post by:
I want to edit a couple columns in the GridView control. I will add the controls to the EditItemTemplate for the editing. Since the DataTable is bound to my GridView, do I need to update my...
1
by: E11esar | last post by:
Hi there. I have a DataTable with around 20 columns in it and a GridView that is bound to the DataTable. Is it possible to specify which columns the GridView has to bind to please? While I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.