Frage

I have a News table in DB that contain (id,title,body) fields.
Now I want to display these news into news.aspx page.
I can use grid view to show them, but i want to change the grid view's appearance,like below image.how can do it?or any idea for this.
enter image description here

thanks in advance.

War es hilfreich?

Lösung

You can use Listview to implement as follows:

 <asp:ListView ID="lvNewsContent" runat="server">
     <LayoutTemplate>
      <div style="border:1px solid black; border-top:2px solid black; text-align:center; width:200px; height:60px;">
        <%#Eval("NewsTitle") %>
      </div>
      <div style="border:1px solid black; width:200px; text-align:center; display:block;">
          <div style="margin-right:auto; margin-left:auto; text-align:center;">
            <%#Eval("NewsDetail") %>
        </div>
        <div style="width:60px; height:20px; float:right; margin-right:20px;">
            More info
        </div>
    </div>
 </LayoutTemplate>
 </asp:ListView>

After that set the Data source of Listview and then bind it.

Andere Tipps

DataGridView control is capable of displaying images for customize appearance to indicate the status of a grid row by using a few properties within the KetticGridView.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top