<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.componentart.com/community/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Hwan Hong</title><subtitle type="html">Helping you help yourselves</subtitle><id>http://www.componentart.com/community/blogs/hwan/atom.aspx</id><link rel="alternate" type="text/html" href="http://www.componentart.com/community/blogs/hwan/default.aspx" /><link rel="self" type="application/atom+xml" href="http://www.componentart.com/community/blogs/hwan/atom.aspx" /><generator uri="http://communityserver.org" version="4.1.40407.4157">Community Server</generator><updated>2009-03-12T15:19:00Z</updated><entry><title>XYChart's X-Coordinate Popups</title><link rel="alternate" type="text/html" href="/community/blogs/hwan/archive/2010/11/29/xychart-s-x-coordinate-popups.aspx" /><id>/community/blogs/hwan/archive/2010/11/29/xychart-s-x-coordinate-popups.aspx</id><published>2010-11-29T15:40:00Z</published><updated>2010-11-29T15:40:00Z</updated><content type="html">&lt;p&gt;XYChart&amp;#39;s XCoordinatePopup is a popup that is shown when the user&amp;#39;s cursor hovers over the main area i.e. the rectangular region where datapoints are rendered.  The popup&amp;#39;s contents generally reveal details about the datapoints that lie along that particular x-coordinate.&amp;nbsp; Note the difference between this and the plain popup behavior -- in that case, the popup&amp;#39;s context is the datapoint being hovered over, rather than the datapoints along the x-coordinate.&amp;nbsp; As such, one can think of XCoordinatePopup as a summary of the datapoints that are contained in that columnar area.&lt;/p&gt;
&lt;h3&gt;Features&lt;/h3&gt;
&lt;p&gt;When EnableXCoordinatePopup is set to true, the XCoordinatePopup&amp;#39;s default popup will appear with basic datapoint values, such as in Figure 1.
&lt;/p&gt;
&lt;p style="text-align:center;"&gt;&lt;a href="http://www.componentart.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/8357.Charting_5F00_XyChart_5F00_XCoordinatePopup01.png"&gt;&lt;img src="http://www.componentart.com/community/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/8357.Charting_5F00_XyChart_5F00_XCoordinatePopup01.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:x-small;"&gt;Figure 1. Default XYChart XCoordinatePopup&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:center;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The popup consists of two parts: an index template (the upper, darker gray section of Figure 1&amp;#39;s popup) and a data template (the lower, lighter gray section of Figure 1&amp;#39;s popup).  By defining a custom template for both or either section one can override these default templates.  For example, the XCoordinatePopup in Figure 2 is achieved using the following XAML:&lt;/p&gt;
&lt;div class="LanguageSpecific"&gt;
&lt;pre class="csc"&gt;&lt;span class="kwrd"&gt;&lt;pre class="codeblock"&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;XYChart.XCoordinatePopup&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;XCoordinatePopup&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;XCoordinatePopup.DataTemplate&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;caCalc&lt;/span&gt;:&lt;span style="color:#800000;"&gt;CalcEngine&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;x&lt;/span&gt;:&lt;span style="color:#FF0000;"&gt;Name&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;calc0&amp;quot;&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;caCalc&lt;/span&gt;:&lt;span style="color:#800000;"&gt;CalcEngineInput&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Id&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;context&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Value&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;{Binding}&amp;quot;&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;caCalc&lt;/span&gt;:&lt;span style="color:#800000;"&gt;CalcEngine.Expression&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;              &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;sys&lt;/span&gt;:&lt;span style="color:#800000;"&gt;String&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;                var a[]; &lt;br /&gt;                a[0] = S0.DataPoint.Y; &lt;br /&gt;                a[1] = S0.DataPoint.Brush; &lt;br /&gt;                a[2] = S1.DataPoint.Y;&lt;br /&gt;                a[3] = S1.DataPoint.Brush;&lt;br /&gt;                a&lt;br /&gt;              &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;sys&lt;/span&gt;:&lt;span style="color:#800000;"&gt;String&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;caCalc&lt;/span&gt;:&lt;span style="color:#800000;"&gt;CalcEngine.Expression&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;caCalc&lt;/span&gt;:&lt;span style="color:#800000;"&gt;CalcEngine&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;StackPanel&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Orientation&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;Vertical&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;TextBlock&lt;/span&gt;&lt;br /&gt;              &lt;span style="color:#FF0000;"&gt;Text&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;{Binding Output[0], ElementName=calc0, StringFormat=\{0:$#\,0\}}&amp;quot;&lt;/span&gt; &lt;br /&gt;              &lt;span style="color:#FF0000;"&gt;Foreground&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;{Binding Output[1], ElementName=calc0}&amp;quot;&lt;/span&gt; &lt;br /&gt;              &lt;span style="color:#FF0000;"&gt;FontSize&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;10&amp;quot;&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;TextBlock&lt;/span&gt;&lt;br /&gt;              &lt;span style="color:#FF0000;"&gt;Text&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;{Binding Output[2], ElementName=calc0, StringFormat=\{0:$#\,0\}}&amp;quot;&lt;/span&gt; &lt;br /&gt;              &lt;span style="color:#FF0000;"&gt;Foreground&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;{Binding Output[3], ElementName=calc0}&amp;quot;&lt;/span&gt; &lt;br /&gt;              &lt;span style="color:#FF0000;"&gt;FontSize&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;10&amp;quot;&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;XCoordinatePopup.DataTemplate&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;XCoordinatePopup&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;XYChart.XCoordinatePopup&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p style="text-align:center;"&gt;&lt;a href="http://www.componentart.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/6648.Charting_5F00_XyChart_5F00_XCoordinatePopup02.png"&gt;&lt;img src="http://www.componentart.com/community/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/6648.Charting_5F00_XyChart_5F00_XCoordinatePopup02.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:x-small;"&gt;Figure 2. Customized XYChart XCoordinatePopup&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;Classes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;RelativePositionX&lt;/b&gt;, &lt;b&gt;RelativePositionY&lt;/b&gt; -- Translation on the xy plane to shift the popup from its default position as a percentage.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;XOffset&lt;/b&gt;, &lt;b&gt;YOffset&lt;/b&gt; -- Translation on the xy plane to shift the popup from its default position in pixels.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;IndexTemplate&lt;/b&gt;, &lt;b&gt;DataTemplate&lt;/b&gt; -- Templates for the index (top) and value (bottom) parts of the popup.  The datacontext for both is a SeriesCrossSection object.
    
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;SeriesCrossSectionContext&lt;/i&gt; -- Object which provides the set of datapoints that lie along (or closest to) the x-coordinate where the cursor is currently sitting.  Derives from Dictionary&amp;lt;string, DataPointContext&amp;gt; and implements the IPropertyProvider interface.  For each datapoint in the cross-section there is an item in the dictionary.  The key is the Series name and the value is the DataPointContext object related to the datapoint.  The IPropertyProvider interface also allows one to access dictionary items in Calc script, such as in a CalcContainer.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;In-depth Explanation&lt;br /&gt;&lt;/h3&gt;
&lt;p&gt;Let&amp;#39;s take a closer look at the markup to generate the XCoordinatePopup in Figure 2.&lt;/p&gt;
&lt;p style="text-align:center;"&gt;&lt;a href="http://www.componentart.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/4452.Charting_5F00_XyChart_5F00_XCoordinatePopup03.png"&gt;&lt;img src="http://www.componentart.com/community/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/4452.Charting_5F00_XyChart_5F00_XCoordinatePopup03.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:x-small;"&gt;Figure 3. Customized XYChart XCoordinatePopup markup&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;This XCoordinatePopup XAML defines a DataTemplate, which will overwrite the default.  However IndexTemplate is not defined and so Chart will provide its own default template for the upper region of the XCoordinatePopup.&lt;/li&gt;
&lt;li&gt;The CalcEngine, &amp;quot;calc0&amp;quot;, sets the DataTemplate context as its Input.&lt;/li&gt;
&lt;li&gt;Since the context is a dictionary, a Calc expression of &amp;quot;self[&amp;lsquo;S0&amp;rsquo;]&amp;quot; would access the datapoint context of the datapoint from series &amp;ldquo;S0&amp;rdquo;.  In this case however the SeriesCrossSectionContext class implements IPropertyProvider so we can use property syntax instead -- the cleaner and simpler &amp;quot;S0&amp;quot;, the name of the Series object.&lt;/li&gt;
&lt;li&gt;The CalcEngine computes values and brushes and returns them in an array; in this simple example it doesn&amp;#39;t actually do anything to them but pass them back.&lt;/li&gt;
&lt;li&gt;The value section of the XCoordinatePopup consists of two TextBlocks.  These blocks bind text and brushes to the Output of the CalcEngine.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In summary, XCoordinatePopup is a useful way to interactively compare individual datapoints across multiple series.&amp;nbsp; It consists of an IndexTemplate and a DataTemplate, and as such it is highly customizable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.componentart.com/community/aggbug.aspx?PostID=103474" width="1" height="1"&gt;</content><author><name>hwan</name><uri>http://www.componentart.com/community/members/hwan/default.aspx</uri></author><category term="Charting" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/Charting/default.aspx" /><category term="Chart" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/Chart/default.aspx" /><category term="DataVisualization" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/DataVisualization/default.aspx" /><category term="XYChart" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/XYChart/default.aspx" /><category term="XCoodinatePopup" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/XCoodinatePopup/default.aspx" /></entry><entry><title>An Overview of XYChart Areas</title><link rel="alternate" type="text/html" href="/community/blogs/hwan/archive/2010/11/25/an-overview-of-xychart-areas.aspx" /><id>/community/blogs/hwan/archive/2010/11/25/an-overview-of-xychart-areas.aspx</id><published>2010-11-25T19:55:00Z</published><updated>2010-11-25T19:55:00Z</updated><content type="html">&lt;p&gt;The visual layout for ComponentArt&amp;#39;s XYChart for DataVisualization control is composed of five regions called Areas.&amp;nbsp; This article aims to give an idea of what these regions are, so that you can better customize your own.&lt;/p&gt;
&lt;p&gt;Figure 1. shows the arrangement of XYChart&amp;#39;s Areas:&lt;/p&gt;
&lt;p style="text-align:center;"&gt;&lt;a href="http://www.componentart.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/2045.Charting_5F00_XyChart_5F00_Areas01.png"&gt;&lt;img alt="XYChart Areas" style="border:0;" src="http://www.componentart.com/community/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/2045.Charting_5F00_XyChart_5F00_Areas01.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. XYChart Areas&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;(In pink) Legend - (Optional) Located at an edge of the chart, depending on the docking property&lt;/li&gt;
&lt;li&gt;(Gray and white) The main chart area is represented by the &lt;b&gt;XYChartMainArea&lt;/b&gt;; it holds the actual rendered graph (line, area, bar, etc.). &lt;/li&gt;
&lt;li&gt;(In violet) There are four axis areas, one along each side of the main area: &lt;b&gt;XAxisArea&lt;/b&gt;, &lt;b&gt;YAxisArea&lt;/b&gt;,  &lt;b&gt;X2AxisArea&lt;/b&gt;, and &lt;b&gt;Y2AxisArea&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By default XYChart populates the XYChartMainArea, XAxisArea and YAxisArea with content, such as axis annotations and coordinate system elements e.g. horizontal and vertical gridlines, stripes, etc.  The secondary areas, X2AxisArea and Y2AxisArea, are left empty.  All of these defaults can be overwritten with custom definitions.  Setting DefaultAxisAnnotationsVisible to false also removes these built-in definitions.  Note that if one defines an area, the default AxisAnnotation (or other element) can still be used by including an undefined instance of it.  &lt;/p&gt;
&lt;p&gt;e.g.&lt;/p&gt;
&lt;pre class="codeblock"&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;XYChart&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;XPath&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;Date&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Width&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;400&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Height&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;300&amp;quot;&lt;/span&gt; ... &lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;XYChart.XAxisArea&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;AxisCoordinates&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;  &lt;span style="color:#008000;"&gt;&amp;lt;!-- Including AxisAnnotation as undefined  will cause Chart to insert its default version --&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;ChartLabel&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      ... etc&lt;/pre&gt;
&lt;p&gt;Each Area is a Collection of elements.  The visual tree of XYChartMainArea is defined by the elements of its underlying Collection, and these are displayed one on top of another.&amp;nbsp; AxisAreas on the other hand are StackPanels are displayed in an inside-out order i.e. the first member is closest to the XYChartMainArea.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;MainArea&lt;/h3&gt;
&lt;p&gt;XYChart&amp;#39;s MainArea can be populated with the following classes:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Series Classes&lt;/b&gt;
    
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;BarSeries &lt;/i&gt;- Datapoints are represented by individual bars (rectangles going left to right) or columns (rectangles going from bottom to top).&lt;/li&gt;
&lt;li&gt;&lt;i&gt;AreaSeries &lt;/i&gt;- Datapoints are connected by a line, and the space between that line and the axis is given a fill.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;LineSeries &lt;/i&gt;- Datapoints are connected by a styled line.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;MarkerSeries &lt;/i&gt;- Datapoints are represented by a pre-defined graphic.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;CandleStickSeries &lt;/i&gt;- Financial stock datapoints are drawn using a &amp;quot;candlestick&amp;quot;, a custom hybrid of line and bar charts.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;OHLCSeries &lt;/i&gt;- Financial stock datapoints are drawn using &amp;quot;Open-high-low-close&amp;quot; markers, which are similar to the candlestick marker.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;CompositeSeries &lt;/i&gt;- A series that is composed of a combination of other series.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Coordinate System Classes
    
&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;CoordinateLines &lt;/i&gt;- Horizontal and vertical lines used to demarcate intervals on the axes.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;CoordinateStripes &lt;/i&gt;- Horizontal and vertical regions between CoordinateLines.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;CoordinateSystemFrame &lt;/i&gt;- Border around the main area, as well as 3D considerations i.e. rendered depth.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Interaction Classes&lt;/b&gt;
    
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;SeriesTracker &lt;/i&gt;- A reticle which highlights datapoints, following the user&amp;#39;s cursor when on the chart main area. &lt;/li&gt;
&lt;li&gt;&lt;i&gt;SeriesAnnotationTracker &lt;/i&gt;- A popup rendered over the series, following the user&amp;#39;s cursor when on the chart main area.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I should mention that there is some overlap between the Series classes -- for example, AreaSeries also has a built-in LineSeries (though of course you can choose to turn this off), and Bar, Line, and Area series can have a MarkerSeries, so you don&amp;#39;t need to add this series separately.&lt;/p&gt;
&lt;h3&gt;AxisAreas&lt;/h3&gt;
&lt;p&gt;The AxisAreas are generally comprised of the following classes:
  &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;AxisCoordinates &lt;/b&gt;- System used to uniquely determine the positions of datapoints.&amp;nbsp; Inside an AxisArea, it includes the labels indicating value intervals.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;AxisScrollBar &lt;/b&gt;- Scroll bar used to scroll and zoom through the main rendered area of datapoints, as shown in Figure 2.
&lt;p style="text-align:center;"&gt;&lt;a href="http://www.componentart.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/5430.Charting_5F00_XyChart_5F00_Areas02.png"&gt;&lt;img alt="XYChart horizontal scrollbar" style="border:0;" src="http://www.componentart.com/community/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/5430.Charting_5F00_XyChart_5F00_Areas02.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Scroll bar&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;AxisLabel &lt;/b&gt;- Visual labels applied to the regions between intervals along the axis.
    &lt;br /&gt;Example:
&lt;p style="text-align:center;"&gt;&lt;a href="http://www.componentart.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/6013.Charting_5F00_XyChart_5F00_Areas03.png"&gt;&lt;img src="http://www.componentart.com/community/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/6013.Charting_5F00_XyChart_5F00_Areas03.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3. XAxisArea AxisLabel&lt;/p&gt;
&lt;p&gt;In Figure 3 there are two custom AxisLabel definitions inside the XAxisArea.  The first uses an in-line Calc expression to change the color of the AxisLabel instance background to red if the sum of the &amp;quot;Services&amp;quot;, &amp;quot;DV&amp;quot; and &amp;quot;UI&amp;quot; datapoint Y values are less than &amp;quot;Expenses&amp;quot;.  The second simply outputs the Month string. The XAML that defines the above follows:&lt;/p&gt;
&lt;pre class="codeblock"&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;XYChart.XAxisArea&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;AxisLabels&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;DateTimeCoordinates&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;From&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Step&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;DateLevel&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;Month&amp;quot;&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;AxisLabels.Template&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;common&lt;/span&gt;:&lt;span style="color:#800000;"&gt;CalcContainer&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt; &amp;lt;!-- CalcContainer inside Common is only available in DataVisualization SP2+ --&amp;gt;&lt;br /&gt;          &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;common&lt;/span&gt;:&lt;span style="color:#800000;"&gt;CalcContainer.Computing&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;sys&lt;/span&gt;:&lt;span style="color:#800000;"&gt;String&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;              var back = Black;&lt;br /&gt;              var diff = Series.Services.DataPoints[Index].Y + Series.DV.DataPoints[Index].Y + Series.UI.DataPoints[Index].Y - Series.Expenses.DataPoints[Index].Y;&lt;br /&gt;              if(0 &amp;gt; diff)&lt;br /&gt;                  back=Red&lt;br /&gt;              else&lt;br /&gt;                  back=Black;&lt;br /&gt;              Background = back;&lt;br /&gt;              Data = diff&lt;br /&gt;            &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;sys&lt;/span&gt;:&lt;span style="color:#800000;"&gt;String&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;common&lt;/span&gt;:&lt;span style="color:#800000;"&gt;CalcContainer.Computing&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;FormattedTextBlock&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Format&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;$#,#&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;HorizontalAlignment&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;Stretch&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Margin&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;0.5,1,0.5,1&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;TextAlignment&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;Center&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;FontSize&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;11&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;FontFamily&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;Calibri&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Foreground&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;White&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;common&lt;/span&gt;:&lt;span style="color:#800000;"&gt;CalcContainer&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;AxisLabels.Template&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;AxisLabels&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;AxisLabels&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;DateTimeCoordinates&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;From&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Step&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;DateLevel&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;Month&amp;quot;&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;AxisLabels.Template&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Border&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Margin&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;4&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;TextAlignment&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;Center&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Text&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;{Binding FormattedStartValue}&amp;quot;&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Border&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;AxisLabels.Template&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;AxisLabels&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ch&lt;/span&gt;:&lt;span style="color:#800000;"&gt;XYChart.XAxisArea&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;ChartLabel &lt;/b&gt;- Custom XAML elements positioned between other axis area elements or between a legend and the rest of the axis area.
  &lt;br /&gt;e.g.
&lt;p style="text-align:center;"&gt;&lt;a href="http://www.componentart.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/3288.Charting_5F00_XyChart_5F00_Areas04.png"&gt;&lt;img src="http://www.componentart.com/community/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/3288.Charting_5F00_XyChart_5F00_Areas04.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4. ChartLabels&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you can see, XYChart is actually a pretty flexible control!&amp;nbsp; I hope that this post has given you a better grasp of the vocabulary used to build an XYChart.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.componentart.com/community/aggbug.aspx?PostID=103452" width="1" height="1"&gt;</content><author><name>hwan</name><uri>http://www.componentart.com/community/members/hwan/default.aspx</uri></author><category term="Charting" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/Charting/default.aspx" /><category term="Chart" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/Chart/default.aspx" /><category term="DataVisualization" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/DataVisualization/default.aspx" /><category term="XYChart" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/XYChart/default.aspx" /><category term="XYChart Areas" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/XYChart+Areas/default.aspx" /></entry><entry><title>HOWTO: Using ComponentArt Themes with your Web.UI AJAX/MVC controls</title><link rel="alternate" type="text/html" href="/community/blogs/hwan/archive/2010/02/19/howto-using-componentart-themes-with-your-web-ui-ajax-mvc-controls.aspx" /><id>/community/blogs/hwan/archive/2010/02/19/howto-using-componentart-themes-with-your-web-ui-ajax-mvc-controls.aspx</id><published>2010-02-19T19:46:00Z</published><updated>2010-02-19T19:46:00Z</updated><content type="html">&lt;p&gt;With Web.UI 2010, ComponentArt has introduced the ability to quickly apply a pre-built stylized design to UI controls in the form of Themes.&amp;nbsp; This allows developers to concentrate on the functional behavior of the control, as design concerns are essentially moved into CSS.&amp;nbsp; This has the added benefit of cleaning up the control definition code.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
To use Themes with one of the pre-built styles included with the Web.UI installation package:&lt;br /&gt;
1.&amp;nbsp; Set &lt;b&gt;AutoTheming &lt;/b&gt;to true on the control.&lt;br /&gt;
ASP.NET AJAX:&lt;/p&gt;
&lt;pre class="codeblock"&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;Menu&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:#FF0000;"&gt;AutoTheming&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;br /&gt;  ...&lt;/pre&gt;
&lt;p&gt;ASP.NET MVC:&lt;/p&gt;
&lt;pre class="codeblock"&gt;&lt;span style="background-color:#FFFF00;color:Black;"&gt;&amp;lt;%&lt;/span&gt;= Html.ComponentArt().Menu()&lt;br /&gt;  .AutoTheming(true)&lt;br /&gt;  ...&lt;/pre&gt;
&lt;p&gt;The control will now render out CSS classnames on its elements, as well as generate any client templates and/or ItemLooks used by the Theme.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
2.&amp;nbsp; Supply the CSS classname definitions.&amp;nbsp; The Web.UI installation package includes several pre-built themes.&amp;nbsp; To use one add a link to the &amp;quot;theme.css&amp;quot; file, with the associated image files in the same directory as the stylesheet.&lt;/p&gt;
&lt;pre class="codeblock"&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;link&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;href&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;/themes/arcticwhite/theme.css&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;type&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;rel&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Inside this stylesheet are all of the expected classes necessary to define the appearance of the control.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
The resultant Menu with the ArcticWhite theme applied:&lt;br /&gt;
&lt;img alt="ArcticWhite Menu" style="border:1px solid black;" src="http://www.componentart.com/community/resized-image.ashx/__size/165x165/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/6064.menu_5F00_arcticwhite_5F00_noicons.png" border="0" height="165" width="165" /&gt;&lt;br /&gt;
All Web.UI ASP.NET AJAX/MVC controls on the page with AutoTheming enabled should now be drawn with the Theme applied, without requiring setting any additional properties.&amp;nbsp; Note that changing the applied Theme is literally as easy as changing the stylesheet link to point to a different &amp;quot;theme.css&amp;quot; file.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
3.&amp;nbsp; (&lt;b&gt;Optional&lt;/b&gt;) Add Theme-coordinated icons.&lt;br /&gt;
a.&amp;nbsp;  Specify an &lt;b&gt;IconCssClass&lt;/b&gt;/&lt;b&gt;IconUrl &lt;/b&gt;on items.&lt;br /&gt;
XML:&lt;/p&gt;
&lt;pre class="codeblock"&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;SiteMap&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Text&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;File&amp;quot;&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Text&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;New...&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;IconCssClass&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;icon-file-new&amp;quot;&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Text&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;Open...&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;IconCssClass&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;icon-file-open&amp;quot;&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;  ...&lt;/pre&gt;
&lt;p&gt;ASP.NET AJAX:&lt;/p&gt;
&lt;pre class="codeblock"&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;Menu&lt;/span&gt; ...&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;  &lt;span style="color:#0000FF;"&gt;&amp;lt;Items&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;MenuItem&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Text&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;File&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0000FF;"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;MenuItem&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Text&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;New...&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;IconCssClass&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;icon-file-new&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#C71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;MenuItem&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;Text&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;File&amp;quot;&lt;/span&gt;  &lt;span style="color:#FF0000;"&gt;IconCssClass&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;icon-file-open&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt; /&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;ASP.NET MVC:&lt;/p&gt;
&lt;pre class="codeblock"&gt;&lt;span style="background-color:#FFFF00;color:Black;"&gt;&amp;lt;%&lt;/span&gt;= Html.ComponentArt().Menu()&lt;br /&gt;  ...&lt;br /&gt;  .Items( o =&amp;gt;&lt;br /&gt;  {&lt;br /&gt;    o.Add().Text(&amp;quot;File&amp;quot;).Items( o2 =&amp;gt;&lt;br /&gt;    {&lt;br /&gt;      o2.Add().Text(&amp;quot;New...&amp;quot;).IconCssClass(&amp;quot;icon-file-new&amp;quot;);&lt;br /&gt;      o2.Add().Text(&amp;quot;File&amp;quot;).IconCssClass(&amp;quot;icon-file-open&amp;quot;);&lt;/pre&gt;
&lt;p&gt;The predefined IconCssClass names are enumerated in the &amp;quot;icon-map.png&amp;quot; file inside the /themes/ folder.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
b.&amp;nbsp; Add a link to the &amp;quot;icons.css&amp;quot; file, with the associated &amp;quot;icons.png&amp;quot; file in the same directory as the stylesheet.&amp;nbsp; If there are disabled items, make sure that &amp;quot;icons-disabled.png&amp;quot; is also in the directory.&lt;/p&gt;
&lt;pre class="codeblock"&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;link&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;href&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;/themes/arcticwhite/icons.css&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;type&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt; &lt;span style="color:#FF0000;"&gt;rel&lt;/span&gt;=&lt;span style="color:#0000FF;"&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The resultant Menu with some icons defined:&lt;br /&gt;
&lt;img alt="ArcticWhite Menu with icons" style="border:1px solid black;" src="http://www.componentart.com/community/resized-image.ashx/__size/165x165/__key/CommunityServer.Blogs.Components.WeblogFiles/hwan/2604.menu_5F00_arcticwhite_5F00_icons.png" border="0" height="165" width="165" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.componentart.com/community/aggbug.aspx?PostID=98199" width="1" height="1"&gt;</content><author><name>hwan</name><uri>http://www.componentart.com/community/members/hwan/default.aspx</uri></author><category term="Web.UI" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/Web.UI/default.aspx" /><category term="Themes" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/Themes/default.aspx" /><category term="2010.1" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/2010.1/default.aspx" /></entry><entry><title>Introducing Recurring Appointments for Web.UI Scheduler ASP.NET AJAX</title><link rel="alternate" type="text/html" href="/community/blogs/hwan/archive/2009/11/06/introducing-recurring-appointments-for-web-ui-scheduler-asp-net-ajax.aspx" /><id>/community/blogs/hwan/archive/2009/11/06/introducing-recurring-appointments-for-web-ui-scheduler-asp-net-ajax.aspx</id><published>2009-11-06T20:59:00Z</published><updated>2009-11-06T20:59:00Z</updated><content type="html">&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Web.UI 2009.2 saw the addition of the &lt;b&gt;Scheduler for ASP.NET AJAX&lt;/b&gt; control, which handled one-time Appointment objects.&amp;nbsp; With 2009.3 we have implemented RecurringAppointment objects, allowing one to define appointments that repeat and to fine tune the rules that describe that repetition pattern (&lt;i&gt;&lt;a href="http://docs.componentart.com/default.aspx?content=ComponentArt.Web.UI.AJAX.server/ComponentArt.Web.UI~ComponentArt.Web.UI.SchedulerRecurrencePattern.html"&gt;SchedulerRecurrencePattern&lt;/a&gt; &lt;/i&gt;objects).&amp;nbsp; Scheduler thus now contains two collection of objects, &lt;a href="http://docs.componentart.com/default.aspx?content=ComponentArt.Web.UI.AJAX.server/ComponentArt.Web.UI~ComponentArt.Web.UI.SchedulerAppointment.html" title="SchedulerAppointment"&gt;&lt;i&gt;Appointments&lt;/i&gt;&lt;/a&gt; and &lt;a href="http://docs.componentart.com/default.aspx?content=ComponentArt.Web.UI.AJAX.server/ComponentArt.Web.UI~ComponentArt.Web.UI.SchedulerRecurringAppointment.html" title="SchedulerRecurringAppointment"&gt;&lt;i&gt;RecurringAppointments&lt;/i&gt;&lt;/a&gt;.&amp;nbsp; Exceptions, appointments that would otherwise be a member of the RecurringAppointment occurrences, are kept in the Appointments collection.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; On the client Scheduler will examine its list of RecurringAppointments and dynamically generate Appointment instances, adding them temporarily to the Appointments list.&amp;nbsp; These will be marked by having their &lt;i&gt;instance&lt;/i&gt; property set to true and a non-empty &lt;i&gt;RecurringAppointmentID&lt;/i&gt;.&amp;nbsp; If an Appointment is found to have the same &lt;i&gt;Start&lt;/i&gt; and &lt;i&gt;RecurringAppointmentID&lt;/i&gt; as the potential instance it is considered an exception and the instance creation is skipped.&amp;nbsp; In this way deleted instances are emulated by setting the exception&amp;#39;s &lt;i&gt;visible&lt;/i&gt; property to false.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Client events that are raised on that instance (which will be Appointment events) will need to be handled by the developer, to determine whether the user meant to apply the changes to that instance (in which case it should become an exception Appointment) or to the series as a whole, in which case the changes will apply to the RecurringAppointment.&amp;nbsp; We do this in our &lt;a href="http://aspnetajax.componentart.com/control-specific/scheduler/features/recurring_appointments/Default.aspx" title="Recurring Appointments example"&gt;Recurring Appointments&lt;/a&gt; and &lt;a href="http://aspnetajax.componentart.com/control-specific/scheduler/programming/webservice_soaui/default.aspx" title="Webservice - SOA.UI"&gt;WebService - SOA.UI&lt;/a&gt; examples, in the Scheduler1_onAppointmentBeforeRemove() and AppointmentDialog_OnClose() event handlers.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ok, let&amp;#39;s take a look at how to make one of these new objects on the client.&amp;nbsp; For this exercise I&amp;#39;ll take some of the code from the &lt;a href="http://aspnetajax.componentart.com/control-specific/scheduler/programming/clientside_api/default.aspx" title="Client-side API"&gt;Client-side API&lt;/a&gt; example and describe what&amp;#39;s going on in detail.&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp; Create the object and give it an ID.&amp;nbsp; This ID will be used to track the RecurringAppointment&amp;#39;s events so not having one isn&amp;#39;t much of an option.&lt;/p&gt;
&lt;pre style="border:1px solid #a0a0a0;margin:5px;padding:5px;font-family:courier new;background-color:#e2e2e2;"&gt;&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; recurringAppointment2 = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ComponentArt_SchedulerRecurringAppointment();&lt;br /&gt;
recurringAppointment2.set_id(&amp;#39;R02&amp;#39;);&lt;br /&gt;
&lt;/pre&gt;
&lt;p&gt;2.&amp;nbsp; Specify the range (ie. span of time) that the RecurringAppointment will apply to, which for these objects is defined in a Period object.&amp;nbsp; When creating a ComponentArt_Period you can give it the &lt;i&gt;StartDateTime&lt;/i&gt; and &lt;i&gt;Duration&lt;/i&gt; in the constructor to save some typing.&amp;nbsp; Don&amp;#39;t forget that the months of JavaScript Date are 0-based indexed!&lt;/p&gt;
&lt;pre style="border:1px solid #a0a0a0;margin:5px;padding:5px;font-family:courier new;background-color:#e2e2e2;"&gt;&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; range1 = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ComponentArt_Period(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;Date&lt;/span&gt;(2009,10,2,0,0,0), 1000*60*60*24*5);&lt;br /&gt;
recurringAppointment2.set_range(range1);&lt;/pre&gt;
&lt;p&gt;3.&amp;nbsp; Describe how the appointment instances should be repeated over the range.&amp;nbsp; In this example we&amp;#39;ll use an &lt;i&gt;OccurrenceType&lt;/i&gt; of Weekly, with an &lt;i&gt;Interval&lt;/i&gt; of 1 (ie. happening every week) and have the appointment happen on Mondays and Thursdays (1 and 4).&lt;/p&gt;
&lt;pre style="border:1px solid #a0a0a0;margin:5px;padding:5px;font-family:courier new;background-color:#e2e2e2;"&gt;&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; pattern1 = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ComponentArt_SchedulerRecurrencePattern();&lt;br /&gt;
pattern1.set_interval(1);&lt;br /&gt;
pattern1.set_occurrenceType(2); &lt;span style="color:#008000;"&gt;// 2:weekly&lt;/span&gt;&lt;br /&gt;
pattern1.set_daysOfWeek([1, 4]);&lt;br /&gt;
recurringAppointment2.set_pattern(pattern1);&lt;br /&gt;
&lt;/pre&gt;
&lt;p&gt;4.&amp;nbsp; Define the Appointment that will be used as a template, whose properties will be copied by Scheduler into the appointment instances.&lt;/p&gt;
&lt;pre style="border:1px solid #a0a0a0;margin:5px;padding:5px;font-family:courier new;background-color:#e2e2e2;"&gt;&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; appointment2 = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ComponentArt_SchedulerAppointment();&lt;br /&gt;
appointment2.set_appointmentID(&amp;#39;R02_0&amp;#39;);&lt;br /&gt;
appointment2.set_start(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;Date&lt;/span&gt;(2009, 10, 2, 16, 0, 0));&lt;br /&gt;
appointment2.set_duration(1000 * 60 * 45);  &lt;span style="color:#008000;"&gt;// 45 minutes&lt;/span&gt;&lt;br /&gt;
appointment2.set_title(&amp;#39;Swimming&amp;#39;);&lt;br /&gt;
appointment2.set_description(&amp;#39;&amp;#39;);&lt;br /&gt;
recurringAppointment2.set_appointment(appointment2);&lt;br /&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp; Hopefully this gives you a better understanding of our approach to repeated appointments.&amp;nbsp; Thanks for reading!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.componentart.com/community/aggbug.aspx?PostID=95885" width="1" height="1"&gt;</content><author><name>hwan</name><uri>http://www.componentart.com/community/members/hwan/default.aspx</uri></author><category term="Scheduler RecurringAppointments" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/Scheduler+RecurringAppointments/default.aspx" /></entry><entry><title>Web.UI ASP.NET Grid: Synchronize Checkbox States with Row Selection</title><link rel="alternate" type="text/html" href="/community/blogs/hwan/archive/2009/06/15/web-ui-asp-net-grid-synchronize-checkbox-states-with-row-selection.aspx" /><id>/community/blogs/hwan/archive/2009/06/15/web-ui-asp-net-grid-synchronize-checkbox-states-with-row-selection.aspx</id><published>2009-06-16T00:00:00Z</published><updated>2009-06-16T00:00:00Z</updated><content type="html">One can use the Grid&amp;#39;s itemBeforeCheckChange and itemBeforeSelect client events to synchronize the state of checkboxes and row selection.  Some extra logic is required since checkbox clicks also trigger row selection.  I use the load client event is used to initially set all checked rows as selected.  The code here I used on the &lt;a href="http://aspnetajax.componentart.com/control-specific/grid/editing/editing_dataClientMode/WebForm1.aspx"&gt;Grid Editing - Client Mode&lt;/a&gt; example, after adding DataField &amp;quot;Discontinued&amp;quot; as a boolean ColumnType=&amp;quot;CheckBox&amp;quot; GridColumn.&lt;br /&gt;
&lt;br /&gt;
ASPX:
&lt;pre style="border:1px solid #a0a0a0;font-family:courier new;background-color:#e2e2e2;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Grid1&amp;quot;&lt;/span&gt; ...&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Columns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;GridColumn&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;DataField&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Discontinued&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ColumnType&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;CheckBox&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
....
  &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ClientEvents&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;itemBeforeCheckChange&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;eventhandler&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Grid1_onItemBeforeCheckChange&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;itemBeforeSelect&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;eventhandler&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Grid1_onItemBeforeSelect&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;load&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;eventhandler&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Grid1_onLoad&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
JS:
&lt;pre style="border:1px solid #a0a0a0;font-family:courier new;background-color:#e2e2e2;"&gt;&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; checkboxClick = &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;
&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; rowClick = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;
&lt;span style="color:#0000ff;"&gt;function&lt;/span&gt; Grid1_onItemBeforeCheckChange(sender, e)
{
  checkboxClick = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;
}
&lt;span style="color:#0000ff;"&gt;function&lt;/span&gt; Grid1_onItemBeforeSelect(sender, e)
{
  &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (checkboxClick)
  {
    checkboxClick = &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;
    e.set_cancel(&lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;);
    &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (e.get_item().getMember(&amp;#39;Discontinued&amp;#39;).get_value())
    {
      rowClick = &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;
      sender.select(e.get_item(), &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;)
    }
    &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
    {
      rowClick = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;
      sender.unSelect(e.get_item());
    }
  }
  &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
  {
    &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (rowClick)
    {
      rowClick = &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;
      e.set_cancel(&lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;);
      &lt;span style="color:#008000;"&gt;// 6 is the column index of DataField &amp;quot;Discontinued&amp;quot;&lt;/span&gt;
      e.get_item().setValue(6, !e.get_item().getMember(&amp;#39;Discontinued&amp;#39;).get_value());
      sender.select(e.get_item(), &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;)
    }
    rowClick = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;
  }
}
&lt;span style="color:#0000ff;"&gt;function&lt;/span&gt; Grid1_onLoad(sender, e)
{
  &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; table = sender.get_table();
  sender.beginUpdate();
  &lt;span style="color:#0000ff;"&gt;for&lt;/span&gt; (i=0;i&amp;lt;table.getRowCount();i++)
  {
    &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (table.getRow(i).getMember(&amp;#39;Discontinued&amp;#39;).get_value())
    {
      rowClick = &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;
      sender.select(table.getRow(i), &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;);
    }
  }
  sender.endUpdate();
}
&lt;/pre&gt;
&lt;br /&gt;
If you want selection to ONLY be done via the checkboxes, then modify the Grid1_onItemBeforeSelect client event handler to cancel user clicks.
&lt;br /&gt;
JS:
&lt;pre style="border:1px solid #a0a0a0;font-family:courier new;background-color:#e2e2e2;"&gt;&lt;span style="color:#0000ff;"&gt;function&lt;/span&gt; Grid1_onItemBeforeSelect(sender, e)
{
  &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (checkboxClick)
  {
    checkboxClick = &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;
    e.set_cancel(&lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;);
    &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (e.get_item().getMember(&amp;#39;Discontinued&amp;#39;).get_value())
    {
      rowClick = &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;
      sender.select(e.get_item(), &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;)
    }
    &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
    {
      rowClick = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;
      sender.unSelect(e.get_item());
    }
  }
  &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
  {
    &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (rowClick)
    {
      e.set_cancel(&lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;);
    }
    rowClick = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;
  }
}
&lt;/pre&gt;
&lt;p style="font-size:smaller;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.componentart.com/community/aggbug.aspx?PostID=91421" width="1" height="1"&gt;</content><author><name>Hwan</name><uri>http://www.componentart.com/community/members/Hwan/default.aspx</uri></author><category term="grid" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/grid/default.aspx" /><category term="JavaScript" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/JavaScript/default.aspx" /><category term="Web.UI Grid" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/Web.UI+Grid/default.aspx" /><category term="Web.UI" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/Web.UI/default.aspx" /></entry><entry><title>Web.UI ASP.NET Grid: Retrieve the filtered set of rows in Client RunningMode</title><link rel="alternate" type="text/html" href="/community/blogs/hwan/archive/2009/03/19/retrieve-the-filtered-set-of-rows-in-client-runningmode.aspx" /><id>/community/blogs/hwan/archive/2009/03/19/retrieve-the-filtered-set-of-rows-in-client-runningmode.aspx</id><published>2009-03-19T23:09:00Z</published><updated>2009-03-19T23:09:00Z</updated><content type="html">Currently the Grid doesn&amp;#39;t expose the filtered set of GridItems after a search/filter action, preventing operations from being applied exclusively to that set of rows.  Until Grid provides a method to access these, you can build your own set of filtered items by using the undocumented gridLevel FilterExpression property.&lt;br /&gt;
&lt;br /&gt;
eg.&lt;br /&gt;
JS:
&lt;pre style="border:1px solid #a0a0a0;font-family:courier new;background-color:#e2e2e2;"&gt;&lt;span style="color:#0000ff;"&gt;function&lt;/span&gt; getFilteredRows(grid)
{
    &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; table = grid.get_table();
    &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; filteredRows = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;Array&lt;/span&gt;();
    &lt;span style="color:#0000ff;"&gt;for&lt;/span&gt; (i=0;i&amp;lt;table.getRowCount();i++)
    {
      &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; DataItem = table.getRow(i);
      &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;eval&lt;/span&gt;(grid.Levels[0]. F i l t e r E x p r e s s i o n ))
      {
        filteredRows[filteredRows.&lt;span style="color:#0000ff;"&gt;length&lt;/span&gt;] = DataItem;
      }
    }
    &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; filteredRows;
}
&lt;/pre&gt;
You could then grab the filtered items (after a search/filter action) with something like&lt;br /&gt;
JS:
&lt;pre style="border:1px solid #a0a0a0;font-family:courier new;background-color:#e2e2e2;"&gt;&amp;nbsp;
&lt;span style="color:#008000;"&gt;// grab the first search result&amp;#39;s text in column 3&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;alert&lt;/span&gt;(getFilteredRows(Grid1)[0].getMemberAt(3).get_text());
&amp;nbsp;
&lt;/pre&gt;
&lt;p style="font-size:smaller;"&gt;
Note: You&amp;#39;ll have to remove the spaces from the &amp;quot; F i l t e r E x p r e s s i o n &amp;quot; above, as our blog software doesn&amp;#39;t permit this string in codeblocks.
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.componentart.com/community/aggbug.aspx?PostID=88001" width="1" height="1"&gt;</content><author><name>Hwan</name><uri>http://www.componentart.com/community/members/Hwan/default.aspx</uri></author><category term="grid" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/grid/default.aspx" /><category term="Web.UI" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/Web.UI/default.aspx" /></entry><entry><title>Convert Web.UI ASP.NET Grid into a data entry spreadsheet</title><link rel="alternate" type="text/html" href="/community/blogs/hwan/archive/2009/03/12/give-web-ui-grid-data-entry-spreadsheet-behavior.aspx" /><id>/community/blogs/hwan/archive/2009/03/12/give-web-ui-grid-data-entry-spreadsheet-behavior.aspx</id><published>2009-03-12T22:19:00Z</published><updated>2009-03-12T22:19:00Z</updated><content type="html">&lt;span&gt;
Using client templates and some JavaScript one can change Web.UI Grid&amp;#39;s editing interface to behave more like a data entry spreadsheet.&amp;nbsp; I started from the code suggestions given in &lt;a href="http://www.componentart.com/kb/article.aspx?id=10111"&gt;Q10111 - HOWTO: Create a Microsoft Excel spreadsheet-like Grid&lt;/a&gt; and added keystroke handling for adding new rows and moving up and down between editable cells (Up Arrow and Down Arrow to go up and down, Tab and Shift+Tab to go right and left).&amp;nbsp; I also added a delete template (a clickable X) so that users could easily remove rows.  In my example I start with a blank Grid which is initially populated in the load client-event with a blank row.&lt;br /&gt;
&lt;br /&gt;
ASPX:&lt;br /&gt;
&lt;pre style="border:1px solid black;margin:4px;padding:4px;font-family:courier new;background-color:#e2e2e2;width:680px;overflow-y:auto;overflow-x:scroll;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Grid1&amp;quot;&lt;/span&gt;
&lt;span style="color:#ff0000;"&gt;AllowTextSelection&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;
.... &lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ClientEvents&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;load&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;eventhandler&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Grid1_onLoad&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ClientEvents&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Levels&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;GridLevel&lt;/span&gt;
        .... &lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Columns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;GridColumn&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;DataCellClientTemplateId&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;DeleteCellTemplate&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;GridColumn&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;DataField&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;ProductName&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;DataCellClientTemplateId&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;EditCellTemplate&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;GridColumn&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;DataField&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;UnitPrice&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;DataCellClientTemplateId&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;EditCellTemplate&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;GridColumn&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;DataField&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;UnitsInStock&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;DataCellClientTemplateId&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;EditCellTemplate&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Columns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;GridLevel&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Levels&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ClientTemplates&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;ClientTemplate&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Id&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;EditCellTemplate&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;input&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;style&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;border-style:none;width:## DataItem.getCurrentMember().get_column().get_width() ##px;&amp;quot;&lt;/span&gt;
            &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;textbox_## DataItem.get_index() ##_## DataItem.getCurrentMember().get_column().get_dataField() ##&amp;quot;&lt;/span&gt;
            &lt;span style="color:#ff0000;"&gt;type&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;text&amp;quot;&lt;/span&gt;
            &lt;span style="color:#ff0000;"&gt;value&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;## DataItem.getCurrentMember().get_value() ##&amp;quot;&lt;/span&gt;
            &lt;span style="color:#ff0000;"&gt;onfocus&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;this.select();editingTextboxId = this.id;editingClientId = &amp;#39;## DataItem.ClientId ##&amp;#39;;
            editingDataField = &amp;#39;## DataItem.getCurrentMember().get_column().get_dataField() ##&amp;#39;;
            editingIndexRow = ## DataItem.get_index() ##;&amp;quot;&lt;/span&gt;
            &lt;span style="color:#ff0000;"&gt;onKeyDown&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;return EditField_onKeyPress(event)&amp;quot;&lt;/span&gt;
            &lt;span style="color:#ff0000;"&gt;onBlur&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;saveCell(&amp;#39;## DataItem.ClientId ##&amp;#39;, &amp;#39;## DataItem.getCurrentMember().get_column().get_dataField() ##&amp;#39;, this.value);&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;ClientTemplate&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;ClientTemplate&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Id&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;DeleteCellTemplate&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;a&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;tabindex&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;-1&amp;quot;&lt;/span&gt;
            &lt;span style="color:#ff0000;"&gt;style&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;color:#f00;&amp;quot;&lt;/span&gt; 
            &lt;span style="color:#ff0000;"&gt;href&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;j__avascript:Grid1.deleteItem(Grid1.getItemFromClientId(&amp;#39;## DataItem.get_clientId() ##&amp;#39;));&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;X&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;a&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#c71585;"&gt;ComponentArt&lt;/span&gt;:&lt;span style="color:#800000;"&gt;ClientTemplate&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ClientTemplates&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;
JS:
&lt;pre style="border:1px solid black;margin:4px;padding:4px;font-family:courier new;background-color:#e2e2e2;width:680px;overflow-y:auto;overflow-x:scroll;"&gt;&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; editingIndexRow = -1;
&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; editingTextboxId = &amp;quot;&lt;span style="color:#8b0000;"&gt;&lt;/span&gt;&amp;quot;;
&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; editingClientId = &amp;quot;&lt;span style="color:#8b0000;"&gt;&lt;/span&gt;&amp;quot;;
&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; editingDataField = &amp;quot;&lt;span style="color:#8b0000;"&gt;&lt;/span&gt;&amp;quot;;
&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; firstEditableDataField = &amp;quot;&lt;span style="color:#8b0000;"&gt;ProductName&lt;/span&gt;&amp;quot;;

&lt;span style="color:#0000ff;"&gt;function&lt;/span&gt; Grid1_onLoad(sender, e)
{
	Grid1_addRow();
}
&lt;span style="color:#0000ff;"&gt;function&lt;/span&gt; saveCell(itemId, columnField, newValue)
{
	&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; row = Grid1.GetRowFromClientId(itemId);
	&lt;span style="color:#008000;"&gt;// Check if value was changed&lt;/span&gt;
	&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; oldValue = row.GetMember(columnField).Value;
	&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (oldValue != newValue)
	{
	&lt;span style="color:#008000;"&gt;// Get column index for SetValue&lt;/span&gt;
		&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; col = 0;
		&lt;span style="color:#0000ff;"&gt;for&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; i=0;i&amp;lt;Grid1.Table.Columns.&lt;span style="color:#0000ff;"&gt;length&lt;/span&gt;;i++)
		{
			&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (Grid1.Table.Columns[i].DataField == columnField)
			{
				col = i;
				&lt;span style="color:#0000ff;"&gt;break&lt;/span&gt;;
			}
		}
		row.SetValue(col, newValue, &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;);
	}
	&lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;
}
&lt;span style="color:#0000ff;"&gt;function&lt;/span&gt; Grid1_addRow()
{
	&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; col = 0;
	&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (Grid1.get_table().getRowCount() &amp;gt; 0)
	{
		&lt;span style="color:#008000;"&gt;// cancel adding row if there is already a blank one&lt;/span&gt;
		&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; row = Grid1.get_table().getRow(Grid1.get_table().getRowCount()-1);
		&lt;span style="color:#0000ff;"&gt;for&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; i=0;i&amp;lt;Grid1.Table.Columns.&lt;span style="color:#0000ff;"&gt;length&lt;/span&gt;;i++)
		{
			&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (row.getMemberAt(i).get_text() != &amp;quot;&lt;span style="color:#8b0000;"&gt;&lt;/span&gt;&amp;quot;)
			{
				Grid1.get_table().addRow();
				&lt;span style="color:#0000ff;"&gt;break&lt;/span&gt;;
			}
		}
	}
	&lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
	{
		Grid1.get_table().addRow();
	}
	&lt;span style="color:#0000ff;"&gt;setTimeout&lt;/span&gt;(&amp;quot;&lt;span style="color:#8b0000;"&gt;setTextboxFocus();&lt;/span&gt;&amp;quot;, 100);
}
&lt;span style="color:#0000ff;"&gt;function&lt;/span&gt; setTextboxFocus(datafield, index)
{
	&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt; datafield == &amp;quot;&lt;span style="color:#8b0000;"&gt;undefined&lt;/span&gt;&amp;quot;) datafield = firstEditableDataField;
	&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt; index == &amp;quot;&lt;span style="color:#8b0000;"&gt;undefined&lt;/span&gt;&amp;quot;) index = Grid1.get_recordCount() - Grid1.get_recordOffset() - 1;
	&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; elementId = &amp;quot;&lt;span style="color:#8b0000;"&gt;textbox_&lt;/span&gt;&amp;quot; + index + &amp;quot;&lt;span style="color:#8b0000;"&gt;_&lt;/span&gt;&amp;quot; + datafield;
	&lt;span style="color:#0000ff;"&gt;try&lt;/span&gt;
	{
		&lt;span style="color:#0000ff;"&gt;document&lt;/span&gt;.getElementById(elementId).&lt;span style="color:#0000ff;"&gt;focus&lt;/span&gt;();
	}
	&lt;span style="color:#0000ff;"&gt;catch&lt;/span&gt; (err)
	{
	}
}

&lt;span style="color:#0000ff;"&gt;function&lt;/span&gt; EditField_onKeyPress(e)
{
	&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt;(!e) e = &lt;span style="color:#0000ff;"&gt;window&lt;/span&gt;.event;
	key = e.keyCode ? e.keyCode : e.which;
	&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (key == 13) &lt;span style="color:#008000;"&gt;//enter&lt;/span&gt;
	{
		saveCell(editingClientId, editingDataField, &lt;span style="color:#0000ff;"&gt;document&lt;/span&gt;.getElementById(editingTextboxId).value);
		Grid1_addRow();
	}
	&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (key == 38) &lt;span style="color:#008000;"&gt;//up&lt;/span&gt;
	{
		&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; index = editingIndexRow - 1;
		&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (index &amp;gt; -1)
		{
			editingIndexRow = index;
			saveCell(editingClientId, editingDataField, &lt;span style="color:#0000ff;"&gt;document&lt;/span&gt;.getElementById(editingTextboxId).value);
			setTextboxFocus(editingDataField, index);
		}
	}
	&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (key == 40) &lt;span style="color:#008000;"&gt;//down&lt;/span&gt;
	{
		&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; index = editingIndexRow + 1;
		&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (index &amp;lt; Grid1.get_pageSize())
		{
			editingIndexRow = index;
			saveCell(editingClientId, editingDataField, &lt;span style="color:#0000ff;"&gt;document&lt;/span&gt;.getElementById(editingTextboxId).value);
			setTextboxFocus(editingDataField, index);
		}
	}
}&lt;/pre&gt;
&lt;br /&gt;
Here&amp;#39;s a screenshot of what the Grid will look like:&lt;br /&gt;
&lt;div style="border:1px solid black;margin:4px;padding:4px;width:680px;overflow-y:auto;overflow-x:scroll;"&gt;
&lt;img alt="Web.UI Grid using DataCell client templates" src="http://www.componentart.com/blogs/hwan/images/data_entry_spreadsheet_grid.png" title="Web.UI Grid using DataCell client templates" /&gt;
&lt;/div&gt;
&lt;a href="http://www.componentart.com/blogs/hwan/images/editing_dataClientMode07_excel_textentry.zip"&gt;Download the code for this example&lt;/a&gt; (8.56 KB)&lt;br /&gt;&lt;br /&gt;
&lt;p style="font-size:smaller;"&gt;
Notes:&lt;br /&gt;
i. I tested against Internet Explore 7, Firefox 3, Chrome, Safari and Opera.  I set UseSubmitBehavior to false on the ASP Button so that a postback doesn&amp;#39;t occur when the user hits Enter, but this doesn&amp;#39;t seem to work in Chrome or Safari.  The Grid functionality should otherwise be identical across these browsers.&lt;br /&gt;
ii. I save cell data whenever key navigation occurs since the Up/Down/Enter strokes won&amp;#39;t raise the blur event.&lt;br /&gt;
iii. I had considered adding Left/Right Arrow navigation but that would require remembering which column is currently in focus, which would greatly complicate things so I opted not to.&lt;br /&gt;
iv. The &amp;quot;save changes&amp;quot; ASP Button simply loops through the Items collection on the server and outputs their values so that you can get an idea of how to store the edits.&lt;br /&gt;
v. I give a tabindex of -1 to the DeleteCellTemplate anchor so that it&amp;#39;s skipped during Tab navigation.&lt;br /&gt;
vi.  In the JS section above you&amp;#39;ll need to remove the underscores from &amp;quot;j__avascript&amp;quot; as our blog software doesn&amp;#39;t allow that string.&lt;br /&gt;
&lt;/p&gt;
&lt;/span&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.componentart.com/community/aggbug.aspx?PostID=87804" width="1" height="1"&gt;</content><author><name>Hwan</name><uri>http://www.componentart.com/community/members/Hwan/default.aspx</uri></author><category term="grid" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/grid/default.aspx" /><category term="JavaScript" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/JavaScript/default.aspx" /><category term="Web.UI" scheme="http://www.componentart.com/community/blogs/hwan/archive/tags/Web.UI/default.aspx" /></entry></feed>
