Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 6th, 2004, 03:34 AM
bbstone bbstone is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 bbstone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Don't get all columns with DataGridCommandEventArgs

Hello,
I have generatet a Web-Datagrid by using a SqlDataadapter and a dataset. I generate the dataadapter and dataset dynamically and read with a sql data from 2 tables. I also added 2 columns with the property generator in the datagrid for deleting and updating data.

When I want to update a row with following sub

Private Sub DtaGrid_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles DtaGrid.UpdateCommand
' get line which was changed by using index for data key list value
Dim sKey As String = DtaGrid.DataKeys(e.Item.ItemIndex).ToString()

' get fields for changed line, start with cell 2
Dim sZelle() As String
Dim i As Integer
Dim j As Integer
Dim tb As TextBox ' fields are shown as text box in data grid
ReDim sZelle(oTabelle.AnzFelder - 1)
'Dim r As
Dim index As Integer
index = e.Item.ItemIndex


For i = 0 To (oTabelle.AnzFelder - 1)
j = i + 2 'starts with cell 2
tb = CType(e.Item.Cells(j).Controls(0), TextBox)
sZelle(i) = tb.Text
Next
ds.Tables(0).Rows(index).ItemArray = sZelle

index = e.Item.ItemIndex
' delete data from data source
oHlpSql.UpdData(da, ds, oTabelle.auswuser, index) 'does the update in ds and da
ConDtaGrid() ' bind datagrid
End Sub


My problem is now that,
e.Item.Cells(j).Controls(0) 'with j = 2
has only 2 cells (delete and update, which I generated in the grid. All the columns, which come dynamically from the dataset are not recognised.

Does somebody knows this problem?

Greetings,
Brigitte

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Don't get all columns with DataGridCommandEventArgs


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway