﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - SetSelectedIndex</title><link>http://www.intersoftsolutions.com/Community/Tags/SetSelectedIndex/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Webcombo clientside Row collection manipulation</title><link>http://www.intersoftsolutions.com/Community/Tags/SetSelectedIndex/</link><pubDate>Wed, 06 Mar 2013 14:17:28 GMT</pubDate><dc:creator>sinan.biondic@gmail.com</dc:creator><category>WebCombo</category><category>SetSelectedIndex</category><category>clientside</category><category>row</category><category>slient-side</category><category>collection</category><category>manipulation</category><category>selectedindex</category><category>getrows</category><description>&lt;p&gt;I'm having problems retrieving row colection from webcombo. My combo is serverside binded, and in clientside pageload event I'm trying to get rows from combo. However i get nothing from method GetRows(). Applying filters is working fine but variable rows is null, and setselectedindex(1) does nothing.&lt;/p&gt;&lt;pre&gt;function setComboFilter(idMenu) {
    var combo = ISGetObject('cmbGodina');
    var rows = combo.getRows();
    combo.ClearAdditionalFilters();
    combo.SetAdditionalFilters("[IdRedaMenu] = " &amp;#43; idMenu);
    combo.SetSelectedRowByValue(String(idMenu));
    combo.SetSelectedIndex(1);
}&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>WebCombo 4 Client Calls SetSelectedIndex And SetSelectedRowByValue Fail Crash</title><link>http://www.intersoftsolutions.com/Community/Tags/SetSelectedIndex/</link><pubDate>Fri, 08 Jan 2010 09:18:58 GMT</pubDate><dc:creator>PRISMAY</dc:creator><category>WebCombo</category><category>javascript</category><category>Client Side Events</category><category>crash</category><category>SetSelectedIndex</category><category>Client</category><description>&lt;p&gt;I have a custom date control made of 3 components: WebCombo and two WebInput calendars.  The WebCombo gives the user a preset number of options that automatically set the calendars, i.e., Yesterday, Last Week, This Month, etc.&lt;/p&gt;
&lt;p&gt;When the user directly sets the dates via the calendars, then we want to automatically set the combo's range type selection to our "Custom" selection.  I'm doing that via a workaround using the code below:&lt;/p&gt;&lt;pre&gt;oIsCbo.SelectedIndex = i;
oIsCbo.SetValue(oDRT.dateRangeTypeId);
oIsCbo.SetTextBoxValue(oDRT.dateRangeTypeName);&lt;/pre&gt;

&lt;p&gt;I'm using this workaround because both SetSelectedIndex and SetSelectedRowByValue crash when called.  Both calls cause the javascript runtime error of "'this.Column.BaseFieldName' is null or not an object."  I'm using an unbound combo and all the UI elements do not post back so everything is done client-side.  We don't want a simple control like this to constantly post back on every little user change.&lt;/p&gt;
&lt;p&gt;Here's how our PrismComboBox (derives from &lt;span style="font-size: 10pt"&gt;ISNet.WebUI.WebCombo.&lt;span style="color: #2b91af"&gt;&lt;span style="color: #2b91af"&gt;WebCombo&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;) is set up:&lt;/p&gt;&lt;pre&gt;this.AllowWildCardSearch = true;
this.EnableViewState = true;
this.Items = new PrismComboBoxItems();
this.Items.ComboBox = this;
this.SelectedItem = new PrismComboBoxSelectedItem();
this.SelectedItem.ComboBox = this;
this.LayoutSettings.AllowAddItem = false;
this.LayoutSettings.AllowFloatingText = false;
this.LayoutSettings.AllowNavigationOnMouseWheel = true;
this.LayoutSettings.AllowTextWrapping = false;
this.LayoutSettings.AlwaysShowAllRowsOnDropdown = true;
this.LayoutSettings.AlwaysShowColumnHeaders = false;
this.LayoutSettings.AlwaysShowHelpButton = false;
this.LayoutSettings.AlwaysShowResultBox = false;
this.LayoutSettings.AlwaysShowSearchButton = true;
this.LayoutSettings.AutoColumnOrdering = false;
this.LayoutSettings.ComboMode = ISNet.WebUI.WebCombo.Mode.SingleColumn;
this.LayoutSettings.EnableAnimation = true;
this.LayoutSettings.EnableSlidingAnimation = true;
this.LayoutSettings.EntryMode = ISNet.WebUI.WebCombo.EntryMode.AutoComplete;
this.LayoutSettings.NoResultFoundAction = ISNet.WebUI.WebCombo.NoResultFoundAction.RevertSelection;
this.LayoutSettings.SearchIconMode = ISNet.WebUI.WebCombo.SearchMode.Text;
this.LayoutSettings.TextBoxMode = ISNet.WebUI.WebCombo.TextboxMode.Editable;
this.UseDefaultStyle = false;
this.SelectionRequired = false;
&lt;/pre&gt;

&lt;p&gt;Here's how the combo box is further configured and populated in our PrismDateRange control:&lt;/p&gt;&lt;pre&gt;m_ComboboxRangeType.ID = "ComboBoxRangeType";
m_ComboboxRangeType.AutoPostBack = AutoPostBack;
m_ComboboxRangeType.SelectedIndexChanged &amp;#43;= new EventHandler(m_ComboboxRangeType_SelectedIndexChanged);
m_ComboboxRangeType.PreRender &amp;#43;= new EventHandler(m_ComboboxRangeType_PreRender);
m_ComboboxRangeType.Enabled = this.Enabled;
m_ComboboxRangeType.DropDownRows = 50;

m_ComboboxRangeType.Width = Unit.Percentage(100);
m_ComboboxRangeType.LayoutSettings.StatusBoxVisible = false;

m_ComboboxRangeType.LayoutSettings.ResultBoxShadow = false;
m_ComboboxRangeType.LayoutSettings.ResultBoxWindowType = ISNet.WebUI.DisplayType.Normal;

m_ComboboxRangeType.Enabled = true;
m_ComboboxRangeType.insertBlankRow = false;
m_ComboboxRangeType.DataValueField = "dateRangeTypeID";
m_ComboboxRangeType.DataTextField = "dateRangeTypeName";

ISNet.WebUI.WebCombo.WebComboColumn colText = new ISNet.WebUI.WebCombo.WebComboColumn();
colText.BaseFieldName = m_ComboboxRangeType.DataTextField;
colText.Bound = false;
colText.ColumnType = ISNet.WebUI.WebCombo.ColumnType.Text;
colText.DataType = "System.String";
colText.Hidden = false;
colText.Name = m_ComboboxRangeType.DataTextField;

ISNet.WebUI.WebCombo.WebComboColumn colValue = new ISNet.WebUI.WebCombo.WebComboColumn();
colValue.BaseFieldName = m_ComboboxRangeType.DataValueField;
colValue.Bound = false;
colValue.ColumnType = ISNet.WebUI.WebCombo.ColumnType.Text;
colValue.DataType = "System.String";
colValue.Hidden = true;
colValue.RenderOnHidden = true;
colValue.Name = m_ComboboxRangeType.DataValueField;

m_ComboboxRangeType.Columns.Add(colText);
m_ComboboxRangeType.Columns.Add(colValue);

m_ComboboxRangeType.PopulateUnboundData(GetTypeTable(),false);

if (CPRISMStrLib.IsVs(ReportCategoryId))
{
    m_ComboboxRangeType.Value = CPRISMStrLib.GetStr(GetDefTable().Rows[0]["defaultDateRangeTypeID"]);
    m_ComboboxRangeType.SelectedValue = m_ComboboxRangeType.Value;
}
&lt;/pre&gt;

&lt;p&gt;I've attached a couple falsh videos of the issue while running in debug mode.  The first one shows the crash when SetSelectedIndex is hit and the value of this.Column.  The second one breaks into my javascript code and also shows the result of SetSelectedRowByDefault in the watch window as well as continuing on and the crash of SetSelectedIndex.&lt;/p&gt;
&lt;p&gt;As you can see above, the BaseFieldName is set up so I'm not sure why all that is empty on the client side, i.e., this.Column and so on.  Let me know if you need anything else.&lt;/p&gt;
&lt;p&gt;I'm in a bind to get this working please so I can really use a fast resolution.  Thanks a lot.&lt;/p&gt;</description></item></channel></rss>