Click here to Skip to main content
15,748,748 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a datagrid , inside datagrid I have to bind some listbox (es) based on ID of the particular record.

For eg.

TextColumn 	TextColumn  TextColumn 	 TemplateColumn 
ID 	           NAME 	      CLASS       SUBJECT
1	           XXX	         A         JAVA
2	           YYY	         B	 .NET
3	           ZZZ	         C	 JAVA

SUBJECT column should be loaded in a Listbox inside the datagrid. I have successfully loaded DataGridTextColumn‘s (ID,NAME ,CLASS)
But I couldnt able to load the SUBJECT.

NOTE : I have binded the DataGridTextColumn’s in the datagrid by returning a list from WCF service.

Please do the needful.

Share this answer
meetprabhum 26-Jul-12 9:03am    
i already tried the links provided, but its not worked for me.
Well, you need to fill the Listbox inside DataGridTemplateColumn. In the itemsource of your Listbox you can add something like this:
Itemsource={Binding {StaticSource domainservice}, Path=Data}

Now, in your DataGridTemplateColumn you can find a DataBinding property (I just cannot remember the real property):
DataBinding={Binding SUBJECT, Mode=TwoWay}

Hope it helps.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900