<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Wed, 19 Jun 2013 17:46:39 GMT</pubDate>
	<lastBuildDate>Wed, 19 Jun 2013 17:46:39 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>13</c9:totalResults>
	<c9:pageCount>-13</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p><span>I am trying to Bind the TextBlock inside DataTemplate of ComboBox through Code.&nbsp;</span><br><br><span>XAML Code :&nbsp;</span><br><br><span>&lt;ComboBox Name=&quot;cmbRefDoctor&quot;&gt;</span><br><span>&nbsp; &nbsp; &nbsp; &nbsp; &lt;my:HComboBox.ItemTemplate&gt;</span><br><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;DataTemplate&gt;</span><br><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;TextBlock x:Name=&quot;txtRefDoctorName&quot; /&gt;</span><br><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/DataTemplate&gt;</span><br><span>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/my:HComboBox.ItemTemplate&gt;</span><br><span>&lt;/ComboBox&gt;</span><br><br><span>Binding for the TextBlock &quot;txtRefDoctorName&quot; should be made in the code and not in the XAML. I am able to bind all the other controls which are not in DataTemplate but I am not able to solve this problem.&nbsp;</span><br><br><span>Can you please suggest a solution.</span></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/3e04528f5a1f4ec3ab9fa0e100eebfba#3e04528f5a1f4ec3ab9fa0e100eebfba</link>
		<pubDate>Fri, 05 Oct 2012 14:29:15 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/3e04528f5a1f4ec3ab9fa0e100eebfba#3e04528f5a1f4ec3ab9fa0e100eebfba</guid>
		<dc:creator>santrajas</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/santrajas/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p>@<a href="/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values#c3e04528f5a1f4ec3ab9fa0e100eebfba">santrajas</a>: You don't have a property name to bind to in XAML? You can do that, and then set the DataContext of the ComboBox in code.</p><p>If you don't know the property name at design time, then DataTemplates really aren't the answer.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/ff74b7e0afc846f5b1e0a0e100f2889e#ff74b7e0afc846f5b1e0a0e100f2889e</link>
		<pubDate>Fri, 05 Oct 2012 14:43:02 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/ff74b7e0afc846f5b1e0a0e100f2889e#ff74b7e0afc846f5b1e0a0e100f2889e</guid>
		<dc:creator>Scott</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/spivonious/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p>@<a class="profile" href="http://channel9.msdn.com/Niners/spivonious">spivonious</a>&nbsp;I do know the property name to be used for binding.</p><p>But I want to bind the Textblock in code and not in XAML. That is the requirement.&nbsp;</p><p>using DataTemplate is not mandatory for me, but since I am quite new to Silverlight don't know other option to be used.</p><p>Can you suggests somethings, may be a hint or idea.</p><p>&nbsp;</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/5245c50845d64fa28c18a0e20066a680#5245c50845d64fa28c18a0e20066a680</link>
		<pubDate>Sat, 06 Oct 2012 06:13:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/5245c50845d64fa28c18a0e20066a680#5245c50845d64fa28c18a0e20066a680</guid>
		<dc:creator>santrajas</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/santrajas/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p>@<a href="/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values#c5245c50845d64fa28c18a0e20066a680">santrajas</a>: By putting the property name in the XAML, you set everything up beforehand. The actual binding doesn't take place until you set the itemssource/datacontext of the ComboBox in the code-behind.</p><p>While you can do it all in code, as you're finding out it's pretty complex and really not the way Silverlight was designed to be used. Is this a strict requirement?</p><p><pre class="brush: xml">&lt;DataTemplate&gt;
&lt;TextBlock Text=&quot;{Binding MyTextPropertyName}&quot; /&gt;
&lt;/DataTemplate&gt;</pre></p><p><pre class="brush: vb">Sub BindStuff()
myComboBox.ItemsSource = myDataSource
End Sub</pre></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/39a5af540cc24a36ad1aa0e401394ec8#39a5af540cc24a36ad1aa0e401394ec8</link>
		<pubDate>Mon, 08 Oct 2012 19:00:43 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/39a5af540cc24a36ad1aa0e401394ec8#39a5af540cc24a36ad1aa0e401394ec8</guid>
		<dc:creator>Scott</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/spivonious/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p>@<a class="profile" href="http://channel9.msdn.com/Niners/spivonious">spivonious</a>&nbsp;:</p><p>Thanks for your reply.</p><p>Yes its kind of strict requirement, because the properties which will be bound with Controls sometimes come from DataBase, As being a developer I know those properties before hand but the way my project is supposed to work, client side (XAML Page) should not have any kind of binding set, all the bindings should be set from Server side not even from .cs file.</p><p>I have tried using Binding object, Loaded Event and few more.</p><p>I have also tried to obtain the TextBlock using LoadContent() function but still somehow binding doesn't take place.</p><p>I hope I made myself clear for your understanding. If you want some more details please let me know.</p><p>&nbsp;</p><p>Thanks <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' />&nbsp;</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/30e9281e8e0042e1807aa0e50073eb7c#30e9281e8e0042e1807aa0e50073eb7c</link>
		<pubDate>Tue, 09 Oct 2012 07:02:03 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/30e9281e8e0042e1807aa0e50073eb7c#30e9281e8e0042e1807aa0e50073eb7c</guid>
		<dc:creator>santrajas</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/santrajas/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p>@<a href="/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values#c30e9281e8e0042e1807aa0e50073eb7c">santrajas</a>: I'm extremely confused with the requirement of no binding in the XAML or in the code-behind. Silverlight is the wrong solution if you can't use any of its features. The user of your Silverlight app will have no access to the XAML or CS files.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/843903673cde4bc1bd0aa0e6011dd727#843903673cde4bc1bd0aa0e6011dd727</link>
		<pubDate>Wed, 10 Oct 2012 17:20:42 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/843903673cde4bc1bd0aa0e6011dd727#843903673cde4bc1bd0aa0e6011dd727</guid>
		<dc:creator>Scott</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/spivonious/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p>yes that is the exact requirement, user should not have any control over binding,</p><p>user will see data set by server.</p><p>No binding in xaml and no binding in Cs either, server will decide binding and server will set the data using binding.</p><p>I have a control-mapping feature, which maps and stores control and its related datasource in database table.</p><p>eg. TextBox: txtPatientName will be mapped with PatientName property of datasource and this data will be stored in database.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/1d492505e16741758120a0e700c98092#1d492505e16741758120a0e700c98092</link>
		<pubDate>Thu, 11 Oct 2012 12:13:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/1d492505e16741758120a0e700c98092#1d492505e16741758120a0e700c98092</guid>
		<dc:creator>santrajas</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/santrajas/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p>So in this case, the user HAS control over the databinding? At least the database admin. Is it a requirement, that controls can dynamically change bindings to different column names, even though the properties seem clearly specified(PatientName will always be PatientName and nothing else)?</p><p>A silverlight application gets packaged down to .XAP, and I think the XAML files get compiled&nbsp;as resources into the dll, so a user can't control the bindings anyways.</p><p>Are you sure this is the right approach? Is the database schema given and you basically have to conform to it? You could do it, but I absolutely see no reason to do it(Unless you would want to create something like&nbsp;dynamic formulars, where controls could be dynamically&nbsp;added or removed based on database).</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/f198ccea1b924f25942fa0eb00e65e29#f198ccea1b924f25942fa0eb00e65e29</link>
		<pubDate>Mon, 15 Oct 2012 13:58:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/f198ccea1b924f25942fa0eb00e65e29#f198ccea1b924f25942fa0eb00e65e29</guid>
		<dc:creator>philjay</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/philjay/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p>@philjay: I dont want to give user access to any kind of data binding hence i want to do binding from server using values and schema stored in database.</p><p>Once the value in DataBase is changed by developer or database admin, the binding of that control should get changed and display the changed value.</p><p>Like Patient Name will always display Patient Name but source from where that values comes can change.</p><p>I am designing a Client-Server Application where client will have Silverlight app running and hence i want to have complete control over binding and values to be displayed this will enable me to make small small changes quite easily. Its a feature i want to add to my project to make it different from other students but seems its bit difficult.</p><p>Can you suggest some way to solve my problem?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/cce03fb20b154902b2c7a0ec006c66cd#cce03fb20b154902b2c7a0ec006c66cd</link>
		<pubDate>Tue, 16 Oct 2012 06:34:40 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/cce03fb20b154902b2c7a0ec006c66cd#cce03fb20b154902b2c7a0ec006c66cd</guid>
		<dc:creator>santrajas</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/santrajas/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p>Like when you say, PatientName will always be PatientName, your approach makes no sense, why would you store bindings in a database? I have never seen this before. You store the data in the database, access it using a webservice, then the client application's job is to display this data.</p><p>If you'd store binding-declarations in the db, you could very easily break your application, without any additional gain, but only problems and difficulities, starting at you essentially giving up all the tooling and debugging related to bindings, not even having any additional flexibility, since bindings cannot really change.</p><p>One approach, that if&nbsp;the source can change, eg. different table, I recommend creating a&nbsp;<strong>ViewModel</strong> representing for example the patient,&nbsp;that has always the same properties, and when loading your data you can just <strong>map</strong> from whichever table to the properties of&nbsp;that viewmodel. And then you just bind to it.</p><p>But I would not store specific mappings in the db, you should keep the schema clean and consistent, so if you have different tables being displayed by the same view, they should have the same column names. If you need to be really dynamic, you could theoretically&nbsp;store the whole XAML files in the db or the formulars and their fields that will generate a XAML.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/a258244cb1164be5a84ca0ec00789fcc#a258244cb1164be5a84ca0ec00789fcc</link>
		<pubDate>Tue, 16 Oct 2012 07:19:10 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/a258244cb1164be5a84ca0ec00789fcc#a258244cb1164be5a84ca0ec00789fcc</guid>
		<dc:creator>philjay</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/philjay/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p>@<a href="/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values#ccce03fb20b154902b2c7a0ec006c66cd">santrajas</a>: The client will have zero access to the XAML, so moving the binding code to the server has no benefit. You will end up with a DLL or EXE, not a collection of source files like an ASP.NET site would have.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/bf012e1ac7b1428b9117a0ee00e6e07a#bf012e1ac7b1428b9117a0ee00e6e07a</link>
		<pubDate>Thu, 18 Oct 2012 14:00:35 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/bf012e1ac7b1428b9117a0ee00e6e07a#bf012e1ac7b1428b9117a0ee00e6e07a</guid>
		<dc:creator>Scott</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/spivonious/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p>Yeah you are right @<a class="profile" href="http://channel9.msdn.com/Niners/spivonious">spivonious</a>&nbsp;but the thing is I want to add facility to change the displayed data by changing mapping in database.</p><p>For example,</p><p>Combobox which displays names of Doctors who work in clinic, now I want to show list of doctors which are visiting doctors in same combobox instead of previous list.(plz assume labels and other things are in perfect sync to do this). For this thing I need to change column of Datasource Bound with this combobox.&nbsp;</p><p>I want to achieve this by changing binding through server using data stored in database.</p><p>I hope I am making it little more clear about my scenario.</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/9660ccf12a0d448c913da0ee00f34f9f#9660ccf12a0d448c913da0ee00f34f9f</link>
		<pubDate>Thu, 18 Oct 2012 14:45:52 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/9660ccf12a0d448c913da0ee00f34f9f#9660ccf12a0d448c913da0ee00f34f9f</guid>
		<dc:creator>santrajas</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/santrajas/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Dynamic Binding for TextBlock inside of DataTemplate in ComboBox </title>
		<description><![CDATA[<p>@<a href="/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values#c9660ccf12a0d448c913da0ee00f34f9f">santrajas</a>: It is starting to make a little more sense, but I'd still try to use code instead of the database.</p><p>For your example, your data access layer could return a doctor list based on given filter criteria. When your user checks a box in the UI, the viewmodel class detects this and modifies the Doctors property to return the different doctors. Your XAML binding doesn't need to change because your ViewModel is now delivering a different list of doctors.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/9f0d68654a8b4d6e90f2a0ee011ac55b#9f0d68654a8b4d6e90f2a0ee011ac55b</link>
		<pubDate>Thu, 18 Oct 2012 17:09:32 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/TextBlock-inside-of-ComboBox-doesnt-display-Text-but-contains-values/9f0d68654a8b4d6e90f2a0ee011ac55b#9f0d68654a8b4d6e90f2a0ee011ac55b</guid>
		<dc:creator>Scott</dc:creator>
		<slash:comments>13</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/spivonious/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>