iterate through bound columns

S

Svetlin Grancharov

Use DataGridColumn instead of BoundColumn. So the code
should be:

dim bc as DataGridColumn
for each bc in myGrid.Columns
...
After that depends on column (some could be BoundColumn,
some TemplateColumn) you can read headings and data column
names.

Svetlin Grancharov
 
J

jim corey

Well at this point I don't know how to figure out what kind of column bc is.
Do I use bc.GetType?
Any example appreciated.
 
S

Svetlin Grancharov

Yes you can use GetType().ToString() and after that to
look in this string but better is would be:
....
Dim dgc As DataGridColumn
Dim bc As ButtonColumn
dim tc as TemplateColumn
....
For Each dgc In myGrid.Columns
If TypeOf dgc Is ButtonColumn Then
bc = dgc
...
end if
...
If TypeOf dgc Is TemplateColumn Then
tc = dgc
...
end if
...
Next


Best

Svetlin Grancharov
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top