Visual Studio, convert Gridview columns to rows
I want to convert the gridview function to rows. I have a header saying "Content Manager" and I have their username displayed below it. I want the username to be able to be displayed to the right of the "content manager" text. Thank you!
<asp:SqlDataSource ID="SqlDataSource19" runat="server" ConnectionString="<%$ ConnectionStrings:IntranetDB %>" SelectCommand="SELECT [id], [username], [grouping], [isContentManager], [CMRegion] FROM [Permissions] WHERE (([grouping] = 'marketing') AND ([isContentManager] = 'yes'))"> </asp:SqlDataSource> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource19"> <Columns> <asp:BoundField DataField="username" HeaderText="Content Manager" SortExpression="username" /> </Columns> </asp:GridView> <ej:Grid ID="Grid1" runat='server'></ej:Grid>
You can try DataList
and set its RepeatDirection to Horizontal
.
<form id="form1" runat="server"> <div style="float: left"> <asp:Label runat="server">Content Manager: </asp:Label> </div> <div style="float: left"> <asp:DataList ID="DataList1" RepeatDirection="Horizontal" RepeatLayout="Table" RepeatColumns="0" runat="server"> <ItemTemplate> <%# Eval("UserName") %> </ItemTemplate> </asp:DataList> </div> </form>