1
I have 3 variables whose values are changed within a loop for
. What I’m trying to do is take these values that are obtained from the variables and load them into a Gridview. Here’s what I tried to do, unsuccessfully:
protected void Page_Load(object sender, EventArgs e)
{
converteMacroHexadecimal(EntidadeMacro.Texto);
int numCoordenadas = getNumeroDeCoordenadas();
var b = EntidadeMacro.Texto;
TextBox2.Text = Convert.ToString(HexToInt(EntidadeMacro.Texto));
string latitude = "";
string longitude = "";
string velocidade = "";
DataTable dt = new DataTable();
dt.Columns.Add(latitude, System.Type.GetType("System.String"));
dt.Columns.Add(longitude, System.Type.GetType("System.String"));
dt.Columns.Add(velocidade, System.Type.GetType("System.String"));
for (int i = 1; i <= numCoordenadas; i++)
{
latitude = getLatitude(i);
longitude = getLongitude(i);
velocidade = getVelocidade(i);
dt.Rows.Add(new String[] { latitude.ToString(),"Latitude" });
}
GridViewPontosTroca.DataSource = dt;
GridViewPontosTroca.DataBind();
//GridViewPontosTroca.Rows[0].Cells[0].Text = getLatitude(0);
//GridViewPontosTroca.Rows[0].Cells[1].Text = getLongitude(1);
//GridViewPontosTroca.Rows[0].Cells[2].Text = getVelocidade(2);
TextBox1.Text = macro;
// t.Text = Convert.ToString(numCoordenadas);
var a = Convert.ToString(ParametroDeAproximacaoMaxima());
TextBoxAproximacaoMaxima.Text = Convert.ToString(ParametroDeAproximacaoMaxima());
}
What happens? what’s the problem? try debugging and see where the problem is...
– Danilo Breda