Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Help with visual basic.net code

Reply
Thread Tools

Help with visual basic.net code

 
 
PatLaf
Guest
Posts: n/a
 
      02-11-2004
Hello all, I have a web forms datagrid that is setup for master detail. I used the example from Jeff Tan from MSFT but there is something wrong when it displays the details datagrid that is encapsulated in the hidden column on the master datagrid. When I click the details button the column displays but the details datagrid which is bound to a DataRow only displays two columns. One is RowError the other is HasErrors. The HasErrors column has False listed as the details records. I have asked about this 3 or four times but to no avail. It is not an html issue it is in the vb code. I am using a .select against the datasource of the grid. I do get enough rows to support the details attached to the master record but it will not display the details.
Here is the code along with some commented out pieces. The pieces that are commented out will show one detail record with a row for every letter that is to be displayed but alas that is not what I need. It seems to me the databind on the dr doesn't work correctly.

Private Sub dgDefects_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgDefects.ItemDataBoun
Dim dgi As DataGridItem = e.Ite
If dgi.ItemType = ListItemType.Item Or dgi.ItemType = ListItemType.AlternatingItem The
Dim c As Contro
For Each c In dgi.Cells(7).Control
If TypeOf (c) Is System.Web.UI.WebControls.DataGrid The
Dim id As Int32 = Int32.Parse(dgi.Cells(0).Text
Dim dg As DataGrid = CType(c, DataGrid
'Dim dg As CheckBoxList = CType(c, CheckBoxList
Dim dr As DataRow(
dr = m_dsDefects.Tables("Defect_Details").Select("Defec t_ID=" & id
'Dim i As Integer = dr.Lengt
'If dr.Length > 0 The
' For i = 0 To
' dg.DataSource = dr(i).Item("Defect_Detail") '(0).Item("Defect_Detail"
' dg.DataBind(
' Nex
'End I
If dr.Length > 0 The
dg.DataSource = dr '(i).Item("Defect_Detail") '(0).Item("Defect_Detail"
dg.DataBind(
Els
Dim dr2 As DataRo
Dim dt As DataTable = New DataTabl
Dim dtCol As DataColumn = New DataColum
With dtCo
.ColumnName = "Detail Disposition
.DataType = System.Type.GetType("System.String"
.DefaultValue = "NO DETAILS
End Wit
dt.Columns.Add(dtCol
' Add one row. Since it has default values, no need to set values
dr2 = dt.NewRo
dt.Rows.Add(dr2
dg.DataSource = d
dg.DataBind(
End I
End I
Nex
End I
End Su

If I execute the commented out code I can see that the details are there yet they don't display. Any ideas? I am stuck on this issue and have been for 3 days. I have read as much as I could find about the datarow and the binding but there isn't anything in the docs that explains this behavior

Regard
Pat
 
Reply With Quote
 
 
 
 
Jeffrey Tan[MSFT]
Guest
Posts: n/a
 
      02-12-2004

Hi Pat,

I found that this is the same issue as issue in "Adding check list box
inside master detail web grid", I have added a reply in that post, please
check in that post.

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

 
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
HELP: Visual C++ 6.0 to Visual Studio.NET 2003 woes...... KevinGPO C++ 1 03-06-2006 02:33 PM
Visual Web Developer 2005 Express SCREWS UP YOUR CODE on PURPOSE...STOP TOUCHING MY CODE, MICROSOFT!!!! ik ASP .Net 6 07-16-2004 05:28 PM
HERE WE GO AGAIN, Visual Web Developer 2005 Express SCREWS UP YOUR CODE on PURPOSE...STOP TOUCHING MY CODE, MICROSOFT!!!! ik ASP .Net 8 07-09-2004 04:52 AM
For what use LABELS (left of the code) in Visual Basic Code? Andreas Klemt ASP .Net 3 01-14-2004 02:26 PM
When programming with Visual Studio in code. What means the Label in code? Andreas Klemt ASP .Net 2 01-14-2004 06:49 AM



Advertisments