473,387 Members | 1,420 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,387 software developers and data experts.

DataFormatString Help

I have a datagrid which is populated from an Excel file via an OLEDB
connection.

The data format in the Excel file for column A is text.

The data is either a single number - e.g. 1 or a number followed by a
letter - e.g. 7D

The cells that contain a number followed by a letter never get displayed in
my datagrid - They are empty. Single numbers are AOK.

I guess I need to work on a DataFormatString code to sort this, but have not
had much luck so far. Have tried {0:G} for general, which did not help.

Any advice will be appreciated.

Regards,
Simon.
Nov 19 '05 #1
2 1100
Just for kicks Simon, change your excel file so that the first couple rows
start with a letter before the number.

See if you have the same problem. I came across this before.

bill

"Simon Harris" <to***********@makes-you-fat.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have a datagrid which is populated from an Excel file via an OLEDB
connection.

The data format in the Excel file for column A is text.

The data is either a single number - e.g. 1 or a number followed by a
letter - e.g. 7D

The cells that contain a number followed by a letter never get displayed in my datagrid - They are empty. Single numbers are AOK.

I guess I need to work on a DataFormatString code to sort this, but have not had much luck so far. Have tried {0:G} for general, which did not help.

Any advice will be appreciated.

Regards,
Simon.

Nov 19 '05 #2
Hi Bill,

I actually ended up adding the data into the Excel file using formulas (e.g.
="7D") which worked. Thanks for pointing me in the right direction! :)

Simon.

"William F. Robertson, Jr." <th****@nameht.org> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Just for kicks Simon, change your excel file so that the first couple rows
start with a letter before the number.

See if you have the same problem. I came across this before.

bill

"Simon Harris" <to***********@makes-you-fat.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have a datagrid which is populated from an Excel file via an OLEDB
connection.

The data format in the Excel file for column A is text.

The data is either a single number - e.g. 1 or a number followed by a
letter - e.g. 7D

The cells that contain a number followed by a letter never get displayed

in
my datagrid - They are empty. Single numbers are AOK.

I guess I need to work on a DataFormatString code to sort this, but have

not
had much luck so far. Have tried {0:G} for general, which did not help.

Any advice will be appreciated.

Regards,
Simon.


Nov 19 '05 #3

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

Similar topics

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...
7
by: Tarren | last post by:
Hi: I am pulling duration out of my DB and it returns duration in seconds. For the display i would like to show it in time format with colon So duration of 221 I want it to display 03:41 ...
3
by: Gerhard Pretorius | last post by:
Since installing the VS.NET August CTP the DataFormatString of the BoundField in the Gridview does not work. Runtime v2.0.50727. <asp:BoundField DataField="Event_Date"...
2
by: Jon | last post by:
Hi All, I have a column in my GridView with DataFormatString="{0:dd/MM/YYYY HH:mm}" HtmlEncode="False" Still the date formats as 2005-11-08T20:48:03 Any ideas? I'm using latest full release...
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 ...
1
by: Hardy Wang | last post by:
Hi, I have a GridView control in my web form (ASP.NET 2.0) <asp:GridView ID="gvReport" runat="server" AllowSorting="True" AutoGenerateColumns="False" Width="100%"> <HeaderStyle...
2
by: yefei | last post by:
I want to display a BoundField "Price" in the format of currency in a GridView I set the DataFormatString="{0:C}" in my program However, it doesnot work. I try to add a '$'in from of the brace,...
2
by: Rob Roberts | last post by:
I have a GridView that is bound to a collection of DateTimes (i.e. - Collection<DateTime>). I have a BoundField in the GridView, and its DataField is set to the DateTime's Date property, and the...
4
by: Eamonn | last post by:
Hi I am running Microsoft Visual Studio 2005 Team Edition Version 8.0.50727.42. I am adding columns to a GridView at runtime. When I add a BoundField that will contain DateTime data I want to...
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:
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.