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...
That's fine, but not how we want the behavior to work.
I did figure out a way to make it work by setting a global variable to tell it to not process anything if bluring is turned off.
Works perfect. This is similar to an issue I had with windows forms where you cannot prevent an event from...
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...
That did exactly what I wanted. I couldn't figure out what to use "this" with to add the collection. "this.Addrange" worked perfectly.
Now you said the normal good practice was to do it the 2nd way with the static method, but that my example wasn't a good case for doing it this way. Why not...
I also tried this where I assign the results to a variable that inherits from a List<> which I assume would act the same as if the type was either the collection or the list.
public DotNetTypeCollection GetTypes()
{
DotNetTypeCollection dntc2;
DbObject...
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...
It works great.
But there was a small change I had to make.
Control control = Controls.Find("lbSelectName", true);
had to be changed to:
Control control = Controls.Find("lbSelectName", true).First();
So my actual code where I have 3 objects I am trying to get based on clauseType (enum), it...
Perfect.
I assume I can change the last piece to:
// And to get the ListBox in that selected tab:
ListBox lb = tabControl1.SelectedTab.Controls.OfType<ListBox>().FirstOrDefault();
To
// And to get the ListBox in that selected tab:
ListBox lb =...
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...
I tried to remove all the tabpages that are in the collection, which is what I usually do and then add the pages back in by their name. That works fine. But I only know the text of the tab and want to add it back in that way.
I first:
Tabs.TabPages.Remove(this.tabColumns)...
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 also tried to set the selection to the 3rd item:
lbStatementNames.DisplayMember = "StatementName";
lbStatementNames.ValueMember = "DBStatementID";
lbStatementNames.DataSource = SelectList;
lbStatementNames.SelectedItem = 2;
I didn't get an error but the 1st item was selected. I assume...
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.