?
Solved

Applying formatting to bound datagrid column values

Posted on 2005-03-01
1
Medium Priority
?
773 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
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses
Course of the Month9 days, 3 hours left to enroll

621 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