2013-05-04 74 views
1

我已經用C#填充了gridview,但是girdview中的數據非常接近單元格邊界。我怎樣才能拿走C#單元格內容的填充?如何使用C#爲gridview數據設置填充?

string query = "SELECT * FROM `fabrica`"; 

//'bd' and 'ExecuteRead' is my database classe 
DataTable table = bd.ExecuteRead(query); 
table.Columns["id"].ColumnName = "ID"; 
table.Columns["nome"].ColumnName = "Nome"; 
table.Columns["cidade"].ColumnName = "Cidade"; 
table.Columns["estado"].ColumnName = "Estado"; 
table.Columns["telefone1"].ColumnName = "Telefone 1"; 
table.Columns["telefone2"].ColumnName = "Telefone 2"; 
table.Columns["telefone3"].ColumnName = "Telefone 3"; 
table.Columns["email1"].ColumnName = "Email 1"; 
table.Columns["email2"].ColumnName = "Email 2"; 
table.Columns["email3"].ColumnName = "Email 3"; 
Tabela.DataSource = table; 
Tabela.ControlStyle.Width = 885; 

Tabela.DataBind(); 

回答