Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: tshad
  • Order by date
  1. tshad

    In the following code, batch ends u

    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 =...
  2. tshad

    Linq getting selections using ToList not working

    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>'...
  3. tshad

    Linq orderby pivot results

    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...
  4. tshad

    Blur events going to two textboxes

    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...
  5. tshad

    Blur events going to two textboxes

    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...
  6. tshad

    Using Linq to group and sum with multiple columns

    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...
  7. tshad

    How to get list item that has the lowest value

    Looks good. I was looking at finding different ways to do the same thing and this is a little clearer than using 2 linqs. Thanks, Tom
  8. tshad

    How to get list item that has the lowest value

    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...
  9. tshad

    Publishing xml files

    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...
  10. tshad

    How to set collection from inside constructor

    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...
  11. tshad

    issue with collection vs generic list.

    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...
  12. tshad

    issue with collection vs generic list.

    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...
  13. tshad

    How to set collection from inside constructor

    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...
  14. tshad

    Get an object by name

    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...
  15. tshad

    Get an object by name

    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 =...
  16. tshad

    Get an object by name

    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...
  17. tshad

    Add tab from collection to tab control

    Worked perfect. Also, is there a way to put them in a particular order. They seem to show up in the order added. Thanks, Tom
  18. tshad

    Add tab from collection to tab control

    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)...
  19. tshad

    Add tab from collection to tab control

    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...
  20. tshad

    Issue accessing ListBox directly after data binding

    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...

Part and Inventory Search

Back
Top