locked
Layout for ListView using MySql RRS feed

  • Question

  • User-1166428634 posted

    Hi All,

                  I have connected my ListView to MySQL database. The data has been bound. But I can't give the proper layout to it through ItemTemplate. Can anyone knows how to create own layout inside a ListView using MySQL?

    regards

    Sunday, July 10, 2011 8:07 AM

Answers

  • User-843484705 posted

    you can use like

    <table cellspacing="0" cellpadding="0" frame="box" style="border-collapse: collapse;">
     <tbody>
      
    <atlas:ListView ID="listEmails" runat="server" ItemTemplateControlID="itemTemplate" CssClass="list" ItemCssClass="row"AlternatingItemCssClass="altrow">
    <LayoutTemplate>
     
    <tr id="itemTemplate" runat="server">
      
    <td id="itemTemplateColumn" runat="server">
      
    <atlas:Label ID="lblAddress" runat="server">
       
    <Bindings>
        
    <atlas:Binding DataPath="Address" Property="text" />
       
    </Bindings>
      </atlas:Label>
     </td>
     
    <td>
     
    ...
     
    </td>
    </tr>
    </LayoutTemplate>
    </atlas:ListView>
    </tbody>
    </table>

    http://forums.asp.net/t/940314.aspx/1

    http://www.shotdev.com/aspnet/aspnet-vbnet-listview/aspnet-vbnet-listview-mysql-database-mysql-data-mysqlclient/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, July 10, 2011 8:22 AM

All replies

  • User-843484705 posted

    you can use like

    <table cellspacing="0" cellpadding="0" frame="box" style="border-collapse: collapse;">
     <tbody>
      
    <atlas:ListView ID="listEmails" runat="server" ItemTemplateControlID="itemTemplate" CssClass="list" ItemCssClass="row"AlternatingItemCssClass="altrow">
    <LayoutTemplate>
     
    <tr id="itemTemplate" runat="server">
      
    <td id="itemTemplateColumn" runat="server">
      
    <atlas:Label ID="lblAddress" runat="server">
       
    <Bindings>
        
    <atlas:Binding DataPath="Address" Property="text" />
       
    </Bindings>
      </atlas:Label>
     </td>
     
    <td>
     
    ...
     
    </td>
    </tr>
    </LayoutTemplate>
    </atlas:ListView>
    </tbody>
    </table>

    http://forums.asp.net/t/940314.aspx/1

    http://www.shotdev.com/aspnet/aspnet-vbnet-listview/aspnet-vbnet-listview-mysql-database-mysql-data-mysqlclient/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, July 10, 2011 8:22 AM
  • User-1166428634 posted

    Thanks for reply Prince,

                                       Can I use "GroupItemCount" property for ListView for dipslaying only 3 items per row ? Is it same thing which we apply for SQLServer or Ms-Access?

    ex:

    <asp:ListView ID="ListView1" runat="server" DataSourceID="srcProductInfo" 
        EnableModelValidation="True" GroupItemCount="3">
     

     
    Sunday, July 10, 2011 8:31 AM
  • User-1166428634 posted

    Yes!! it is working now.... Whatever output I was expecting now it is showing to me...

    Only 1 problem is that through code it is unable to Allow to paging option. It is saying that for Paging option have to add "DataSourceId." Hmmmm... but will try on it....

    Thanks for the help.

     

    Sunday, July 10, 2011 9:06 AM