We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

update cell value in unbound gdbg

How do I update a cell value in a column that has been moved? When I do this now the wrong cell gets the value I'm trying to set it to.

Dim cc As GridCurrentCell = dgEng.CurrentCell
Dim cm As CurrencyManager = CType(Me.BindingContext(Me.dgEng.DataSource, Me.dgEng.DataMember), CurrencyManager)
Dim dr As DataRow = CType(cm.Current, DataRowView).Row

dgEng(cc.RowIndex, dr.Table.Columns("PlatMap").Ordinal + 1).CellValue = PMfile

the problem is the ordinal value doesn't move with the colum. Do I need to update the datasource and then rebind? Or can I find the column position another way?

Thanks,
Patrick


1 Reply

AD Administrator Syncfusion Team May 31, 2008 12:19 AM UTC

Maybe this will work for you. Instead of trying to update the grid cell, try to change the datarow directly.

Dim dr As DataRow = CType(cm.Current, DataRowView).Row

dr("PlatMap") = PMfile


If you still want to find the column index, you can try

dim colIndex as Integer = grid.Binder.NameToColIndex("PlatMap")





Loader.
Live Chat Icon For mobile
Up arrow icon