Nilesh Chauhan

Nilesh Chauhan

  • NA
  • 1
  • 2.3k

Bind datagrid dynamically from code behind using array

Aug 1 2011 7:11 AM
hello,
i m new to silverlight4. and i have List<List<string>> as item source ;
in List<string> there are 9 items. that i want to bind as column in my datagrid,
is there any way to bind the same as another way.

please give me solution for the problem.

m using the same as bello, but its not working, its simply bind the arra in a datagrid column, and not the single column.

 List<List<string>> listColl = new List<List<string>>();
           
            List<string[]> list = new List<string[]>();
            list = dict.Values.ToList();
            
            //GrdQueryResult.ItemsSource = list;
           
            foreach (string[] item in list)
            {
                List<string> listString = new List<string>();
                foreach (string s in item)
                {
                    listString.Add(s);
                }
                listColl.Add(listString);
            }

            GrdQueryResult.ItemsSource = listColl;


thanks in advance .
Nilesh Chauhan

Answers (1)