Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Repeater

    Why is the repeater displaying only the first 14 items, when my table has 27
    items.


    <%@ Page language="c#" AutoEventWireup="true" %>
    <%@ Register TagPrefix="cc1" Namespace="cnlib" Assembly="cnlib" %>
    <%@Import Namespace="System.Data" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>csharp</title>
    <meta name="keywords" content="c#, .net, asp.net, ado.net, eric
    gunnerson">
    <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema"
    content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body background="images/backg.gif">
    <form id="csharp" method="post" runat="server">
    <TABLE id="Table1" cellSpacing="1" cellPadding="10" border="0">
    <TR>
    <TD style="BORDER-TOP-WIDTH: 1px; BORDER-RIGHT: #800000 1px solid;
    BORDER-BOTTOM-WIDTH: 1px; BORDER-LEFT: #800000 1px solid"
    bgColor="#d3c6ad" vAlign="top">
    <cc1:SideBar id="SideBar1" runat="server"></cc1:SideBar></TD>
    <TD vAlign="top">
    <TABLE id="Table2" cellSpacing="1" cellPadding="1" border="0">
    <TR>
    <TD vAlign="middle" align="center">
    <H2>C#</H2>
    </TD>
    </TR>
    <TR>
    <TD>
    <table border="0" width="100%" cellpadding="10">
    <tr>
    <td width="100%">
    <asp:Repeater id="Repeater1" runat="server">
    <ItemTemplate>
    <table border="0" cellpadding="10" cellspacing="2">
    <tr>
    <td valign="top">
    <table border="0">
    <tr><td align="center">
    <img height="140" hspace="10" src="covers/
    <%# ((DataRowView)Container.DataItem)["ISBN"] %>
    Bill Burris Guest

  2. Similar Questions and Discussions

    1. Repeater woes
      Alright, using a repeater to grab some data out. I can't get this to work properly though. (ever other item pulls out) This works: <mx:Repeater...
    2. Repeater + RadioButtonList
      Hello I need some help... I have a repeater; its source is a dataview based on a datatable of a dataset. The aspx page creates a...
    3. Repeater Control
      I am a novice programmer. I want to use a repeater to display a button for every item in the cache. Each button should have the key of the cache...
    4. Help with Dynamic repeater...
      Hi I have a page that displays business listings. I have a repeater with dynamic text and in the 4th column I have an email and website link. Both...
    5. Repeater Sorting
      Hi everybody, Could you give a sample to implement column sorting with a ASP.NET repeater control. Regards, Srini
  3. #2

    Default Repeater

    is it possible to get the repeater control to display items across a page

    i realise that i can use table cells to get it to repeat across but that would just repeat in one row on and on
    <table><tr><itemtemplate><td>index=index+

    </td


    if index=mod(count of items rendered / 3.... etc et

    </tr><tr

    end i

    </itemtemplate></tr

    the above would be the old way of doing it with recordset

    looking to end up with a structure like this

    item1 item2 item3
    item4 item5 item6
    item7 item8 item9

    so i know its now got to be completed by using the code behind

    Private Sub Repeater2_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles Repeater2.ItemDataBoun

    If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem The


    somthing in here that knows the count of rows already rendered and is able to output a string to the end of the html for every third ro

    end i

    ........

    is this possible?

    or can you movenext in a repeater control on the html and have a template that does three rows before moving on to the next row (ie like old recordsets)?


    Galadriel Guest

  4. #3

    Default RE: Repeater

    oops think i've just solved the proble

    a literal control placed at the right point in the repeater control

    by using this in the databind i can place content in the literal every third row

    if mod(e.Item.ItemIndex/3 = 0 then

    find the literal control and set its text to </tr><tr>

    else

    set it to ""

    end if

    i think
    Galadriel Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139