FineUI/FineUI.Examples/grid/grid_many_columns.aspx.cs
三生石上 79ad9e6bc2 v4.2.3
2016-01-10 01:19:30 -05:00

74 lines
1.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using System.IO;
namespace FineUI.Examples.grid
{
public partial class grid_many_columns : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGrid();
}
}
#region BindGrid
private void BindGrid()
{
DataTable table = DataSourceUtil.GetDataTable();
Grid1.DataSource = table;
Grid1.DataBind();
}
protected string GetHobby(object hobbyObj)
{
List<string> hobbyList = new List<string>();
// Hobbyreading,basketball,travel,movie,music
// 爱好:读书, 篮球, 旅游, 电影, 音乐
string[] hobbies = hobbyObj.ToString().ToLower().Split(',');
foreach (string hobby in hobbies)
{
if (hobby == "reading")
{
hobbyList.Add("读书");
}
else if (hobby == "basketball")
{
hobbyList.Add("篮球");
}
else if (hobby == "travel")
{
hobbyList.Add("旅游");
}
else if (hobby == "movie")
{
hobbyList.Add("电影");
}
else if (hobby == "music")
{
hobbyList.Add("音乐");
}
}
return String.Join(",", hobbyList.ToArray());
}
#endregion
}
}