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

Looping through rows

1 Answer 173 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Erik
Top achievements
Rank 1
Erik asked on 01 Mar 2011, 06:36 PM
I had this working at one point where I was looping through the rows in a RadGridView, but now it doesn't seem to be doing so.  It just iterates through the same row over and over??

Can anyone tell me what I'm missing or if anything looks incorrect with the following that would have changed the row looping process?

private void radGrid1_RowLoaded(object sender, RowLoadedEventArgs e)
{
                    var RedValues = ThresholdListStrRed.ToArray();
                    string strRedValList = "";
                    char[] seperateRed = new char[] { ',' };
                    string[] strSplitArrRed;
  
                    for (int i = 0; i < gridRowCount; i++)
                    {
                        strRedValList = RedValues[0].ToString();
                        strSplitArrRed = strRedValList.Split(seperateRed);
                                                              //JUST LOOPS THROUGH THE SAME ROW OVER AND OVER HERE??
                        if (e.Row is GridViewRow && !(e.Row is GridViewNewRow))
                        {
                            var mni = e.DataElement;
                            var eq = dynamicGrid.ChildrenOfType<GridViewCell>().Where(d => d.Column.UniqueName == strSplitArrRed[0].ToString() && d.Value.ToString() == strSplitArrRed[3].ToString()).ToList();
                            eq.ForEach(d => d.Background = new SolidColorBrush(Colors.Red));
                        }
  
                    }       
  
}

1 Answer, 1 is accepted

Sort by
0
Erik
Top achievements
Rank 1
answered on 01 Mar 2011, 07:03 PM
nvm....I found the issue.  At the bottom (I neglected to add the code) I was setting a bool value to false which was effectively making it end after hitting the first row and not continue on to the others.  Thanks to anyone that was looking at this for me.
Tags
GridView
Asked by
Erik
Top achievements
Rank 1
Answers by
Erik
Top achievements
Rank 1
Share this question
or