Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

Drew McGhie

@Drew McGhie
About
Posts
138
Topics
34
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Bind data into textbox
    D Drew McGhie

    2 ways to do it. You can either pull the entire datatable worth of information and databind the table using a bindingsource(look up the bindingsource control), or you could make a call to the db every time you enter something and get that information. Conceptually its pretty easy, you have a db full of information, and something you're using as the key to look stuff up. Hopefully you'll be able to figure out how to apply the SQL queries/form interaction.

    C# database wpf wcf help question

  • Bind data into textbox
    D Drew McGhie

    Does this data need to be editable, or is it just displaying information based on the (i'm assuming unique) code?

    C# database wpf wcf help question

  • Refresh DataGrid with Latest Values
    D Drew McGhie

    The bindingsource does all that for you. When you update the underlying dataset, it updates anything the bindingsource is linked to.

    C# css database question

  • Refresh DataGrid with Latest Values
    D Drew McGhie

    You probably want to take a look at the BindingSource[^] class. It should handle what you're looking for.

    C# css database question

  • uploading multiple files using ftp
    D Drew McGhie

    Wow. 5 crossposts about 3 issues in 10 minutes, all saying "I need x". You won't get that here. Ever. People here won't do work for you, unless you pay them.

    C#

  • Windows Form Table
    D Drew McGhie

    There's a toolbox in the designer. You should be able to click and drag one of many kinds of tables from there.

    C# question

  • Cannot get datagridview to show records
    D Drew McGhie

    The fact that you're using the DataGridView means you're using VS.Net 2005. The designer is really helpful in setting up datagridview columns and formatting if you need anything beyond basic formatting and display. Check that out if you get a chance.

    C# csharp database graphics sysadmin

  • Cannot get datagridview to show records
    D Drew McGhie

    As far as I can see, you do all the data stuff fine, but you never actually add the datagridview to the form itself. Try this.Controls.Add(objDBGridView);

    C# csharp database graphics sysadmin

  • loading a combobox without repitition, how to??
    D Drew McGhie

    As an alternative to what people have said, is there any sort of pre-population of the items in the combobox? If you're just populating the CB from items in a database, and you don't want things to repeat, just use DISTINCT in the query from the database (I'm assuming SQL here), and just use the combobox.displaymember, combobox.valuemember, and combobox.datasource to set it up.

    C# tutorial question csharp database

  • inserting a text box into datagridview
    D Drew McGhie

    DataGridViewTextBoxColumn MyColumn = new DataGridViewTextBoxColumn(); myDataGridView.Columns.Add(MyColumn); Try that. Syntax is off the top of my head, so you may have to modify things slightly, but at runtime, that's the way to do it. In the designer, right click the DGV and select "add column"

    C#

  • strange error in DataGridView Control windows Forms
    D Drew McGhie

    How are you attaching it to the view, through a bindingsource or just saying DGV.DataSource=theView; Also, how are you trying to access the value of the cell?

    C# help csharp visual-studio winforms question

  • Suspending event handling
    D Drew McGhie

    On a usercontrol, is there an easy way to suspend all event handling on the control and all child controls? I don't want my event handling to keep firing as I set the form up, rather I just want to call a set of calculating/formatting functions just once in Load(), and then have all the events (which call the calculating/formatting functions) start firing. Right now I have an if statement in each event that ties to a boolean that I set when I want events to start working, but it seems like there might be an easier way. Any suggestions?

    C# question

  • problem in Datagrid
    D Drew McGhie

    As an expansion to this, use a DataGridView and a BindingSource. It provides superior data management capabilities. Search the CP articles for a good one on data binding and the datagridview

    C# css help question

  • how to add rows in DataRow object and How to Merge it to Dataset Object
    D Drew McGhie

    You really can't merge a datarow and a dataset, they're a level of abstraction away from each other. If you're looking to add a row to a table within a dataset, you can use ds.Tables["tablename"].Rows.Add(DataRow), assuming they have the same schema.

    C# csharp help tutorial

  • Finding specific coordinates in MS Word using C#
    D Drew McGhie

    Can you give us more information as to what information you have that define what will be selected?

    C# csharp question

  • Difference in showing forms
    D Drew McGhie

    Ah, you're right. I was trying to give an example of something visual that the user would see.

    C# question

  • Difference in showing forms
    D Drew McGhie

    To Support what Luc said.

    Application.Run(myForm);
    MessageBox.Show("whee!");
    

    Would wait for your form to close to display "whee!", while

    myForm.Show()
    MessageBox.Show("whee!");
    

    Would open your form, then immediately show the messagebox. If I have child forms in windows applications I'm running, I generally use Form.Show() Form.ShowDialog() depending on what I need. ShowDialog acts similarly to Application.Run(), in that it must return before code is executed in the parent, while Show() allows for parallel interaction.

    C# question

  • DataGridView Current Row
    D Drew McGhie

    DataGridView.CurrentRow returns the Row that contains the currently selected DataGridViewCell. In addition, if you handle the DataGridView.RowHeaderClick event, you can check the e.RowIndex Property to see the row number that was clicked.

    C# question css tutorial

  • SQL Distinct
    D Drew McGhie

    Well, say there are 3 rows agtMast ID Name Other One 22 James Other1 One 22 James Other2 Two 22 Bond Whee! There are 2 distinct values for the agtMast column, but 2 possible sets of values are different. Do you want one row for each agtMast value, and are there specifics as to which one should be selected, or do you want the distinct sets of values (So if One/22/James/Other1 appeared 10 times, you would want it to appear only once, but have One/22/James/Other2 appear as well after the query) I need some more information as to how you're clarifying the "correct" row.

    Database database help

  • Listbox selecteditems
    D Drew McGhie

    Thanks for the response. What I ended up getting working was looping through the items list (which will never be more than a dozen or so), rather than the List<> of items that needed to select. From that, I could parse the correct object from the associated datarow (by casting it as such) and then compare that to the list of approved items.

    uxlbSuite.SelectedItems.Clear();
    List objectsToAdd = new List();
    foreach (object unit in uxlbSuite.Items)
    {
       System.Data.DataRowView Row = unit as System.Data.DataRowView;
       if (Row != null && toSelect.Contains(Row["ID"].ToString()))
       {
          objectsToAdd.Add(unit);
       }
    }
    
    foreach (object unit in objectsToAdd)
    {
       uxlbSuite.SelectedItems.Add(unit);
    }
    
    C# help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups