|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problems Updating GridView when bound to datatableCan enter edit mode fine but when I extract new and old values they are the same (ie. the old and new values are exactly the same!!!) any help would be greatly appreciated. here is my code: Dim cell As DataControlFieldCell = gridSubscribers.Rows(e.RowIndex).Cells(1) gridSubscribers.Columns(0).ExtractValuesFromCell(e.NewValues, cell, DataControlRowState.Edit, True) cell = gridSubscribers.Rows(e.RowIndex).Cells(2) gridSubscribers.Columns(1).ExtractValuesFromCell(e.NewValues, cell, DataControlRowState.Edit, True) cell = gridSubscribers.Rows(e.RowIndex).Cells(1) gridSubscribers.Columns(0).ExtractValuesFromCell(e.OldValues, cell, DataControlRowState.Edit, True) cell = gridSubscribers.Rows(e.RowIndex).Cells(2) gridSubscribers.Columns(1).ExtractValuesFromCell(e.OldValues, cell, DataControlRowState.Edit, True) Dim records(e.NewValues.Count - 1) As DictionaryEntry Dim oldRecords(e.OldValues.Count - 1) As DictionaryEntry e.NewValues.CopyTo(records, 0) e.OldValues.CopyTo(oldRecords, 0) Have you defined the datakeyname property?
Hope this helps you <j***@mullersys.com> wrote in message Show quoteHide quote news:1144092020.892039.59180@u72g2000cwu.googlegroups.com... >I am having problem updating when GridView is bound to datatable. > Can enter edit mode fine but when I extract new and old values they are > the same (ie. the old and new values are exactly the same!!!) > > any help would be greatly appreciated. > > here is my code: > > Dim cell As DataControlFieldCell = > gridSubscribers.Rows(e.RowIndex).Cells(1) > gridSubscribers.Columns(0).ExtractValuesFromCell(e.NewValues, cell, > DataControlRowState.Edit, True) > > cell = gridSubscribers.Rows(e.RowIndex).Cells(2) > gridSubscribers.Columns(1).ExtractValuesFromCell(e.NewValues, cell, > DataControlRowState.Edit, True) > > cell = gridSubscribers.Rows(e.RowIndex).Cells(1) > gridSubscribers.Columns(0).ExtractValuesFromCell(e.OldValues, cell, > DataControlRowState.Edit, True) > > cell = gridSubscribers.Rows(e.RowIndex).Cells(2) > gridSubscribers.Columns(1).ExtractValuesFromCell(e.OldValues, cell, > DataControlRowState.Edit, True) > > Dim records(e.NewValues.Count - 1) As DictionaryEntry > Dim oldRecords(e.OldValues.Count - 1) As DictionaryEntry > e.NewValues.CopyTo(records, 0) > e.OldValues.CopyTo(oldRecords, 0) > I figured it out. The grid was rebinding before the row updating
event. I just changed the code so it binds after the update.
How to get ListItemValue and ListItemText from a Combo using SendMessage
checkbox bind with 0 = checked? error using .NET CrystalReportViewer (.NET 1.1 VS.NET 2003) Removing columns from Gridview(2.0) databinding on templatefileds dont work? Problems with dynamically created GridView/DetailsView Rendering a Treeview Control InputAttributes in RowCreated (gridview) GridView XmlDataSource WebControl rendering in frontpage 2003 - Migrating from Visual Studio 2003 to 2005 DataGrid item dropdownlist javascript disable |
|||||||||||||||||||||||