Click here to Skip to main content
16,010,334 members
Home / Discussions / C#
   

C#

 
Generalcool icons Pin
OmegaSupreme25-Feb-04 8:21
OmegaSupreme25-Feb-04 8:21 
GeneralRe: cool icons Pin
RNEELY25-Feb-04 8:29
RNEELY25-Feb-04 8:29 
GeneralRe: cool icons Pin
OmegaSupreme25-Feb-04 9:24
OmegaSupreme25-Feb-04 9:24 
GeneralRe: cool icons Pin
Werdna25-Feb-04 8:40
Werdna25-Feb-04 8:40 
GeneralRe: cool icons Pin
RNEELY25-Feb-04 9:16
RNEELY25-Feb-04 9:16 
GeneralRe: cool icons Pin
OmegaSupreme25-Feb-04 9:27
OmegaSupreme25-Feb-04 9:27 
GeneralDynamic display of datagrids with Checkboxes Integrated Pin
Ananthanatarajan25-Feb-04 6:36
Ananthanatarajan25-Feb-04 6:36 
GeneralRe: Dynamic display of datagrids with Checkboxes Integrated Pin
Heath Stewart25-Feb-04 7:23
protectorHeath Stewart25-Feb-04 7:23 
You could create a list of booleans and bind this to the DataGrid:
using System;
using System.Windows.Forms;

public class DGTest : Form
{
  static void Main()
  {
    Application.Run(new DGTest());
  }
 
  public DGTest()
  {
    DataGrid dg = new DataGrid();
    this.Controls.Add(dg);
 
    DataGridBoolColumn boolCol = new DataGridBoolColumn();
    boolCol.MappingName = "Value";
    boolCol.HeaderText = "Value";
 
    DataGridTableStyle tableStyle = new DataGridTableStyle();
    tableStyle.MappingName = "DGValue[]";
    tableStyle.GridColumnStyles.Add(boolCol);
 
    dg.Dock = DockStyle.Fill;
    dg.TableStyles.Add(tableStyle);
 
    DGValue[] values = new DGValue[10];
    for (int i=0; i<values.Length; i++)
      values[i] = new DGValue();
 
    dg.DataSource = values;
  }
 
  private class DGValue
  {
    private bool _Value = false;
    public bool Value
    {
      get { return _Value; }
      set { _Value = value; }
    }
  }
}
There's also more documentation about this for the DataGridTableStyle.MappingName property in the .NET Framework SDK.

 

Microsoft MVP, Visual C#
My Articles
GeneralRuntime user code Pin
Joel Holdsworth25-Feb-04 6:28
Joel Holdsworth25-Feb-04 6:28 
GeneralRe: Runtime user code Pin
Heath Stewart25-Feb-04 6:59
protectorHeath Stewart25-Feb-04 6:59 
GeneralHttpWebRequest authentication Pin
godzooky25-Feb-04 4:23
godzooky25-Feb-04 4:23 
GeneralRe: HttpWebRequest authentication Pin
Heath Stewart25-Feb-04 5:20
protectorHeath Stewart25-Feb-04 5:20 
GeneralRe: HttpWebRequest authentication Pin
godzooky25-Feb-04 5:36
godzooky25-Feb-04 5:36 
GeneralRe: HttpWebRequest authentication Pin
Heath Stewart25-Feb-04 6:23
protectorHeath Stewart25-Feb-04 6:23 
GeneralSome questions about webservice Pin
Forrest Feather25-Feb-04 4:16
Forrest Feather25-Feb-04 4:16 
GeneralRe: Some questions about webservice Pin
Heath Stewart25-Feb-04 5:05
protectorHeath Stewart25-Feb-04 5:05 
GeneralRe: Some questions about webservice Pin
Forrest Feather25-Feb-04 14:10
Forrest Feather25-Feb-04 14:10 
QuestionThreads? Pin
johnstacey25-Feb-04 0:00
johnstacey25-Feb-04 0:00 
AnswerRe: Threads? Pin
Verdant12325-Feb-04 2:36
Verdant12325-Feb-04 2:36 
AnswerRe: Threads? Pin
scadaguy25-Feb-04 2:58
scadaguy25-Feb-04 2:58 
GeneralRe: Threads? Pin
johnstacey25-Feb-04 11:16
johnstacey25-Feb-04 11:16 
AnswerRe: Threads? - Another Question Pin
johnstacey25-Feb-04 11:30
johnstacey25-Feb-04 11:30 
Generalremoting/serialization problem Pin
occcy24-Feb-04 22:50
occcy24-Feb-04 22:50 
GeneralRe: remoting/serialization problem Pin
Heath Stewart25-Feb-04 5:01
protectorHeath Stewart25-Feb-04 5:01 
GeneralRe: remoting/serialization problem Pin
occcy25-Feb-04 20:39
occcy25-Feb-04 20:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.