Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
|
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 6th, 2006, 03:57 PM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datagridview - Comboboxcolumn in New record only

I am fairly new to VB 2005 and need some help with a datagridview. I have the datagridview working and updating, etc. but I need some help with some customization.

Here's the situation, for each existing record there is a document control number (DCN) consisting of a 3-letter prefix and a 3-digit suffix (i.e. ABC001, ABD002). Once created, these DCNs are locked and unable to be modified. These DCNs are used for tracking by my users. When a new record is created, the user needs to select the 3-letter prefix from a combo box. Then when the record is saved, a DCN is created using this prefix.

Here's my problem, for most of the datagridview, the DCN field is a readonly textboxcolumn. However, on the new record line, I need to change the textboxcolumn to a comboboxcolumn. Additionally, this comboboxcolumn must be bound to a different datasource than the datagridview. Any ideas?

Thanks in advance!
Joanna

 
Old April 13th, 2006, 01:40 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You can' change the the column type to combobox. You can 1. add a combobox column to the grid and use the rowdatabound event to make the combobox readonly or not. 1. Add the textbox and combobox to a template column, then display and enable the controls as necessry in the rowdatabound event.
As for the combobox binding, create another datasource for it and bind the columns as needed






Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete a record row, not just the record. Coby Access VBA 1 April 30th, 2007 06:29 AM
DataGridView Sakkaw C# 2005 1 January 9th, 2007 12:06 PM
how to add new record as first record in dataset [email protected] ASP.NET 1.0 and 1.1 Professional 4 April 21st, 2006 05:23 AM
Record locking - user needs the next queued record cbtoolkit SQL Server 2000 0 December 6th, 2004 08:29 AM
Sub record not associating with Main record Ron V Access 1 August 31st, 2004 09:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.