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

darkelv

@darkelv
About
Posts
553
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Multithreading with task in .net 4. Strange things.
    D darkelv

    I have experienced that it may work without invoke on one machine but it doesn't work on other machines (and took a long time trying to find that out with the assumption that part was not the problem). So it's better to use invoke regardless.

    C# question csharp design announcement lounge

  • How to spread traffic on a table
    D darkelv

    Database Snapshot? http://msdn.microsoft.com/en-us/library/ms175876.aspx[^] Also consider pre-generate the commonly used ad-hoc queries with heavy usage on the database so as not to tie down the actual database.

    Database database question sales help tutorial

  • Combobox large Data
    D darkelv

    Unfortunately Microsoft assumes Textboxes with AutoComplete are preloaded with all data. With dynamically populated data items sometimes the application crash with an uncatchable exception. http://social.msdn.microsoft.com/Forums/en/winforms/thread/e599b2e2-3cda-43ad-b15f-a69b4fea1a75[^]

    C# question

  • open form as a tab in windows applications
    D darkelv

    Visual Studio IDE like Dock Container[^][^]

    C# csharp visual-studio tutorial question

  • Pop Out Side Menu (Visual Studio Style)
    D darkelv

    Visual Studio IDE like Dock Container[^] The main area will become a MDI, though.

    Visual Basic csharp visual-studio database wpf sysadmin

  • Where is saved connection string for DataSet
    D darkelv

    polzovat79 wrote:

    - probably connection string is saved in another place?

    I always manually set the connection string to the data adapter instead of depending on the connection string in the auto-generated config file.

    C# csharp visual-studio tutorial question

  • Where is saved connection string for DataSet
    D darkelv

    Didn't realize we can do that now, probably new in 2010? Sometime we have to use dataset, for report, and they LIKE to create connection string in the config file.

    C# csharp visual-studio tutorial question

  • Windows or Console application target for Windows Service?
    D darkelv

    I would arrange all the stuff that you want to run as the service into another class project. Then you can have the Windows Service project reference to this project for actual usage, and create console app project or windows app project that reference the class project for debugging.

    C# csharp visual-studio winforms com question

  • Dataset and Crystal Reports
    D darkelv

    You can "pull" data directly from source without using needing to use dataset. You should only passing the datatables that are needed for each report, so whether 3 or 300 reports it should not matter, unless you are talking about generating 300 reports all at once.

    Windows Forms question

  • Any way to access Parent Form From a class?
    D darkelv

    You can if you set a reference to the form in Class1 but that is a very bad design, unless Class1 is strictly meant as a helper class for that form. Class1 is not an inherited Control class like ctrl1, so it doesn't have Parent property. You will have to define the Control type property and set the property accordingly. Beside you won't be able to access to the combobox of the form unless you set it to public, which is another bad design.

    Visual Basic question

  • Control Binding of a bool isn't updating
    D darkelv

    You'll need to implement the OnBoolValueChanged event or OnPropertyChanged after the boolValue = value assignment. http://krisvandermotten.wordpress.com/2006/10/19/properties-with-property-changed-event/[^] http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/1e742062-bf41-48cf-bd2f-54bdc9c5b78d[^] Personally I prefer the OnXXXChanged because I'd rather not write a gigantic switch in the OnPropertyChanged handler.

    Windows Forms question wpf wcf help tutorial

  • T9 predictive text in Windows Forms
    D darkelv

    Yes definitely possible, though probably not entirely in .NET, and don't think there are API beside the standard Win32 API, and you got to code most of the libraries. You'll need a light and efficient database for the dictionary, an algorithm to retrieve the words fast, an algorithm to account for the most recent used words, adding and removing words from the dictionary. You'll need some way to hook the keypress, and sending the character or control characters (backspace, etc) to the control. Did a Palm version for a friend's company for the keyboard, they did the windows mobile version using C++. Though without much capital, the product is currently sort of dead. :( http://www.osnews.com/story/15389/Review-TenGO-2.0-and-TenGO-Thumb[^]

    Windows Forms winforms hardware question workspace

  • How do I get a datagrid to only show certain columns from a dataset?
    D darkelv

    If someone added another column, or insert a column before the firstcolumn, the datagridview will display wrongly. Generally I will define the columns to be displayed and their order, instead of hiding the columns that I do not want to display.

    C# question help

  • How do I get a datagrid to only show certain columns from a dataset?
    D darkelv

    Define only the columns that you want to display in the datagridview:

    this.dataGridView.AutoGenerateColumns = false;
    this.dataGridView.Columns.Clear();
    this.dataGridView.Columns.AddRange(GetGridViewColumns());

    private DataGridViewColumn[] GetGridViewColumns()
    {
    DataGridViewTextBoxColumn id = new DataGridViewTextBoxColumn();
    id .DataPropertyName = "ID";
    id .HeaderText = "ID";
    id .Name = "ID";
    id .SortMode = DataGridViewColumnSortMode.Automatic;
    id .ReadOnly = true;
    id .Width = 100;
    id .DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
    id .DefaultCellStyle.Format = "";

    DataGridViewTextBoxColumn name= new DataGridViewTextBoxColumn();
    name.DataPropertyName = "Name";
    name.HeaderText = "Name";
    name.Name = "Name";
    name.SortMode = DataGridViewColumnSortMode.Automatic;
    name.ReadOnly = true;
    name.Width = 100;
    name.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
    name.DefaultCellStyle.Format = "";

    return new DataGridViewColumn[] { id, name };
    }

    C# question help

  • First .Net project suggestions
    D darkelv

    Why not do something that is related to your current work, for example, a problem tracking system, that log date/time/description of problem, who raised the problem, who and when solved the problem, Slowly you can enhance it to let user raise the problems (multi-user environment), categorize the problems, let manager to assign it to your colleagues (workflow), and generate reports on the time taken to solve the problems base on categories, etc etc.

    Windows Forms csharp dotnet tutorial question learning

  • Method overloading
    D darkelv

    Method1(1d,1d)?

    C# tutorial

  • Windows forms application popup dialog?
    D darkelv

    Mattzimmerer wrote:

    I simply had my main form launch another form giving its self as a parameter... problem solved!!!

    That is probably the worst way to do it. Passing Data Between Forms[^]

    WPF winforms question

  • DataGridView problem with cell coloring [modified]
    D darkelv

    You should check the value from the data source itself, not datagridview's cells. Subscribe to the datagridview's CellFormatting event, then in the handler get the DataBoundItem (object, datarow etc) and set color base on the DataBoundItem's data itself. I'm binding to collection of object, btw, so YMMV.

    private void dataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
    {
    string dataPropertyName = this.dataGridView.Columns[e.ColumnIndex].DataPropertyName;
    ObjectType theObject;
    switch (dataPropertyName)
    {
    case "ColumnName":
    theObject = (ObjectType)this.dataGridView.Rows[e.RowIndex].DataBoundItem;

                    // Set the color base on theObject's property mapped to dataPropertyName
                    break;
    
            }
    
        }
    
    Database database help question

  • DataSourceUpdateMode
    D darkelv

    Try using false instead of true

    this.textBox1.DataBindings.Add("Text", o, "TheProp", false, DataSourceUpdateMode.OnPropertyChanged, string.Empty);

    C# question database wpf wcf help

  • Serialization of colleciton
    D darkelv

    have you tried wrap your collection in a serializable class? http://edinkapic.blogspot.com/2006/10/how-to-serialize-collection.html[^]

    .NET (Core and Framework) csharp wcf xml json
  • Login

  • Don't have an account? Register

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