It depends really on what the format of your data in the ViewBag is. You need to convert it to a JavaScript array for the grid. Razor is really good at this. If you are returning a list of friends from your controller like this...
publicActionResult Index()
{
ViewBag.Friends = newList<string>() {
"Burke",
"Brandon",
"Todd",
"Derick",
"Elif"
};
returnView();
}
You then need to encode it as JSON so that it's readable in JavaScript. Othewise Razor will just insert the type where @ViewBag.Friends is.