473,849 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP databinding DataFormatstrin g boolean

Jac
Hey,

I do a databinding and use the following
<asp:datagrid .....>
....
<asp:BoundColum n DataField="f1" HeaderText... DataFormatStrin g="{0:d}">..

This works fine for a date.

Now, I have also another column but the bounded field is of the type boolean, when I use the binding of that column without DataFormatstrin g I receive always a True or a False in my datagrid.
Can I use DataFormatStrin g to format as follows : when value of the bounded field = True the client has too see "OK", when the value is false the client has too see "Not OK".

tkx,
Nic

Nov 16 '05 #1
1 7348
Hi,

Check this one out: http://www.datagridgirl.com/faq.aspx (first question in
the list)

"Jac" <Ja*@discussion s.microsoft.com > wrote in message
news:BA******** *************** ***********@mic rosoft.com...
Hey,

I do a databinding and use the following
<asp:datagrid .....>
....
<asp:BoundColum n DataField="f1" HeaderText... DataFormatStrin g="{0:d}">..

This works fine for a date.

Now, I have also another column but the bounded field is of the type
boolean, when I use the binding of that column without DataFormatstrin g I
receive always a True or a False in my datagrid.
Can I use DataFormatStrin g to format as follows : when value of the bounded
field = True the client has too see "OK", when the value is false the client
has too see "Not OK".

tkx,
Nic
Nov 16 '05 #2

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

Similar topics

1
3812
by: Sam Collett | last post by:
I have the following that lists *.doc files in a folder. How do I list other types as well (I have tried using dirInfo.GetFiles("*.doc;*.rtf;*.pdf") but it does not work)? <%@ Import Namespace="System.IO" %> <%@ Import Namespace="System.Collections" %> <script language="VB" runat="server"> #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer.
1
2612
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 for some reason they have no effect in the following grid. The two that don't work are DataFormatString="{0:dd-MM-yyyy}" and DataFormatString="{0:C}". The code is below. Anyone got any ideas what the problem is?
9
2835
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" DataFormatString="{0:MMM-dd-yyyy}" ReadOnly="True" HeaderText="Final Apprvl Date" ItemStyle-Wrap="false"></asp:BoundColumn>
1
1403
by: Nathan Sokalski | last post by:
When I run my application, which uses databinding in a DataList, I recieve the following error: Server Error in '/' Application. -------------------------------------------------------------------------------- Public member 'title' on type 'DataRowView' not found. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it...
1
2358
by: Tom | last post by:
Hi there I have a little problem here, wich i think is quite strange... I have a dataset, filled from my SQL database. In it are some boolean fields (or bit as SQL server calls them) Now, on my winform i have placed a checkbox wich i want to correspond with the value of this boolean field. I've tried databinding to the Checked and Checkstate
3
7781
by: Alec MacLean | last post by:
Hi everyone, I have a ComboBox that when changed, calls a method to change the content of a ListBox. I'm also using the Listbox's SelectedIndexChanged event to change other control values on the form. (It's a Company -> People -> Personal Data relationship) When I bind my datasource to the ListBox, I find that the
9
2327
by: Nathan Sokalski | last post by:
I have a very simple UserControl which contains an Image and a Label, which I use to display an image with a caption. I am using this control inside a DataList, setting the two Public variables using attributes in the *.aspx page. Everything displays great for the initial load, but whenever I try to add or delete an item (I have controls to do this on the page), it does not seem to be recieving any values for the public variables. Here is...
1
16265
by: Owen Blacker | last post by:
I've spent loads of time Googling to try to work this one out and I'm sure it's something obvious. I get an InvalidOperationException reading "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control" when I start my page. Unless I'm missing something obvious, this is *not* the same issue as the "2-way databinding cascading lists" issue in...
5
6526
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. this works great for a DataGrid control. however i'm upgrading this control to inherit from GridView. there seems to be a limitation of the gridview "Method not supported" when you try and set a DataFormatString on an AutoGeneratedField.
0
9738
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11005
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10665
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10723
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7070
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5735
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4139
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.