473,387 Members | 1,619 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.

Data Binding and Formatting Problem

Hello developers,

I bind my TextBox control specyfying a format stored in my application
global ApplicationContext object - it has a static string CurrencyFormat
property.

The problem - this works fine:

Text='<%# Eval("Price", ApplicationContext.CurrencyFormat) %>'

but this does not:

Text='<%# Bind("Price", ApplicationContext.CurrencyFormat) %>'
(Parser Error Message: A call to Bind was not well formatted)

Could anyone suggest a solution?
The objective: store format strings globally.

Thank you for any hints.

Thomas Jastrzebski
Jun 27 '08 #1
6 4566
Hi Tomasz,

Regarding on the Databinding expression issue you mentioned, I've performed
some tests and did encounter the behavior you mentioned. I've checked the
document, though the formatting of "Bind" is not definitely documented, it
mentioned that Bind doesn't provide the exact same set of databound
functionality like Eval. For example, Eval support complex hierarchy class
object databound while Bind not. The NumberFomatInfo should also be
limited by the Bind expression. I'll help you forward the problem to some
other ASP.NET engineers to see whether they have any further ideas on this.
You can also submit the problem to our connect site:

http://connect.microsoft.com/feedbac...spx?SiteID=210

So far, as a workaround, you may need to use Eval instead of Bind for the
display formatting. And manually set the parameter for editing/updating.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: "Tomasz J" <oe****@nospam.nospam>
Subject: Data Binding and Formatting Problem
Date: Thu, 17 Apr 2008 00:23:31 +0200
>
Hello developers,

I bind my TextBox control specyfying a format stored in my application
global ApplicationContext object - it has a static string CurrencyFormat
property.

The problem - this works fine:

Text='<%# Eval("Price", ApplicationContext.CurrencyFormat) %>'

but this does not:

Text='<%# Bind("Price", ApplicationContext.CurrencyFormat) %>'
(Parser Error Message: A call to Bind was not well formatted)

Could anyone suggest a solution?
The objective: store format strings globally.

Thank you for any hints.

Thomas Jastrzebski
Jun 27 '08 #2
This issue has been described as item 338632
https://connect.microsoft.com/Visual...dbackID=338632

Thanks,

Thomas Jastrzebski

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:YP***************@TK2MSFTNGHUB02.phx.gbl...
Hi Tomasz,

Regarding on the Databinding expression issue you mentioned, I've
performed
some tests and did encounter the behavior you mentioned. I've checked the
document, though the formatting of "Bind" is not definitely documented, it
mentioned that Bind doesn't provide the exact same set of databound
functionality like Eval. For example, Eval support complex hierarchy
class
object databound while Bind not. The NumberFomatInfo should also be
limited by the Bind expression. I'll help you forward the problem to some
other ASP.NET engineers to see whether they have any further ideas on
this.
You can also submit the problem to our connect site:

http://connect.microsoft.com/feedbac...spx?SiteID=210

So far, as a workaround, you may need to use Eval instead of Bind for the
display formatting. And manually set the parameter for editing/updating.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
>>From: "Tomasz J" <oe****@nospam.nospam>
Subject: Data Binding and Formatting Problem
Date: Thu, 17 Apr 2008 00:23:31 +0200
>>
Hello developers,

I bind my TextBox control specyfying a format stored in my application
global ApplicationContext object - it has a static string CurrencyFormat
property.

The problem - this works fine:

Text='<%# Eval("Price", ApplicationContext.CurrencyFormat) %>'

but this does not:

Text='<%# Bind("Price", ApplicationContext.CurrencyFormat) %>'
(Parser Error Message: A call to Bind was not well formatted)

Could anyone suggest a solution?
The objective: store format strings globally.

Thank you for any hints.

Thomas Jastrzebski

Jun 27 '08 #3
Hi Tomasz,

Thanks for infoming me this. I've forward this issue to some other ASP.NET
engineers (also include the connect report link). I'll update you if I get
any new information.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Tomasz J" <oe****@nospam.nospam>
References: <##**************@TK2MSFTNGP05.phx.gbl>
<YP***************@TK2MSFTNGHUB02.phx.gbl>
>Subject: Re: Data Binding and Formatting Problem
Date: Thu, 17 Apr 2008 11:39:04 +0200
>This issue has been described as item 338632
https://connect.microsoft.com/Visual...ack.aspx?Feedb
ackID=338632
>
Thanks,

Thomas Jastrzebski

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:YP***************@TK2MSFTNGHUB02.phx.gbl.. .
>Hi Tomasz,

Regarding on the Databinding expression issue you mentioned, I've
performed
some tests and did encounter the behavior you mentioned. I've checked
the
>document, though the formatting of "Bind" is not definitely documented,
it
>mentioned that Bind doesn't provide the exact same set of databound
functionality like Eval. For example, Eval support complex hierarchy
class
object databound while Bind not. The NumberFomatInfo should also be
limited by the Bind expression. I'll help you forward the problem to
some
>other ASP.NET engineers to see whether they have any further ideas on
this.
You can also submit the problem to our connect site:

http://connect.microsoft.com/feedbac...spx?SiteID=210

So far, as a workaround, you may need to use Eval instead of Bind for the
display formatting. And manually set the parameter for editing/updating.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
Please
>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
>ications.

================================================= =
This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
>>>From: "Tomasz J" <oe****@nospam.nospam>
Subject: Data Binding and Formatting Problem
Date: Thu, 17 Apr 2008 00:23:31 +0200
>>>
Hello developers,

I bind my TextBox control specyfying a format stored in my application
global ApplicationContext object - it has a static string CurrencyFormat
property.

The problem - this works fine:

Text='<%# Eval("Price", ApplicationContext.CurrencyFormat) %>'

but this does not:

Text='<%# Bind("Price", ApplicationContext.CurrencyFormat) %>'
(Parser Error Message: A call to Bind was not well formatted)

Could anyone suggest a solution?
The objective: store format strings globally.

Thank you for any hints.

Thomas Jastrzebski


Jun 27 '08 #4
Hi Tomasz,

After some further consulting, I've got some information on the Bind
expression from some ASP.NET dev engineer. They told me that this is an
by-design behavior. The Bind() statement doesn't allow specifying any
format info. It just allows a a field name and an optional format string.

And one of the dev engineers has published a blog entry describe how bind
expression works:

http://weblogs.asp.net/leftslipper/a...net-databindin
g-deals-with-eval-and-bind-statements.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>Content-Transfer-Encoding: 7bit
From: st*****@online.microsoft.com (Steven Cheng [MSFT])
Organization: Microsoft
Date: Fri, 18 Apr 2008 06:56:24 GMT
Subject: Re: Data Binding and Formatting Problem
>
Hi Tomasz,

Thanks for infoming me this. I've forward this issue to some other
ASP.NET
>engineers (also include the connect report link). I'll update you if I get
any new information.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ault.aspx#noti
f
>ications.

================================================= =
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>>From: "Tomasz J" <oe****@nospam.nospam>
References: <##**************@TK2MSFTNGP05.phx.gbl>
<YP***************@TK2MSFTNGHUB02.phx.gbl>
>>Subject: Re: Data Binding and Formatting Problem
Date: Thu, 17 Apr 2008 11:39:04 +0200
>>This issue has been described as item 338632
https://connect.microsoft.com/Visual...back.aspx?Feed
b
>ackID=338632
>>
Thanks,

Thomas Jastrzebski

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:YP***************@TK2MSFTNGHUB02.phx.gbl. ..
>>Hi Tomasz,

Regarding on the Databinding expression issue you mentioned, I've
performed
some tests and did encounter the behavior you mentioned. I've checked
the
>>document, though the formatting of "Bind" is not definitely documented,
it
>>mentioned that Bind doesn't provide the exact same set of databound
functionality like Eval. For example, Eval support complex hierarchy
class
object databound while Bind not. The NumberFomatInfo should also be
limited by the Bind expression. I'll help you forward the problem to
some
>>other ASP.NET engineers to see whether they have any further ideas on
this.
You can also submit the problem to our connect site:

http://connect.microsoft.com/feedbac...spx?SiteID=210

So far, as a workaround, you may need to use Eval instead of Bind for
the
>>display formatting. And manually set the parameter for editing/updating.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments
and
>>suggestions about how we can improve the support we provide to you.
Please
>>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================ ==
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ault.aspx#noti
f
>>ications.

================================================ ==
This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
From: "Tomasz J" <oe****@nospam.nospam>
Subject: Data Binding and Formatting Problem
Date: Thu, 17 Apr 2008 00:23:31 +0200
Hello developers,

I bind my TextBox control specyfying a format stored in my application
global ApplicationContext object - it has a static string CurrencyFormat
property.

The problem - this works fine:

Text='<%# Eval("Price", ApplicationContext.CurrencyFormat) %>'

but this does not:

Text='<%# Bind("Price", ApplicationContext.CurrencyFormat) %>'
(Parser Error Message: A call to Bind was not well formatted)

Could anyone suggest a solution?
The objective: store format strings globally.

Thank you for any hints.

Thomas Jastrzebski




Jun 27 '08 #5
Thanks.

I know Bind does not support format info. I never tried to use it that way.
The point is that it does not also support format string as expressions. It
supports constant strings - predefined formats only.

Thomas
"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:L3**************@TK2MSFTNGHUB02.phx.gbl...
Hi Tomasz,

After some further consulting, I've got some information on the Bind
expression from some ASP.NET dev engineer. They told me that this is an
by-design behavior. The Bind() statement doesn't allow specifying any
format info. It just allows a a field name and an optional format string.

And one of the dev engineers has published a blog entry describe how bind
expression works:

http://weblogs.asp.net/leftslipper/a...net-databindin
g-deals-with-eval-and-bind-statements.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
>>Content-Transfer-Encoding: 7bit
From: st*****@online.microsoft.com (Steven Cheng [MSFT])
Organization: Microsoft
Date: Fri, 18 Apr 2008 06:56:24 GMT
Subject: Re: Data Binding and Formatting Problem
>>
Hi Tomasz,

Thanks for infoming me this. I've forward this issue to some other
ASP.NET
>>engineers (also include the connect report link). I'll update you if I get
any new information.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================ ==
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ault.aspx#noti
f
>>ications.

================================================ ==
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
>>>From: "Tomasz J" <oe****@nospam.nospam>
References: <##**************@TK2MSFTNGP05.phx.gbl>
<YP***************@TK2MSFTNGHUB02.phx.gbl>
>>>Subject: Re: Data Binding and Formatting Problem
Date: Thu, 17 Apr 2008 11:39:04 +0200
>>>This issue has been described as item 338632
https://connect.microsoft.com/Visual...back.aspx?Feed
b
>>ackID=338632
>>>
Thanks,

Thomas Jastrzebski

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:YP***************@TK2MSFTNGHUB02.phx.gbl.. .
Hi Tomasz,

Regarding on the Databinding expression issue you mentioned, I've
performed
some tests and did encounter the behavior you mentioned. I've checked
the
>>>document, though the formatting of "Bind" is not definitely documented,
it
>>>mentioned that Bind doesn't provide the exact same set of databound
functionality like Eval. For example, Eval support complex hierarchy
class
object databound while Bind not. The NumberFomatInfo should also be
limited by the Bind expression. I'll help you forward the problem to
some
>>>other ASP.NET engineers to see whether they have any further ideas on
this.
You can also submit the problem to our connect site:

http://connect.microsoft.com/feedbac...spx?SiteID=210

So far, as a workaround, you may need to use Eval instead of Bind for
the
>>>display formatting. And manually set the parameter for
editing/updating.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments
and
>>>suggestions about how we can improve the support we provide to you.
Please
>>>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

=============================================== ===
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ault.aspx#noti
f
>>>ications.

=============================================== ===
This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
>From: "Tomasz J" <oe****@nospam.nospam>
>Subject: Data Binding and Formatting Problem
>Date: Thu, 17 Apr 2008 00:23:31 +0200

>
>Hello developers,
>
>I bind my TextBox control specyfying a format stored in my application
>global ApplicationContext object - it has a static string
>CurrencyFormat
>property.
>
>The problem - this works fine:
>
>Text='<%# Eval("Price", ApplicationContext.CurrencyFormat) %>'
>
>but this does not:
>
>Text='<%# Bind("Price", ApplicationContext.CurrencyFormat) %>'
>(Parser Error Message: A call to Bind was not well formatted)
>
>Could anyone suggest a solution?
>The objective: store format strings globally.
>
>Thank you for any hints.
>
>Thomas Jastrzebski
>
>
>



Jun 27 '08 #6
Hi Tomasz,

Yes, only a simple constant format string is allowed in the Bind
expression. Actually, as Elion mentioned in his blog entry, Bind expression
will not allow any format expression that is generated by additional
function call or operates.

However, I think it's a good suggestion that the Bind expression be
improved to support more formatting options. You're welcome to post your
comments to our connect site:

#Visual Studio and .NET Framework - English
http://connect.microsoft.com/feedbac...spx?SiteID=210

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Tomasz J" <oe****@nospam.nospam>
Subject: Re: Data Binding and Formatting Problem
Date: Wed, 23 Apr 2008 11:33:55 +0200
>Thanks.

I know Bind does not support format info. I never tried to use it that way.
The point is that it does not also support format string as expressions.
It
>supports constant strings - predefined formats only.

Thomas
"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:L3**************@TK2MSFTNGHUB02.phx.gbl...
>Hi Tomasz,

After some further consulting, I've got some information on the Bind
expression from some ASP.NET dev engineer. They told me that this is an
by-design behavior. The Bind() statement doesn't allow specifying any
format info. It just allows a a field name and an optional format string.

And one of the dev engineers has published a blog entry describe how bind
expression works:

http://weblogs.asp.net/leftslipper/a...net-databindin
>g-deals-with-eval-and-bind-statements.aspx

Sincerely,

Steven Cheng

Jun 27 '08 #7

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

Similar topics

1
by: Saix News | last post by:
hi, i have a dataset and a number of controls that are bound to it. some of the records being displayed are numerical and are bound to text boxes. they display without a problem but i would...
3
by: Richard Urwin | last post by:
I'm using C# and having problems getting the 'Parse' EventHandler of my binding object to be called. Interestingly, the 'Format' method is always called however. A code snippet: (rdDocument is a...
2
by: | last post by:
I've defined an ObjectDataSource against a dataset, and I can bind the ObjectDataSource's members to data controls. I'm wondering how to take the values in an ObjectDataSource and...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
1
by: msmcg | last post by:
I need to format the data in some textboxes using the Binding method with custom Currency and ShortDate format and parse handlers. Here is the code that I am using. I call it on the form load...
1
by: Parveen | last post by:
I noticed that any formatting of the grid before data binding is lost after the grid is bound to a data table in the dataset. Is it possible to format the appearance of the data that shows up in...
10
by: Fares Eidi | last post by:
I am a VB6 intermediate programmer just starting out using VB.net and would like to ask what I'd be missing out on if I just use time saving techniques like data binding, data adapter wizards etc...
7
by: Chris | last post by:
Where can I find a fairly comprehensive list of the formatting codes used when data binding. e.g. <%# Bind("Debit", "{0:C}") %>. Specifically formatting a number to 2 decimal places. Regards, Chris.
1
by: =?Utf-8?B?Q2hyaXMgRy4=?= | last post by:
Hey all, I'm coming from the ColdFusion world and am pretty new to .Net2. My issue is, I've got a page where the content (with html formatting included) is stored in a db table field. In MS...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
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.