Results 1 to 4 of 4

Thread: Table DetailsView Columns

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2009
    Location
    Los Angeles
    Posts
    1,335

    Table DetailsView Columns

    Hi guys

    I am trying to build a program that will have 3 DetailsView side by side but I want to have an empty textbox next to each field

    I cant seem to be able to get a column in between and I don't see a way to add a column to the detailsView only a field

    Here is what I want it to look like

    DetailsView:

    Field Name Value I want to add
    Color Red MyTextBox

    Anyone have any ideas, perhaps there is a better control? or way to set this up

    My program is reading a textfile from the users computer using text field parser and creating a data table then I am using the details view to display that data vertically rather then horizontally
    So instead of

    Adress City state

    I can go

    Address
    City
    State

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,605

    Re: Table DetailsView Columns

    If i understand correctly then you need templatefileds. Here is an example with a label and a textbox next to each other.
    Code:
     <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="350px" >
            <Fields>
            <asp:TemplateField>
            <HeaderTemplate> 
                <asp:Label ID="Label1" runat="server" Text="head"></asp:Label></HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("ifyouwanttoevalsomething") %>'></asp:Label> &nbsp 
                    <asp:TextBox ID="TextBox1" runat="server" style="color:Red"></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>
            </Fields>
            </asp:DetailsView>
    After that is up to you.If you want to have labels in separate rows you can do:
    Code:
     <asp:TemplateField>
            <HeaderTemplate> 
                <asp:Label ID="Label1" runat="server" Text="head"></asp:Label></HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("ifyouwanttoevalsomething") %>'></asp:Label> <br />
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("ifyouwanttoevalsomethingelse") %>'></asp:Label> <br />
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("ifyouwanttoevalsomethingfinal") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2009
    Location
    Los Angeles
    Posts
    1,335

    Re: Table DetailsView Columns

    Thanks but that not is what I am trying to do I don't need another field(row) I need another column

    A DetailsView

    Column0 abc
    Column1 abc
    Column3 abc

    I need or want

    Column0 abc def
    Column1 abc def
    Column2 abc def


    either add the column to details view which it doesn't seem can be done, use another control or manually add column/table between my DetailsView (which I cant seem to do either)

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2009
    Location
    Los Angeles
    Posts
    1,335

    Re: Table DetailsView Columns

    Name:  BPOScreenshot.jpg
Views: 85
Size:  109.3 KB

    like this

Posting Permissions

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



Click Here to Expand Forum to Full Width