?
Solved

Applying formatting to bound datagrid column values

Posted on 2005-03-01
1
Medium Priority
?
770 Views
Last Modified: 2008-01-09
I have a datagrid that is bound to a SQL data source.  The grid displays just fine in the browser.  However, I'm pulling from a DB2 database from an AS/400, and all the data values are capitalized.  Is there a way to format a bound column as mixed case/propercase?  Example:  'Hello World' instead of 'HELLO WORLD'

A couple of ideas I thought of without luck:
1. Format on the database side - unfortunately, DB2 doesn't appear to have a "ProperCase"-type function.
2. Use a function to format the column value - I created a function to convert a string to "proper case", however, I don't know how to use it in the datagrid definition.
3. Use the 'DataFormatString' parameter on the column - I don't think this is capable of doing what I want - looks like it's mainly for dates, numbers, and currency.

Ideas?  Here is a snippet of my DataGrid def:

<ASP:DataGrid id="dgResults" runat="server">
   <Columns>
       <asp:BoundColumn HeaderText="Key" DataField="pmkey" DataFormatString="{0:##-#-####-##}" />
       <asp:BoundColumn HeaderText="First Name" DataField="pmfirst" />
       <asp:BoundColumn HeaderText="Last Name" DataField="pmlast" />
       <asp:BoundColumn HeaderText="Address" DataField="pmaddr" />
       <asp:ButtonColumn HeaderText="Photo" />
   </Columns>
</ASP:DataGrid>

I'd like the 'pmfirst' and 'pmlast' column values to be displayed in "proper"/mixed case.
0
Comment
Question by:hendridm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 10

Accepted Solution

by:
NetDeveloper earned 1275 total points
ID: 13432911
Hi, I advice you to convert your BoundColumn to a template column...this way you can apply the format in a easy way
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question