PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 3.00 average.

DataGridViewComboBoxCell Questions...

 
 
Moshazu
Guest
Posts: n/a
 
      21st Dec 2005
I am attempting to use the DataGridView control in my software and have
not been able to easily find answers to a couple of questions that I
have.

1. Is the only way to change the data in a DataGridViewComboBox during
the runtime the way that I have done it here? If not, is there an
easier way?

Dim tmpCMBRow As New DataGridViewRow
tmpCMBRow.CreateCells(Me.grid)
tmpCMBRow.Cells(0).Value = "New Hello"

Dim tmpCMBCell As New DataGridViewComboBoxCell
tmpCMBCell.Items.AddRange(New String() {"tmp1", "tmp2", "tmp3"})
tmpCMBRow.Cells.RemoveAt(1)
tmpCMBRow.Cells.Insert(1, tmpCMBCell)

Me.grid.Rows.RemoveAt(0)
Me.grid.Rows.Insert(0, tmpCMBRow)

2. Once I have my information in the DataGridViewComboBoxCell, how do I
change the selected index of the information? I.E. in my example above
using the tmp tags, how would I tell the grid to display tmp2 as the
default when this cell is shown?

Any help would be great.

Thanks again all, and have a great holiday,
Darian

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set Value of DataGridViewComboBoxCell news.microsoft.com Microsoft C# .NET 0 12th Apr 2008 09:57 PM
DataGridViewComboBoxCell =?Utf-8?B?UGV0ZXI=?= Microsoft Dot NET Framework Forms 0 13th Sep 2007 11:58 PM
about DataGridViewComboBoxCell aXqd Microsoft C# .NET 1 17th Mar 2007 03:59 PM
DataGridViewComboBoxCell Robbe Morris [C# MVP] Microsoft ADO .NET 0 5th Jun 2006 01:42 AM
DataGridViewComboBoxCell help Jay Microsoft C# .NET 0 28th Feb 2006 06:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:50 AM.