-
Oct 3rd, 2013, 02:48 AM
#1
Thread Starter
Frenzied Member
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
-
Oct 3rd, 2013, 04:24 PM
#2
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>  
<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>
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Oct 4th, 2013, 01:21 AM
#3
Thread Starter
Frenzied Member
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)
-
Oct 4th, 2013, 01:34 AM
#4
Thread Starter
Frenzied Member
Re: Table DetailsView Columns
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|