Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Display an underscore before the data in a column

Reply
Thread Tools

Display an underscore before the data in a column

 
 
Antonio
Guest
Posts: n/a
 
      11-04-2005
I have a datagrid which pulls from a stored procedure. For the purpose
of this display issue, we need to prepend a bound column with a
underscore "_" We don't want to change the stored procedure. can I do
this in the property builder for the datagrid?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?bmV0ZHVkZQ==?=
Guest
Posts: n/a
 
      11-04-2005
this should take care of the underscore
<asp:BoundColumn DataField="fieldname"
DataFormatString="_{0}"></asp:BoundColumn>


"Antonio" wrote:

> I have a datagrid which pulls from a stored procedure. For the purpose
> of this display issue, we need to prepend a bound column with a
> underscore "_" We don't want to change the stored procedure. can I do
> this in the property builder for the datagrid?
>
>

 
Reply With Quote
 
 
 
 
tdavisjr
Guest
Posts: n/a
 
      11-04-2005
You need to handle the Item_Databound Event for the datagrid. You will
be passed an EventArgs parameter that has an Item property that you can
cast to a DatagridItem object. From the DatagridItem you can reach
into its Cells property and pre-pend the "_" before the item in the
cell. You can get into the cells by doing something like this:

DataGridItem item = e.Item

item.Cells[2] <--------- represents a cell in the 3rd Column


This should give you a start.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sed/awk/perl: How to replace all spaces each with an underscore thatoccur before a specific string ? bolega Python 6 08-23-2009 12:45 AM
What is the purpose of the underscore before parenthesis? Mark Hobley C Programming 17 02-28-2009 05:21 PM
Can Not Display Underscore Character scott ASP General 2 01-29-2007 09:34 AM
Activa or not activate a button column depending if another data column has data or not carlos perez ASP .Net 0 06-08-2004 02:16 PM
string manipulation - seperate everyting before the underscore and after jason ASP General 6 08-12-2003 10:58 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57