• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

Getting Datagrid Column Value - should be easy

Hello all.  I have a loop where currently I am getting the datakey field and appending to a pipe delimiter.  I want to do the same with a column field.  There is a column field called Qty I know the column number as well.  I want to get the value of this column through my loop what do I need?  Here is the loop.  I tried drCust.Columns but I must be missing stuff.  Thanks

      foreach (DataGridItem dgitem in this.dgCust.Items)
            {
            
            pipedBP = pipedBP + dgCust.DataKeys[dgitem.ItemIndex].ToString() + "|";

            //Now here I want to grab the value of my column 6 which is a Qty field.             
            }
0
sbornstein2
Asked:
sbornstein2
1 Solution
 
e1vCommented:
You can use

dgitem.Cells[6].Text
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now