protected void gvHighscore_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         VmHighScoreGvItem h = (VmHighScoreGvItem)e.Row.DataItem;
         e.Row.Attributes["hId"]     = h.Id.ToString();
         e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(gvHighscore, "Select$" + e.Row.RowIndex);
         e.Row.ToolTip = "Click to select this row.";
     }
 }
        private VmHighScoreGvItem ToGvItem(Highscore h, List <Category> cs, int ranking)
        {
            VmHighScoreGvItem vm = new VmHighScoreGvItem();

            vm.CategoryName   = string.Join(";", cs.Select(x => x.CategoryText));
            vm.GameDuration   = h.GameDuration;
            vm.MomentOfGame   = h.MomentOfGame;
            vm.Name           = h.Name;
            vm.Points         = h.Points;
            vm.Rang           = ranking;
            vm.Id             = h.Id;
            vm.WeightedPoints = h.WeightedPoints;
            return(vm);
        }