Click here to Skip to main content
15,889,830 members
Home / Discussions / C#
   

C#

 
GeneralRe: IO ports Pin
BrianCR899-Jun-05 6:27
BrianCR899-Jun-05 6:27 
GeneralRe: IO ports Pin
Niklas Ulvinge9-Jun-05 7:08
Niklas Ulvinge9-Jun-05 7:08 
GeneralAccess GDI+ Image pointer from unmanaged C++ dll... Pin
SpiderMan7-Jun-05 21:21
SpiderMan7-Jun-05 21:21 
GeneralRe: Access GDI+ Image pointer from unmanaged C++ dll... Pin
Andy Moore8-Jun-05 10:58
Andy Moore8-Jun-05 10:58 
GeneralHelp With a Combo Problem Pin
monica2k7-Jun-05 17:14
monica2k7-Jun-05 17:14 
GeneralRe: Help With a Combo Problem Pin
Christian Graus7-Jun-05 17:16
protectorChristian Graus7-Jun-05 17:16 
GeneralRe: Help With a Combo Problem Pin
monica2k7-Jun-05 17:18
monica2k7-Jun-05 17:18 
GeneralRe: Help With a Combo Problem Pin
Christian Graus7-Jun-05 17:23
protectorChristian Graus7-Jun-05 17:23 
well, the page class has a property, IsPostback. That tells your page if you're viewing for the first time, or not. If you don't use this, and you set the datasource every time you load the page, including postback, you will lose your selected index, because it will revert to the first item of the data source you've just set. SO, when you set the data source and databind, you should first check if the page is being loaded for the first time. IF not, your ViewSate contains the contents of the control, as well as the selected Index, and you don't want to replace that.

if (!IsPostBack)
{
combo1.DataSource = GetDataSource();
combo1.DataBind();
}

Christian Graus - Microsoft MVP - C++
GeneralRe: Help With a Combo Problem Pin
monica2k7-Jun-05 17:36
monica2k7-Jun-05 17:36 
GeneralRe: Help With a Combo Problem Pin
Christian Graus7-Jun-05 17:55
protectorChristian Graus7-Jun-05 17:55 
GeneralRe: Help With a Combo Problem Pin
monica2k7-Jun-05 18:07
monica2k7-Jun-05 18:07 
GeneralRe: Help With a Combo Problem Pin
Christian Graus7-Jun-05 18:09
protectorChristian Graus7-Jun-05 18:09 
GeneralRe: Help With a Combo Problem Pin
monica2k7-Jun-05 18:10
monica2k7-Jun-05 18:10 
GeneralRe: Help With a Combo Problem Pin
Christian Graus7-Jun-05 18:12
protectorChristian Graus7-Jun-05 18:12 
GeneralRe: Help With a Combo Problem Pin
monica2k7-Jun-05 18:14
monica2k7-Jun-05 18:14 
GeneralRe: Help With a Combo Problem Pin
Christian Graus7-Jun-05 18:18
protectorChristian Graus7-Jun-05 18:18 
GeneralRe: Help With a Combo Problem Pin
monica2k7-Jun-05 18:21
monica2k7-Jun-05 18:21 
GeneralRe: Help With a Combo Problem Pin
Christian Graus7-Jun-05 18:25
protectorChristian Graus7-Jun-05 18:25 
GeneralRe: Help With a Combo Problem Pin
monica2k7-Jun-05 18:30
monica2k7-Jun-05 18:30 
GeneralRe: Help With a Combo Problem Pin
Robert Rohde7-Jun-05 19:34
Robert Rohde7-Jun-05 19:34 
GeneralRe: Help With a Combo Problem Pin
monica2k7-Jun-05 19:37
monica2k7-Jun-05 19:37 
GeneralRe: Help With a Combo Problem Pin
AfzalHassen7-Jun-05 23:32
AfzalHassen7-Jun-05 23:32 
GeneralRe: Help With a Combo Problem Pin
Robert Rohde8-Jun-05 7:03
Robert Rohde8-Jun-05 7:03 
GeneralRe: Help With a Combo Problem Pin
Christian Graus8-Jun-05 13:30
protectorChristian Graus8-Jun-05 13:30 
GeneralRe: Help With a Combo Problem Pin
monica2k8-Jun-05 13:35
monica2k8-Jun-05 13:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.