Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting Dataview rowfilter to combobox selectedvalue
Message
From
09/02/2006 17:29:15
 
 
To
09/02/2006 16:39:29
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01095270
Message ID:
01095290
Views:
9
The Combo's SelectedIndexChanged event *does* tend to fire before it should when you hook up the event handler from the PropertySheet. What I typically do is hook it up in the Load event handler (rather than in the constructor's InitializeComponent() method).

See if that helps ...

~~Bonnie




>Hello,
>
>On my form load in my winapp, I am loading a dataset, creating a dataview of that set, and binding a datagrid to the dataview.
>
>I am also loading a combobox with different statuses as the display, and a status value as the value. I want to filter the dataview based on that status value.
>
>I am unsure of where to put the rowfilter code. I tried to put it in the combobox.selectedindexchanged event, but I get this error:
>
>
>An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll
>
>Additional information: Cast from type 'DataRowView' to type 'String' is not valid.
>
>
>because I am assuming this event is firing when the form is created and my combobox isn't loaded yet.
>
>Anybody know what I am doing wrong, or how I can avoid the error?
>
>TIA,
> MAC
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform