This is a migrated thread and some comments may be shown as answers.

Radgrid asp.net

2 Answers 18 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 23 Jan 2017, 08:15 PM

I have an auto-generated grid from a datatable.  I need to find the index of 2 columns and then traverse the columns (i.e. col 4-6) and then grab the data from each cell and make it bold based on a condition. 

1 -How can I get the indexes of these if I know the header name?

2 - how do I traverse the columns and grab it's data?

 

Thanks in advance!

2 Answers, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 24 Jan 2017, 04:58 PM

I finally figured it out.

'to get the column text from a page load etc.

intTotalWip = CInt(e.Item.Cells(grdDetail.MasterTableView.GetColumn("TotalWIP").OrderIndex).Text)

As I loop through:

For Each col As GridColumn In grdDetail.MasterTableView.AutoGeneratedColumns

if col.UniqueName = "columnname"

     index = col.OrderIndex

0
Mark
Top achievements
Rank 1
answered on 24 Jan 2017, 04:59 PM
Sorry the first is from itemdatabound
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Share this question
or