Show Check Box in DataGrid Control
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Show Check Box in DataGrid Control

  1. #1
    Join Date
    Feb 2002
    Posts
    7

    Show Check Box in DataGrid Control

    How can I show check box in a datagrid control ?

    Thanks.


  2. #2
    Join Date
    Sep 2001
    Location
    IL, USA
    Posts
    1,090

    Re: Show Check Box in DataGrid Control

    Right click on the DataGrid and then choose Retrieve Fields from the popup menu. Then Right click on the DataGrid again and choose properties from the popup menu. Then in the tabbed form that will show up, choose the Format tab. In that tab, choose the column you want to assign a checkbox to, from the combobox, and then from the listbox below that choose CheckBox. Make sure that the column you choose has valid boolean data.


  3. #3
    Join Date
    Sep 2001
    Location
    IL, USA
    Posts
    1,090

    Re: Show Check Box in DataGrid Control

    Her is how you can show the checkboxes programaticaly. Add a reference to Microsoft Data Formatting Object Library. Then Add the following code to your formrivate withevents fmtMyFormat as StdDataFormat
    private Sub Command1_Click()
    set fmtMyFormat = new StdDataFormat
    fmtMyFormat.Format = fmtCheckBox
    'Change the column number 6 to the column number you want.
    DataGrid1.Columns(6).DataFormat = fmtMyFormat
    End Sub




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center