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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get Cell Value in GDBG control

Thread ID:

Created:

Updated:

Platform:

Replies:

57272 Feb 28,2007 06:35 PM UTC Feb 28,2007 08:57 PM UTC Windows Forms 1
loading
Tags: GridControl
Patrick Rumery
Asked On February 28, 2007 06:35 PM UTC

I need to get the value of a cell from the current row. I want to use the name of the column because the users move them around. I'm using this method and it works fine until the column is moved. I want to replace the call to the datarow object (dr)

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).Text

Thanks

Administrator [Syncfusion]
Replied On February 28, 2007 08:57 PM UTC

Hi Prumery,

You can get the ColIndex from column name by using Binder.NameToColIndex method. Please try the code snippet

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
Dim ColIndex As Integer = dgEng.Binder.NameToColIndex("PlatMap")
dgEng(cc.RowIndex, ColIndex).Text

Best regards,
Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;