Bonjour, bonjour!
Mon problème pour ce code c'est que ça affiche 0MB dans les colonnes...

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
protected void gvSQLDB_RowDataBound(Object sender, GridViewRowEventArgs e) 
{ 
if (e.Row.RowType == DataControlRowType.DataRow) 
{ 
double lg = 0.00, dt = 0.00; 
try 
{ 
lg = double.Parse(e.Row.Cells[14].Text); 
lg += Convert.ToDouble(DataBinder.Eval(e.Row.RowType, "Double")); 
dt = double.Parse(e.Row.Cells[13].Text); 
dt += Convert.ToDouble(DataBinder.Eval(e.Row.RowType, "Double")); 
} 
catch { } 
 
if (lg < 1000) 
{ 
e.Row.Cells[14].Text = lg.ToString() + " MB"; 
//string logs = String.Format("{0:0.0}", lg); 
} 
else 
{ 
e.Row.Cells[14].Text = (lg / 1000).ToString() + " GB"; 
//string logs = String.Format("{0:0.0}", lg); 
} 
 
if (dt < 1000) 
{ 
e.Row.Cells[13].Text = dt.ToString() + " MB"; 
//string datas = String.Format("{0:0.0}", dt); 
} 
else 
{ 
e.Row.Cells[13].Text = (dt / 1000).ToString() + " GB"; 
//string datas = String.Format("{0:0.0}", dt); 
} 
addHeaders(); 
} 
}