Datagridview cell help


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Datagridview cell help

  1. #1
    Join Date
    Nov 2004
    Posts
    43

    Datagridview cell help

    Hi

    I have gotten my other post taken care of I have one last request. The code I have below will take the data from column(13) and format it the way I want it here is the code I am using.

    Code:
    Private Sub CARD_CATALOGDataGridView_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CARD_CATALOGDataGridView.CurrentCellChanged
                    txtCallnumber.Text = txtCallnumber.Text.Replace(Chr(32), Chr(13) + Chr(10))
    End Sub
    and the textbox (txtCallnumber.Text) is formated as needed

    KF
    123
    B234
    1990

    The problem I am having is when I scroll down the datagridview the data takes on the formatting that the (txtCallnumber.Text) does and I would like it to stay formatted as a single line within the cell as such:

    KF 123 B234 1990

  2. #2
    Join Date
    May 2004
    Location
    Duluth MN
    Posts
    353
    Sounds like your textbox and grid cell are bound to the same data. You modify it in the text box and it displays the same in the grid, correct. If you don't want this behavior I believe you'll need to leave the textbox unbound.

    ...joe

Similar Threads

  1. DataGridView Link Cell
    By rahvyn in forum .NET
    Replies: 4
    Last Post: 05-04-2013, 09:31 AM
  2. Replies: 0
    Last Post: 07-24-2009, 01:05 PM
  3. DataGridView Cell template
    By Hrcko in forum .NET
    Replies: 2
    Last Post: 11-30-2007, 07:00 AM
  4. Whitspace in datagridview cell
    By jcb1269 in forum .NET
    Replies: 1
    Last Post: 03-21-2007, 02:02 PM
  5. Color DataGridView cell on exception
    By jellyfish5000 in forum .NET
    Replies: 2
    Last Post: 03-01-2007, 09:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center