Re: Why can't I bind to count property of a dataview?
From: Derek Chong (dchong_at_landfood.unimelb.edu.au)
Date: 05/14/04
- Next message: rjohns_at_optonline.net: "13 year old Iraqi girl raped by American Soliders"
- Previous message: cleo: "Re: Replacing the DataSet used by bound controls"
- In reply to: William Ryan eMVP: "Re: Why can't I bind to count property of a dataview?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 14 May 2004 16:01:50 +1000
Have given up trying to bind to the DefaultView.count property, I was
hoping just something simple like lblLabel.Databindings.Add("Text",
DataTable.DefaultView, "Count") would work but alas all is not that easy in
the .Net world.
All I was after was an easy way to show users how many rows were displayed
in a datagrid by reporting on the underlying defaultview. I have ended up
using the DefalutView.ListChanged event to update the count lable instead.
Cheers
Derek
"William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
news:%23UM6gKSOEHA.3124@TK2MSFTNGP12.phx.gbl...
> Derek, if I understand you correctly, no you can't do it You can though
> set it when the filter on the table changes which logically makes more
> sense. You see, if I bound to count and changed the filter, the number
> would change but have nothing to do with the position that the binding
uses.
> You'd probably want to to change based on the filter changing or use a
> computed column with DataTable.Compute and set the value to it.
>
> HTH,
>
> Bill
>
> www.devbuzz.com
> www.knowdotnet.com
>
> "Derek Chong" <dchong@landfood.unimelb.edu.au> wrote in message
> news:OCNn0FIOEHA.2728@TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > I am trying to add a databinding to a label that uses a tables
> > defaultview.count property. I keep getting an error message that says I
> > can't bind to it, is this by design or a bug?
> >
> > Any suggestions appreciated
> >
> > Derek
> >
> >
>
>
- Next message: rjohns_at_optonline.net: "13 year old Iraqi girl raped by American Soliders"
- Previous message: cleo: "Re: Replacing the DataSet used by bound controls"
- In reply to: William Ryan eMVP: "Re: Why can't I bind to count property of a dataview?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|