CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    110

    DataGrid TableStyle

    Hello,

    How can I evite that the user is able to put in a new line into a data grid at the end of the table?

    Thanks!
    Last edited by skuehner; April 26th, 2006 at 01:43 PM.

  2. #2
    Join Date
    Oct 2005
    Posts
    110

    Re: Datagrid TableStyle

    I'm answering to my own question:

    Instead of doing this:

    Code:
    BusProperties.DataSource=dataTable;
    do this:

    Code:
    DataView dataView = new DataView(dataTable);
    dataView.AllowNew = false;
    BusProperties.DataSource=dataView;

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

    Re: Datagrid TableStyle

    And to make it shorter:
    Code:
    BusProperties.DataSource=dataTable;
    dataTable.DefaultView.AllowNew = true;

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