In the following code, batch ends up being 201803.
The first alert shows: 201803.
The second alert shows "ddlYearBatch = ". Why doesn't the value for batch show? I also tried it without the toString and got the same result.
var batch;
batch =...
I have a collection of a class (List<EditGrid>). I am trying to find duplicates and found this online and it seemed pretty clean but I am getting an error:
Cannot convert type 'System.Collections.Generic.List<string>' to 'System.Collections.Generic.List<OrderManagement.EntityLayer.EditGrid>'...
I am trying to pivot my data by year and month. The pivot works fine, but it is in random order.
I can't seem to figure out how to order the data by the year and month.
var rows = source.GroupBy(rowSelector.Compile() )
.Select(rowGroup => new...
I have an event that uses a class selector for 10 textboxes.
I am checking to see if the value is numeric. If there is an error I am doing a this.focus() to go back to the textbox I just left. The problem is that end up getting 2 blur events.
For example, if I am on the 3rd textbox, enter a...
I am trying to figure out how to take some data from a datatable or class that could have 5 columns or could have 10 or 20 columns. This was created pivoting a table which gave me an unknown number of columns. But I can't figure out how to use Linq to handle this. Here is a sample set of code...
If I have the following list, how to I get the item (not the value) that has the smallest amount?
public class Car
{
public string Name { get; set; }
public int Year { get; set; }
public int Amount { get; set; }
public string Color { get; set; }
public string Status { get; set...
I have an xml file that I would like to publish to my publish folder. I put it in the root but it doesn't go to the publish folder. You used to be able to handle this in earlier versions of VS. But it doesn't seem to work here.
I don't want all my xml files to get published just a particular...
This is similar to my previous post where I am trying to resolve the issue of setting up a class then a collection of the class. But I am not calling it a List<class> but as a collection that inherits from that class.
It seems to work except when it actually assigns the collection.
I get this...
I have a class and a list<class> that I want to set up in the constructor. I want to fill the collection when I instantiate the object.
public class DotNetType
{
public string DatabaseDataType { get; set; }
public string DotNetDataType { get; set; }
}
public...
Is there a way to get an object by name?
I have tabs that are identical except for how they are used.
So I have a list box on each tab named by function: lbSelectName, lbInsertName, lbUpdataName, e.t.c.
I also know which tab I am on by enums: Select, Insert Update, e.t.c.
Is there a way to...
Is there a way to add a current tab to the tab control by name?
I currently have 7 tabs in my tab controls collection. I remove all the tabs from the collection at the start of the program and add in the ones I want based some criteria.
But I add them like so...
I am trying to access a ListBox right after I data bind to it and am getting an error that says it is empty. I assume it doesn't do it right away and is done somewhere down the line because the ListBox has data when the form comes back.
In the following code the SelectList has data in it when...
How do I loop through a CheckedListBox and look at the name and if the name is in a string, check it.
I can figure out how to get the name:
foreach (var item in chkSelectStatementColumns.Items)
{
if (lbStatementNames.Text.IndexOf(item.ToString()) != -1)...
I am trying to find out how to generically cancel and re-enable an event on a CheckListBox.
I could do it this way, if I know the event:
public void cancelevent()
{
checkedListBox1.ItemCheck -= new ItemCheckEventHandler(this.checkedListBox1_ItemCheck);
}
but I have 5 CheckListBoxes...
If I have a CheckedListBox with an ItemCheck event defined, how do I set it to fire only if a user actually selects a checkbox item not when I check it programmatically.
Right now, if I programmatically set all the checkboxes, I will enter the event code 10 times if I have 10 checkbox items...
I am trying to get all the items that are checked in a CheckedListBox when one of the check boxes is checked. I want to be able to do something with this list in the ItemCheck event.
The problem is that when you go into the event, the checkbox is not checked yet. So if I do a foreach loop on...
If I have a CheckedListBox with an ItemCheck event defined, how do I set it to fire only if a user actually selects a checkbox item not when I check it programmatically.
Right now, if I programmatically set all the checkboxes, I will enter the event code 10 times if I have 10 checkbox items...
If I have a CheckedListBox with an ItemCheck event defined, how do I set it to fire only if a user actually selects a checkbox item not when I check it programmatically.
Right now, if I programmatically set all the checkboxes, I will enter the event code 10 times if I have 10 checkbox items.
I...
I am trying to get all the items that are checked in a CheckedListBox when one of the check boxes is checked. I want to be able to do something with this list in the ItemCheck event.
The problem is that when you go into the event, the checkbox is not checked yet. So if I do a foreach loop on...
I previously had a form that called another form that had a datagridview on it. I passed a DataTable to the child form and on the childform it bound it.
Parent calls child form and shows it.
TableInfoti = new TableInfo();
t1.Show();
Parent passes Datatable:
t1.ShowDataGrid(dt);
Child binds...
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.