|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Don't get all columns with DataGridCommandEventArgs |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|