문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top