GridView with one line only - Asp.Net C #

2

I have a column in the GridView with Schedules, I made a schematic that picks up such a time at such an hour for example: 8:00 to 8:30 and so goes to other lines. In all, until 6:00 p.m., it gives 20 lines. How do I put this all in one line? Something that broke for "," and stayed on the same line. Thank you.

    
asked by anonymous 26.05.2015 / 14:33

1 answer

1

You can use the Repeater component to do this. The similar code would be:

<asp:Repeater ID="rptHorarios" runat="server">
   <HeaderTemplate>
      <table border="0" id="tblHorarios">
         <tr>
   </HeaderTemplate>

   <ItemTemplate>
        <td>Eval("Horario")</td>
   </ItemTemplate>
   <FotterTemplate>
        </tr>
      </table>
   </FotterTemplate>
</asp:Repeater>

Code:

public void Page_Load(object sender, EventArgs args)
{
   if (!IsPostBack)
   {
      rptHorarios.DataSource = GetHorarios();
      rptHorarios.DataBind();
   }
}

Or you could also use the DataList and set the RepeatDirection and RepeatColumn properties to their values.

    
15.09.2015 / 18:56