CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2001
    Location
    UK
    Posts
    308

    Question DataGrid - editing - check box.

    I'm developing a Windows based application using C#...
    Application uses windows DataGrid, which displays the content from XML..

    This datagrid display the Check box to display the the content of one of the boolean column of database using DataGridTableStyle... In this style sheet all the columsn are read only, except this Check box column.

    I hv couble of questions related to this:

    1. I wanted to avoid the adding of new records in datagrid manually.. if i make use of DataGrid.ReadOnly = true, i can not edit the value of the check box..

    I wanted to avoid adding of new record in datagrid and check box column editable..


    2. The Check box column in datagrid has the intermediate state also.. how to avoid it..
    thanks in Adv...
    Venu
    Last edited by bharadwajrv; June 18th, 2005 at 05:04 PM.
    Venu Bharadwaj
    "Dream it. U can do it!"

  2. #2
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Re: DataGrid - editing - check box.

    As for the first question:
    You can create a grid that allows users to edit data but prevents them from adding new rows by using a DataView as the data source and setting the AddNew property to false. (from MSDN)

    Simply create a new DataView based on the table you want to display, set the AllowNew property to false, and set the DataSource of the DataGrid to be the DataView.

    As for the second question: Are you using DataGridBoolColumn? (check MSDN)

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured