473,385 Members | 1,983 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.

Databinding Expressions?

Is it possible to Databind to an expression? I have a collection of classes
and one of the properties returns a boolean value. I'm trying to databind
to the "inverse" of the boolean value as such

TextBox1.DataBindings.Add("ReadOnly",customers,"Is Active");

I need to bind this to the Inverse of IsActive (!IsActive) and not IsActive
itself ... it this possible?

Thanx
Chike, London
Jul 21 '05 #1
1 1478
Hi Chike,

I beleive it will be easier to introduce an additional property called
IsNotActive :-)
However, if this is out of the question, you can probably make good use of
the Binding class' Format and Parse events to carry out the inverstion on
the fly.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Chike J. Okor" <ch***@okor.co.uk> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Is it possible to Databind to an expression? I have a collection of classes and one of the properties returns a boolean value. I'm trying to databind
to the "inverse" of the boolean value as such

TextBox1.DataBindings.Add("ReadOnly",customers,"Is Active");

I need to bind this to the Inverse of IsActive (!IsActive) and not IsActive itself ... it this possible?

Thanx
Chike, London


Jul 21 '05 #2

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

Similar topics

1
by: Vik | last post by:
Concatenation operator & used in the databinding expressions for the datagrid template columns appears as '&amp;' in HTML. It causes an error when opening the pages. I have to replace '&amp;' by '&' each...
2
by: Jason Wright via .NET 247 | last post by:
Hiya, I've created a UserControl with some Custom properties and assigned databinding expressions to the properties in the aspx. Does anyone know why these expressions are not being evaluated? ...
4
by: dtblankenship | last post by:
Hello everyone, I know this question has been asked many times in the forums, and after spending a few days reading, I am still confused as to the answer. I have a ListBox (lstBox),...
4
by: Nathan Sokalski | last post by:
I have two databinding expressions (the first & last names from a DB) that I want to assign to the text property of a Label so that the result is LASTNAME,FIRSTNAME. At the moment, I have the...
6
by: Nathan Sokalski | last post by:
I am using a DataSet as the DataSource of a DataList in my code. The SQL used to get the data from the database begins with: SELECT...
2
by: Mr Newbie | last post by:
Ive got the basic idea behind DataBinding Expressions, but I have a couple of questions, Ok its four actually :) Q1.) It would appear that if you use Page.DataBind that all child controls and...
1
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. ...
4
by: sydney.luu | last post by:
Hi, I want to assign two data values in the CommandArgument property of the LinkButton object. This works CommandArgument='<%#DataBinder.Eval(Container.DataItem, "Arg1")%>' but this does...
0
by: dba123 | last post by:
In my GridView I have this: <Columns> <asp:TemplateField HeaderText="Title" SortExpression='<%#((Podcast)Container.DataItem).Title %>'> <ItemTemplate> <asp:Image ID="Image1"...
2
by: Nathan Sokalski | last post by:
I have a Repeater that uses a DataSource that has multiple fields. When the values of these fields is displayed in the Repeater, there are fields that are used in combination with other fields as...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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...
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...

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.