S
Steve K
First problem:
I am specifying a format string for a Binding object like so:
<code>
Binding binding = new Binding("Text",
item.EOBRemittance,
"AmountAllowed",
true,
DataSourceUpdateMode.Never,
0,
"{0} Selected Pages");
</code>
When I run my application the Format string is working 50% ;0)
Instead of: "20 Selected Pages"
I see: "{20} Selected Pages"
So it's dropping the bound property's value in the right place, but it's
not removing the '{' and '}' characters. Does this seem like a bug or
am I doing something wrong?
Second problem:
I have a somewhat interesting situation where I would like to bind a
LinkLabel's Text property to the Count property on a List<T>. I know
List<T>.Count is readonly, but I thought you could still one-way bind to
a read only property?
Here is the code:
<code>
Binding binding = new Binding("Text",
item.AttachmentIndices,
"Count",
true,
DataSourceUpdateMode.Never,
0,
"{0} Selected Pages");
_linkLabel_SelectPages.DataBindings.Clear();
_linkLabel_SelectPages.DataBindings.Add(binding);
</code>
In the above example item.AttachmentIndices is a List<int>.
When I run my application, I get the following exception:
"Cannot bind to the property or column Count on the DataSource"
I tried the same with the Capacity property and it threw the same error,
however it is read/write. So maybe I'm barking up the wrong tree?
I look through reflector and (Couldn't find List<T> but checked some
other classes) and didn't see any special attributes or anything.
Anyone have any ideas?
I am specifying a format string for a Binding object like so:
<code>
Binding binding = new Binding("Text",
item.EOBRemittance,
"AmountAllowed",
true,
DataSourceUpdateMode.Never,
0,
"{0} Selected Pages");
</code>
When I run my application the Format string is working 50% ;0)
Instead of: "20 Selected Pages"
I see: "{20} Selected Pages"
So it's dropping the bound property's value in the right place, but it's
not removing the '{' and '}' characters. Does this seem like a bug or
am I doing something wrong?
Second problem:
I have a somewhat interesting situation where I would like to bind a
LinkLabel's Text property to the Count property on a List<T>. I know
List<T>.Count is readonly, but I thought you could still one-way bind to
a read only property?
Here is the code:
<code>
Binding binding = new Binding("Text",
item.AttachmentIndices,
"Count",
true,
DataSourceUpdateMode.Never,
0,
"{0} Selected Pages");
_linkLabel_SelectPages.DataBindings.Clear();
_linkLabel_SelectPages.DataBindings.Add(binding);
</code>
In the above example item.AttachmentIndices is a List<int>.
When I run my application, I get the following exception:
"Cannot bind to the property or column Count on the DataSource"
I tried the same with the Capacity property and it threw the same error,
however it is read/write. So maybe I'm barking up the wrong tree?
I look through reflector and (Couldn't find List<T> but checked some
other classes) and didn't see any special attributes or anything.
Anyone have any ideas?