Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

GridControl question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sheldon Glickler - 03 Sep 2007 03:35 GMT
I am progressing rapidly olong my learning curve and now have a question
about GridView. With the control, I now pull back data and have as part of
my spec:

<asp:boundfield DataField="propertyStreet" HeaderText="propertyStreet"
SortExpression="propertyStreet"></asp:boundfield>

<asp:boundfield DataField="propertyCity" HeaderText="propertyCity"
SortExpression="propertyCity"></asp:boundfield>

<asp:boundfield DataField="propertyState" HeaderText="propertyState"
SortExpression="propertyState"></asp:boundfield>

<asp:boundfield DataField="propertyZip" HeaderText="propertyZip"
SortExpression="propertyZip"></asp:boundfield>

Of course, this in four columns.  I would like to have the table have all
these data in one column called Address where the data would appear as:

propertyStreet<br>propertyCity, propertyState propertyZip

In other words the address on one line and the city comma space state space
zip on the next line.

How do I do this?

Shelly
Muhammad Naveed Yaseen - 03 Sep 2007 06:46 GMT
Use TemplateField
Shelly - 03 Sep 2007 13:11 GMT
> Use TemplateField

Could you point me to a good example to do what I want?  I searched the web
for TemplateView and didn't find anything.

Shelly
Muhammad Naveed Yaseen - 03 Sep 2007 15:39 GMT
<asp:GridView runat="server" ID="GridView1">
           <Columns>
               <asp:TemplateField HeaderText="Address">
                   <ItemTemplate>
                       <%# Eval("propertyStreet") %><br />
                       <%# Eval("propertyCity") %>, <%#
Eval("propertyState") %> <%# Eval("propertyZip") %>
                   </ItemTemplate>
                   <EditItemTemplate><%-- Include this
EditItemTemplate only if editing is required --%>
                       <asp:TextBox runat="server" ID="txtStreet"
Text='<%# Bind("propertyStreet") %>' /><br />
                       <asp:TextBox runat="server" ID="txtCity"
Text='<%# Bind("propertyCity") %>' />, <asp:TextBox runat="server"
ID="txtState" Text='<%# Bind("propertyState") %>' /> <asp:TextBox
runat="server" ID="txtZip" Text='<%# Bind("propertyZip") %>' />
                   </EditItemTemplate>
               </asp:TemplateField>
           </Columns>
       </asp:GridView>
Shelly - 03 Sep 2007 16:19 GMT
Thankyou so very much!

Shelly

>        <asp:GridView runat="server" ID="GridView1">
>            <Columns>
[quoted text clipped - 16 lines]
>            </Columns>
>        </asp:GridView>

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.