Let's say I have 2 classes, Employee and State (reference the code below for further details), and I set the Employee.stateID, upon the setter being set, how can I get the StateName, i.e. State.stateName? Thank you in advance for any assistance!
----- Employee Class -----
public class Employee...
Here's my scenario: Work in a C# 2.0 environment with our view layer bound to a business logic layer of objects.
Here is what I'm attempting to do: Upon a form loading, user picks a value from a combobox and it brings back a collection of values. These values, I would like them to populate...
I am using C#2.0 in a Windows Application and trying to validate a TextBox on its Validating Event. What I am basically looking for is to see if the value entered is a decimcal. Looks to be working but when I delete the contents of the TextBox, i.e. no value in there, the cursor cannot leave...
I am using C# 2.0 in a Windows Forms platform - I am using the CellFormatting() Event to display certain rows of my DataGridView with a certain color depending on the value found in a certain column. This works great if the Column is Visible, but I don't want to display this Column to the end...
I am trying to recognize when the Cursor is over the Header. I have tried the following but it seems to change cursor anywhere within the DataGridView. Thanks for any help!
private void DataGridView1_MouseHover(object sender, EventArgs e)
{
if (DataGridView1.CurrentRow.Index == 0)
{...
Working on C# 2.0 Windows Forms with an MVC Pattern in place. I have a bunch of ComboBoxes that are bound to Business Object BindingSources, i.e. Collection BO. Everything works perfectly (CRUD) but I just noticed that if the User tries to update one of the ComboBoxes by deleting its value...
I have a TabControl in place and would like to have the selectedt tab to have bold text and the other tabs to be grayed out or not be so prevalent. I was trying something like this:
private void tabControl1_Selected(object sender, TabControlEventArgs e)
{
if...
I am trying to do some validating, and when a certain TextBox is filled an accompanying value from a ComboBox should also be chosen. How can I check if a value from my ComboBox has been picked from its original state, which is nothing from the list of values?
if (this.txtCity != null) // ***...
In my DataGridView, I would like the whole row to be of a unique color when the user is editing a cell on that row. I was thinking something like this:
private void dgv_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
dgv.CurrentRow ???
??? SelectionBackColor =...
I am trying to loop through the values of a ComboBox and it seems that when I use the following:
foreach (object item in this.Items)
it loops through the whole collection from the pertinent Business Object. I would only like to loop through the values given in the DisplayMember, e.g...
In my C# 2.0 Windows App, we are using the MVC pattern with everything bound to business objects. I have been creating UserControls where they might have 2-3 DataGridViews on them w/ Parent-Child-GrandChild relationships between them. For testing purposes, I have an initial form that feeds one...
I ran FxCop against my code and am wondering what the rest of you suggest regarding the message below.
So how does everyone name/categorize/organize their Forms (and other components)? For example, for Forms (frmSomeSample) or UserControls (ucSample)?
Thanks for any advice!
Error...
Problem: I would like the contents of my ComboBox to display entirely when the user clicks on the drop-down icon arrow, i.e. I do not want to only show the contents up the width of my combobox. So for long contents say 30 characters, and say my ComboBox is 15 characters long, then when user...
I am trying to update some data via a Windows Form using C# 2.0 and am receiving the following error when it reaches this line: command.Command.ExecuteNonQuery();
System.InvalidOperationException occurred
Message="Internal .Net Framework Data Provider error 30."...
I am trying to bind a CheckedListBox to an Object and when I execute the code, no data is displayed nor I get any errors.
This is what I have in my Type.cs file:
private void LoadTypes()
{
CheckedListBox clb = new CheckedListBox();
clb.Name = "clbType";
clb.Sorted = true...
I developing an app in C# 2005 and would like some advice on how I should go with my next step:
I have a Solution with a couple of projects in it from different developers (.dll) and some are mine. I need to implement some common functionality that will be used by other developers for some of...
I have a main form (frmMain) that displays a listbox (lboData) with values from a datasource. Upon a user double-clicking on a value from this list, another form, frmFeature, is displayed. This frmFeature contains a UserControl, ucFeature that is suppose to get the ID from the lboData from the...
I've been receiving some errors lately and have tried recreating my controls, but I seems to be getting the same error again!
Here's my scenario (in simplest terms): I have a simple form named frmV that has a UserControl named ucComp1. I get the error when I Ctrl+F5: The variable 'ucComp1' is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.