The following code correctly formats the date, please confirm that your code is equivalent:
<asp:GridView ID="grid" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "data_inicio", "{0:dd/MM/yyyy}")%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
After receiving some more information per comment, I learned that the property used in the grid column is not a DateTime type. To appear in the desired format, you need to convert to DateTime and then format again as string
:
<ItemTemplate>
<%# Convert.ToDateTime(Eval("Data")).ToString("dd/MM/yyyy")%>
</ItemTemplate>
But I suggest you do not convert the property to string
and send DateTime
to Grid.