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

Identifying column index from selected column?

How do I identify the underlying column index from a selected column? I want to be able to determine the mapping name of the selected column (one column only). Using ... Dim colIndex as integer = Me.GridDataBoundGrid1.Selections.Ranges.Item(0).Left Dim FieldIndex as integer = Me.GridDataBoundGrid1.Binder.ColIndexToField(colIndex) dv.table.columns(FieldIndex) does not work - colIndex is not pointing to the right column. On another note - I have been messing around with the suite for a few days. While it is very elegant, and far outshines anything else on the market, I think the documentation is very poor. The samples only go so far, the white paper gives a broad overview, but the help files are crying out for examples. I appreciate that this forum is quite unique - I've never seen a product so well supported by the developers, but I confess to feeling rather guilty asking my "stupid?" questions in public - I would be happier being able to find my answers in the help files .... Thanks Jeremy

1 Reply

AD Administrator Syncfusion Team April 19, 2003 01:05 PM UTC

There is no correspondance of fieldNum to datatable column as not all columns in a datatable have to be columns in the grid. If you want to access a particular column in the DataTable, then you should use the MappingName property of the GridBoundColumnt to access it.
Dim colIndex as integer = Me.GridDataBoundGrid1.Selections.Ranges.Item(0).Left 

Dim FieldIndex as integer = Me.GridDataBoundGrid1.Binder.ColIndexToField(colIndex) 

Dim colName as String = Me.GridDataBoundGrid1.Binder.InternalColumns(FieldIndex).MappingName

''  dv.table.columns(colName)

You actually get better support through our Direct Trac support system which also offers a nonpublic support venue. You don't not have to post questions in this forum unless you want to do so. We are working to improve the reference material made available with the product.

Loader.
Live Chat Icon For mobile
Up arrow icon