Binding a multi-dimensional array to a repeater

Discussion in 'ASP .Net' started by De_Kabal, Nov 3, 2006.

  1. De_Kabal

    De_Kabal Guest

    I'm trying to bind a 12x16 array to a repeater to display the information in
    a table to have certain format. Right now all it does is display all the
    array elements on individual rows. Does anyone know how to display the data
    on just the 12 row?

    thanks;

    Here is my code:

    Binding:
    fismaRepeater.DataSource = PIIArrayTotals
    Page.DataBind()

    Repeater:
    <ItemTemplate>
    <tr>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    <td><%#Container.DataItem%> </td>
    </tr>
    </ItemTemplate>
     
    De_Kabal, Nov 3, 2006
    #1
    1. Advertising

  2. Introduce a property that returns exactly what you want and databind to this
    property rather than to the whole array.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]


    "De_Kabal" <u28637@uwe> wrote in message news:68bfbfe76826e@uwe...
    > I'm trying to bind a 12x16 array to a repeater to display the information
    > in
    > a table to have certain format. Right now all it does is display all the
    > array elements on individual rows. Does anyone know how to display the
    > data
    > on just the 12 row?
    >
    > thanks;
    >
    > Here is my code:
    >
    > Binding:
    > fismaRepeater.DataSource = PIIArrayTotals
    > Page.DataBind()
    >
    > Repeater:
    > <ItemTemplate>
    > <tr>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > <td><%#Container.DataItem%> </td>
    > </tr>
    > </ItemTemplate>
    >
     
    Eliyahu Goldin, Nov 5, 2006
    #2
    1. Advertising

  3. How do you do that or point me where I can get the information? Still a newb
    at this.

    thanks

    Eliyahu Goldin wrote:
    >Introduce a property that returns exactly what you want and databind to this
    >property rather than to the whole array.
    >
    >> I'm trying to bind a 12x16 array to a repeater to display the information
    >> in

    >[quoted text clipped - 32 lines]
    >> </tr>
    >> </ItemTemplate>


    --
    Message posted via DotNetMonster.com
    http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net/200611/1
     
    De_Kabal via DotNetMonster.com, Nov 5, 2006
    #3
  4. Actually, after another look, I think it would be easier to make a runtime
    DataTable object of the array and databind to the DataTable. The DataTable
    will have exact format you need and the databinding will be trivial, like in
    any msdn example.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]


    "De_Kabal via DotNetMonster.com" <u28637@uwe> wrote in message
    news:68d6f68a92e50@uwe...
    > How do you do that or point me where I can get the information? Still a
    > newb
    > at this.
    >
    > thanks
    >
    > Eliyahu Goldin wrote:
    >>Introduce a property that returns exactly what you want and databind to
    >>this
    >>property rather than to the whole array.
    >>
    >>> I'm trying to bind a 12x16 array to a repeater to display the
    >>> information
    >>> in

    >>[quoted text clipped - 32 lines]
    >>> </tr>
    >>> </ItemTemplate>

    >
    > --
    > Message posted via DotNetMonster.com
    > http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net/200611/1
    >
     
    Eliyahu Goldin, Nov 5, 2006
    #4
  5. De_Kabal

    Mark Rae Guest

    "Eliyahu Goldin" <> wrote in
    message news:...

    > Actually, after another look, I think it would be easier to make a runtime
    > DataTable object of the array and databind to the DataTable. The DataTable
    > will have exact format you need and the databinding will be trivial, like
    > in any msdn example.


    Yes, absolutely!
     
    Mark Rae, Nov 5, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kk_oop
    Replies:
    1
    Views:
    2,166
  2. Replies:
    7
    Views:
    847
    Ryan Stewart
    Feb 20, 2005
  3. John Harrison
    Replies:
    2
    Views:
    717
    John Harrison
    Jul 14, 2003
  4. Venkat
    Replies:
    4
    Views:
    975
    Venkat
    Dec 5, 2003
  5. Wirianto Djunaidi
    Replies:
    2
    Views:
    203
    Wirianto Djunaidi
    Apr 29, 2008
Loading...

Share This Page