﻿<?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 - WebCombo - WebCombo.SelectedRow is nothing when AutoPostBack</title><link>http://www.intersoftsolutions.com/Community/WebCombo/WebComboSelectedRow-is-nothing-when-AutoPostBack/</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.SelectedRow is nothing when AutoPostBack</title><link>http://www.intersoftsolutions.com/Community/WebCombo/WebComboSelectedRow-is-nothing-when-AutoPostBack/</link><pubDate>Mon, 01 Feb 2010 02:22:19 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Way Hang Wee,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; From what I see on you code, you have created a connection object by yourself which I am not sure on how its works. So in here, I attach you a simple running sample using a SqlConnection for you to modified it according to your scenario.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; I hope it helps and please do not hesitate to ask if you have any other questions. Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&amp;nbsp;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebCombo.SelectedRow is nothing when AutoPostBack</title><link>http://www.intersoftsolutions.com/Community/WebCombo/WebComboSelectedRow-is-nothing-when-AutoPostBack/</link><pubDate>Fri, 29 Jan 2010 02:46:02 GMT</pubDate><dc:creator>wayhang@elutions.com.my</dc:creator><description>&lt;p&gt;Hi Andi,&lt;/p&gt;
&lt;p&gt;I put the data binding in initialize data source but the data seems like not bound?&lt;/p&gt;
&lt;p&gt;Attached is the sample code.&lt;/p&gt;
&lt;p&gt;Pls advise.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;</description></item><item><title>WebCombo.SelectedRow is nothing when AutoPostBack</title><link>http://www.intersoftsolutions.com/Community/WebCombo/WebComboSelectedRow-is-nothing-when-AutoPostBack/</link><pubDate>Fri, 29 Jan 2010 01:50:27 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Way Hang Wee,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Thank you for your detail information. From what I see on your provided sample code, the value of WebCombo2 is not rendered because you put the data binding on page load. Would you kindly try to put the data binding not in the page load but in initialize data source. The value is null, perhaps, because after it do PostBack, it will do the data binding again. On intitialize data source, I suggest you to not use:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; "&gt;&lt;span style="font-size: 12px; " /&gt;&lt;/font&gt;&lt;/p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; "&gt;&lt;pre&gt;                .DataSource = dsDepartment.Tables(0)
                .DataValueField = "DepartmentCode"
                .DataTextField = "DepartmentName"
                .DataBind()&lt;/pre&gt;&lt;/font&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; "&gt;&lt;span style="font-size: 12px; " /&gt;&lt;/font&gt;&lt;/p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; "&gt;&lt;p&gt;&amp;nbsp;&lt;span style="font-size: 9pt; "&gt;Instead, I suggest you to use something like:&lt;/span&gt;&lt;/p&gt;&lt;p /&gt;&lt;pre&gt;                e.DataSource = dsDepartment.Tables(0)
                e.DataValueField = "DepartmentCode"
                e.DataTextField = "DepartmentName&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;span style="font-size: 9pt; "&gt;When you bind the data in initialize data source, you do no need to put .DataBind() anymore.&lt;/span&gt;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; I hope it helps and please let me know if it is solved. Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebCombo.SelectedRow is nothing when AutoPostBack</title><link>http://www.intersoftsolutions.com/Community/WebCombo/WebComboSelectedRow-is-nothing-when-AutoPostBack/</link><pubDate>Thu, 28 Jan 2010 03:40:10 GMT</pubDate><dc:creator>wayhang@elutions.com.my</dc:creator><description>&lt;p&gt;Hi Andi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I tested in the simple sample and it works. However in my project it doesn't work. I wonder it has to do with other component because i do have other component in my project which is WebTreeView.&lt;/p&gt;
&lt;p&gt;Attached is the modified simple sample with WebTreeView. There's a "script" folder to create the table and insert data.&lt;/p&gt;
&lt;p&gt;After i select record for WebCombo1 and WebCombo2, data will be populated in WebTreeView. When i check all the nodes in the WebTreeView and click the button, the system will insert data into database and PostBack. During PostBack, the WebCombo2.Value = "" but in fact there's selected record.&lt;/p&gt;
&lt;p&gt;Pls advise.&lt;/p&gt;</description></item><item><title>WebCombo.SelectedRow is nothing when AutoPostBack</title><link>http://www.intersoftsolutions.com/Community/WebCombo/WebComboSelectedRow-is-nothing-when-AutoPostBack/</link><pubDate>Wed, 27 Jan 2010 21:23:02 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Way Hang Wee,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Thank you for your detail informations. Now I know what is the issue in here. I have tried your scenarion and the code of yours is almost right. For our WebCombo, in order to get the selected row's value on back side, you can use, as this following code:&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;      WebCombo2.Value&lt;/pre&gt;
&lt;p&gt; &lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; We do not need to use SelectedRow property again. I have tried it and it worked properly. I hope it helps and please do not hesitate to ask if you have any other questions. Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>WebCombo.SelectedRow is nothing when AutoPostBack</title><link>http://www.intersoftsolutions.com/Community/WebCombo/WebComboSelectedRow-is-nothing-when-AutoPostBack/</link><pubDate>Wed, 27 Jan 2010 00:44:03 GMT</pubDate><dc:creator>wayhang@elutions.com.my</dc:creator><description>&lt;p&gt;Attached is a simple sample i did.&lt;/p&gt;
&lt;p&gt;After i selected record in WebCombo1 &amp; WebCombo2, then i click the AutoPostBack button.&lt;/p&gt;
&lt;p&gt;In Page_Load event, i'm not able to get WebCombo2.SelectedRow.Value.&lt;/p&gt;
&lt;p&gt;Pls advise.&lt;/p&gt;</description></item><item><title>WebCombo.SelectedRow is nothing when AutoPostBack</title><link>http://www.intersoftsolutions.com/Community/WebCombo/WebComboSelectedRow-is-nothing-when-AutoPostBack/</link><pubDate>Wed, 27 Jan 2010 00:04:51 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Hi Way Hang Wee,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sorry but I am having a trouble to replicate your issue. I have tried to summon a WebCombo with AllowAutoPostBack to true and in fact, I also use a FullPostBack Button to test if it will trigger the&amp;nbsp; random autopostback but the result is not, it work just fine in here. I attached you a sample code as well. I am wondering where was I missing. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Andi Santoso.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebCombo.SelectedRow is nothing when AutoPostBack</title><link>http://www.intersoftsolutions.com/Community/WebCombo/WebComboSelectedRow-is-nothing-when-AutoPostBack/</link><pubDate>Tue, 26 Jan 2010 04:44:08 GMT</pubDate><dc:creator>wayhang@elutions.com.my</dc:creator><description>&lt;p&gt;My WebCombo is set to AutoPostBack.&lt;/p&gt;
&lt;p&gt;When user selected a value in the WebCombo, the page will be autopostback multiple time. &lt;/p&gt;
&lt;p&gt;The 1st time it autopostback WebCombo.SelectedRow has the value, but the last time it autopostback WebCombo.SelectedRow is nothing.&lt;/p&gt;
&lt;p&gt;Pls advise.&lt;/p&gt;</description></item></channel></rss>