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

[Solved] Loading RadGridView from Array

1 Answer 117 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 27 Jan 2011, 10:43 PM
I have a need to have to replace the Column Headers that are being populated in my RadGridView.  I have taken the e.Result set and put the values into an array and changed the needed values.  The problem I have now is trying to get this new string[] to load the RadGridView.  When I use it as the ItemsSource is simply returns a string value and not the results.
Does anyone know how I would get this array to load the RadGridView in array or list form? 

var

 

tr = e.Result[0].ToArray();

 

string[] copiedArray = new string[resultCount];

 

 

for (var t = 0; t < hq.Count; t++)

 

{

 

var pp = tr[t].Key.ToString() +", "+ tr[t].Value.ToString();

 

copiedArray[t] = pp;

strSplitArr2[t] = strSplitArr2[t].ToString() +

", "+ tr[t].Value.ToString();

 

}


radGrid1.ItemsSource = strSplitArr2  //This doesn't work
radGrid1.ItemsSource = new DataTAble(e.Result);  //This is the original way

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 31 Jan 2011, 08:23 AM
Hello,

 Why not continue to use the DataTable and change the column headers of the grid itself - for example using AutoGeneratingColumn event if you have auto-generated columns?

All the best,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Erik
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or