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 bkrike 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
  • Content: Threads
  • 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

    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...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. tshad

    Issue accessing ListBox directly after data binding

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

    How do I loop through a CheckedList

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

    Cancel and re-enable a CheckListBox ItemCheck event

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

    How to prevent ItemCheck event from firing

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

    Winforms CheckedListBox get checked items in ItemCheck event

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

    How to prevent ItemCheck event from firing

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

    How to prevent ItemCheck event from firing

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

    Winforms CheckedListBox get checked items in ItemCheck event

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

    Windows forms show and showdialog working differently displaying datagridview

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

Part and Inventory Search

Back
Top