473,385 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

is it possible to programatically set the DataFormatString for a field in a datagrid?

I'm trying to change the following DataFormatString dynamically in my C#
code, depending on various criteria:

<asp:BoundField DataField="NUTR_VAL" DataFormatString="{0:00.0000}"
HeaderText="zzzzzz"

Works fine as a static definition, but can the same setting above be set
programatically? thanks -Fred
Nov 1 '06 #1
0 1050

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jac | last post by:
Hey, I do a databinding and use the following <asp:datagrid .....> .... <asp:BoundColumn DataField="f1" HeaderText... DataFormatString="{0:d}">.. This works fine for a date. Now, I have...
1
by: frank | last post by:
I am using the DataFormatString property on BoundColumn objects in a DataGrid, but they don't seem to work for some reason. I copied them straight from another DataGrid where they work fine, but...
0
by: aaapaul | last post by:
Is it possible to display the calendarweek and year of date-columum in a datagrid ? example: Datagrid now: ordernr date 12 31.12.2003 27 01.01.2004 wished Datagrid:
9
by: Roy | last post by:
Hey all, Ok, I have a boundcolumn in a datagrid which displays a smalldatetime field from a table. Behold: <asp:BoundColumn DataField="final_appvl_dt" SortExpression="final_appvl_dt"...
0
by: cntams | last post by:
Hi all, I have a Web Form and using BoundColumn to bind data to the datagrid. I have 2 fields that needs to be formatted. The first one is a DateTime field and the second one is the currency...
0
by: .Net Sports | last post by:
I'm trying to display a figure in my datagrid as a currency ($100.00), but I can't use DataFormatString inside templatecolumn, itemstyle, or itemtemplate (as they imply that no attribute named...
1
by: Randall Parker | last post by:
In ASP.Net v1.1 and C# suppose one has: protected System.Web.UI.WebControls.DataGrid MyGrid; In Page_Load I want to do the equivalent of: MyGrid.Columns.DataFormatString="{0:d}"; or ...
4
by: ThunderMusic | last post by:
Hi, I have a datagrid. In my datagrid I have a DataBoundColumn with the property DataFormatString set to "{0:F2}" so it should format the content of the cell to a floating number with 2 digits. It...
5
by: Tim Mackey | last post by:
hi, with a derived DataGrid control, i can override the CreateColumnSet method and scan into the DataGridColumns and set the DataFormatString, e.g. leave out the time part of a DateTime value. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.