Friday, March 28, 2008

ASP wwDataBinder with dictionaries and lists

Hello people,
This is my first article of my blog so I hope you find this helpful.
How many of you used wwDataBinder extender from MSDN in asp pages . If you did, maybe you wanted to bind some lists or dictionaries and had a surprise, it does not work.
I changed extender a little bit so you can use lists and dictionaries.
This can be a lot of help if you're using lists or dictionaries in your data model.
Well, you can download it from here as compiled version or source code (use Save target as).

Using is very simple:

<ww:wwDataBindingItem runat="server" BindingMode="TwoWay" DisplayFormat="{0:00.00}"
BindingSource="this" ControlId="TextBox33" BindingSourceMember="SomeDictionary[1]">
</ww:wwDataBindingItem>

I will come with another article regarding using this extender for those who does not know about this.
kick it on DotNetKicks.com

5 comments:

Igor said...

Do you still have that download available somewhere (your current links don't work)?

ASP said...

I will fix this right away.

ASP said...

ok, try dowload again.

Girish Girigowda said...

Hi,
I am trying to use your code to bind to a checkboxlist, I have an entity with a list of string objects which I want to bind to the checkboxlist and also unbind from this checkboxlist how would I go about doing that?
Thanks,

ASP said...

Well, usually this is used to bind and object or list[index] to a simple control like a textbox, dropdown, etc. As you can see on a wwwDatabindingItem you have to choose a property of a control(by default is Text of a textbox). So For a checkbox list you could do tha classic binding wit a datasource.