1
In the datagridview
has a date field in the format yyyyMMdd
and need to display formatted in the correct form.
tried this:
dgvRequisicao.Columns["data"].DefaultCellStyle.Format = "dd/MM/yyyy";
But instead of showing me the formatted date shows me dd/MM/yyyy
Edit:
I populate the grid like this:
BindingSource sbind = new BindingSource();
sbind.DataSource = dt;
dgv.DataSource = sbind;
Edit:
Here I charge datatable
bank
for (int i = 0; i < parametros.Length; i += 2)
cmd.Parameters.AddWithValue(parametros[i].ToString(), parametros[i + 1]);
OracleDataAdapter da = new OracleDataAdapter(cmd);
da.Fill(dt);
Thank you
Post the code that fills your variable
dt
– Pablo Tondolo de Vargas
returns from an sql..
executeNonQuery
– novato
You can post more code to make it easier to see what you’re saying?
– Pablo Tondolo de Vargas
Yes... I put the for that fills the parameters and sends to the bank and the result returns in
datatable
.. In thedatagridview
I configured the columns according to the columns ofselect
– novato
The only way I could was through this
datatable
and put in a helper with the formatted data.. Still, thank you very much!– novato
Try to take the examples I posted and adapt to your reality. Look at my Git, I put the code of what I did to try to help you.
– Pablo Tondolo de Vargas