﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » Need help decifering a concept...</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 09:15:05 GMT</lastBuildDate><ttl>20</ttl><item><title>Need help decifering a concept...</title><link>http://forum.strataframe.net/FindPost2156.aspx</link><description>Can someone help me decifer this line of code? I saw it somewhere and have used it a couple of times but I'm not sure what the concept is called or why it works. &lt;br&gt;
&lt;br&gt;
Me.cboDivisions.Properties.GetDataSourceRowByKeyValue(Me.cboDivisions.EditValue)("LocationID").ToString&lt;br&gt;
&lt;br&gt;
If this piece of code were to take up two lines this is what it would look like this&lt;br&gt;
&lt;br&gt;
Dim row As DataRowView = Me.cboDivisions.Properties.GetDataSourceRowByKeyValue(Me.cboDivisions.EditValue)&lt;br&gt;
Messagebox.Show(row("LocationID").ToString)&lt;br&gt;
&lt;br&gt;
I'm referring to the way I can butt the set of parenthesis together.&lt;br&gt;
&lt;br&gt;
Thanks for the help. :cool:</description><pubDate>Fri, 11 Aug 2006 15:52:09 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Need help decifering a concept...</title><link>http://forum.strataframe.net/FindPost2166.aspx</link><description>No problem :)</description><pubDate>Fri, 11 Aug 2006 15:52:09 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Need help decifering a concept...</title><link>http://forum.strataframe.net/FindPost2165.aspx</link><description>Thanks Ben! Good stuff!</description><pubDate>Fri, 11 Aug 2006 15:50:04 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Need help decifering a concept...</title><link>http://forum.strataframe.net/FindPost2163.aspx</link><description>In CSharp, the indexer properties cannot use the property name, but instead, they use the square brackets, so it looks like this instead:&lt;/P&gt;&lt;P&gt;this.cboDivisions.Properties.GetDataSourceRowByKeyValue(Me.cboDivisions.EditValue)["LocationID"].ToString();</description><pubDate>Fri, 11 Aug 2006 15:48:43 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Need help decifering a concept...</title><link>http://forum.strataframe.net/FindPost2162.aspx</link><description>Hi Mike,&lt;/P&gt;&lt;P&gt;The reason you can butt the parenthasis together is because of the way the properties work.&amp;nbsp; It is the same concept as that of chaining together a bunch of dots, like this:&lt;/P&gt;&lt;P&gt;Me.TextBox1.Text&lt;/P&gt;&lt;P&gt;The first dot tells the "Me" variable that we are accessing one of its properties.&amp;nbsp; The second dot tells the TextBox that we are accessing one of its properties.&lt;/P&gt;&lt;P&gt;Now, there are special properties called "indexers."&amp;nbsp; An indexer is a "default" property that allows you to leave off the property name because it is understood.&amp;nbsp; So, When you execute the GetDataSourceRowByKeyValue(Me.cboDivisions.EditValue) method, it returns an instance to a DataRowView.&amp;nbsp; If you were to put a dot at the end of those parenthasis, you would be telling the DataRowView that you want to access it's properties.&amp;nbsp; So, you could do this: Me.cboDivisions.Properties.GetDataSourceRowByKeyValue(Me.cboDivisions.EditValue).Row which would return the DataRow wrapped by the DataRowView.&amp;nbsp; So, we combine this with the indexer property of the DataRowView item, which accepts a column name and returns the value within the field.&amp;nbsp; So, since the property is the indexer (its the "Item" propery), you can leave off the .PropetyName because it's understood.&amp;nbsp; So, the parenthasis are butted together because the ".Item" is understood, and therefore, left off.&lt;/P&gt;&lt;P&gt;Me.cboDivisions.Properties.GetDataSourceRowByKeyValue(Me.cboDivisions.EditValue)("LocationID").ToString() &lt;/P&gt;&lt;P&gt;Me.cboDivisions.Properties.GetDataSourceRowByKeyValue(Me.cboDivisions.EditValue).Item("LocationID").ToString()</description><pubDate>Fri, 11 Aug 2006 15:47:18 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>