Hi again Cor
You were, as always, on the right lines. Many thanks.
All that was needed was a few minor changes to the code:
Dim index As Integer
For index=0 To dg.DataSource.Columns.Count - 1
If dg.DataSource.Columns(index).ColumnName = mytestString Exit For
Next
i.e. The dg.DataSource returns a DataTable, in my case, so there is no need
to use the DataTable part in the original code.
Geoff
"Geoff Jones" <(E-Mail Removed)> wrote in message
news:419f5fc5$0$310$(E-Mail Removed)...
> Hi Cor
>
> I like the idea, unfortunately it does not work i.e. dg.datasource does
not
> have a member "datatable".
>
> Geoff
>
> "Cor Ligthert" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > Geoff,
> >
> > With styles?
> >
> > When not than can it in my opinion be something as (depending on your
> > datasource)
> > \\\
> > dim columnindex as integer
> > for columnindex = 0 to dg.datasource.datatable.columns
> > if datasource.datatable.columns(i).name = mytest
> > exit for
> > next
> > ///
> > I never did this, but just typed in this message as idea.
> >
> > Cor
> >
> > "Geoff Jones" <(E-Mail Removed)>
> >
> > > Hi
> > >
> > > Can anybody tell me how to find the column index in a DataGrid knowing
> > > only
> > > the text in the column heading? Any sample code would be most useful.
> > >
> > > Thanks in advance
> > >
> > > Geoff
> > >
> > >
> >
> >
>
>
|