Click here to Skip to main content
15,921,382 members
Home / Discussions / Database
   

Database

 
GeneralNumber of records in Access database Pin
Majid Shahabfar20-Feb-03 3:03
Majid Shahabfar20-Feb-03 3:03 
GeneralRe: Number of records in Access database Pin
Hesham Amin20-Feb-03 21:28
Hesham Amin20-Feb-03 21:28 
Generalado.net Pin
mrboljok20-Feb-03 2:27
mrboljok20-Feb-03 2:27 
GeneralRe: ado.net Pin
Solomon Wu24-Feb-03 16:48
Solomon Wu24-Feb-03 16:48 
Generalcannot found msado15.dll Pin
MemLeak19-Feb-03 10:43
MemLeak19-Feb-03 10:43 
GeneralRe: cannot found msado15.dll Pin
Darrell Long19-Feb-03 10:55
Darrell Long19-Feb-03 10:55 
GeneralRe: cannot found msado15.dll Pin
Stephane Rodriguez.19-Feb-03 11:00
Stephane Rodriguez.19-Feb-03 11:00 
GeneralHelp Please: ComboBox Control in WinForm Datagrid Control Pin
DionChen19-Feb-03 5:06
DionChen19-Feb-03 5:06 
Hi, all:

I am totally stuck, please help. I have a datagrid on the WinForm ( using C# ). I am trying to create a combobox for one of the columns. I use the technique described in MS KB Article 323167 ( coded in VB.NET) and I port the code to C#. It works fine for the existing rows. Whe I click on the * row ( i.e., try to create a new row) on the datagrid. The combobox seems there, but when I click on the down arrow, the combobox does not dropdown. Occasionally, I can get the dropdown, but when I leave the cell, the changed value goes to the previous row ( strange!). The primary key is AutoNumber, when I click on the new row ( with "*" in front of it), I sometime get little pencil in front of the row, but sometimes I do not get it except the autonumber ( almost like it does not treat as a new row ).

Has anyone use this combobox technique and work on the new row successfully? I include the code snippet ( handling the events) here, if you can spot anything I did wrong, please let me know.

Any help is highly appreciated. Thanks in advance.

Dion

************ Code Starts here ***********

private void dataGrid1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)<br />
{<br />
	if ( dataGrid1.CurrentCell.ColumnNumber == 1 )<br />
	{<br />
		cbType.Width = dataGrid1.GetCurrentCellBounds().Width;<br />
	}<br />
}<br />
<br />
private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)<br />
{<br />
	if ( dataGrid1.CurrentCell.ColumnNumber == 1 )<br />
	{<br />
		cbType.Visible = false;<br />
		cbType.Width = 0;<br />
		cbType.Left = dataGrid1.GetCurrentCellBounds().Left;<br />
		cbType.Top = dataGrid1.GetCurrentCellBounds().Top;<br />
		cbType.Text = dataGrid1[dataGrid1.CurrentCell].ToString() + "";<br />
		cbType.Visible = true;<br />
	}<br />
	else<br />
	{<br />
		cbType.Visible = false;<br />
		cbType.Width = 0;<br />
	}		<br />
}<br />
<br />
private void dataGrid1_Scroll(object sender, System.EventArgs e)<br />
{<br />
	cbType.Visible = false;<br />
	cbType.Width = 0;<br />
}<br />
<br />
<br />
private void dataGrid1_Click(object sender, System.EventArgs e)<br />
{<br />
	cbType.Visible = false;<br />
	cbType.Width = 0;<br />
}<br />
<br />
		<br />
private void cbType_TextChanged(object sender, System.EventArgs e)<br />
{<br />
	if ( dataGrid1.CurrentCell.ColumnNumber == 1 )<br />
	{<br />
		cbType.Visible = false;<br />
<br />
		if ( ( dataGrid1[dataGrid1.CurrentCell] + "") == "" )<br />
		{<br />
			SendKeys.Send("*");<br />
		}<br />
<br />
		dataGrid1[dataGrid1.CurrentCell] = cbType.Text;<br />
	}		<br />
}

Generalforeign key Pin
ylaine18-Feb-03 17:03
ylaine18-Feb-03 17:03 
GeneralRe: foreign key Pin
Jon Hulatt18-Feb-03 22:08
Jon Hulatt18-Feb-03 22:08 
GeneralRe: foreign key Pin
ylaine19-Feb-03 0:44
ylaine19-Feb-03 0:44 
GeneralRe: foreign key Pin
Exceter24-Feb-03 19:12
Exceter24-Feb-03 19:12 
GeneralRe: foreign key Pin
karl_w19-Feb-03 2:01
karl_w19-Feb-03 2:01 
GeneralRe: foreign key Pin
ylaine19-Feb-03 5:34
ylaine19-Feb-03 5:34 
GeneralRe: foreign key Pin
karl_w19-Feb-03 19:32
karl_w19-Feb-03 19:32 
Generalthank you Pin
ylaine20-Feb-03 7:04
ylaine20-Feb-03 7:04 
GeneralModifying SQL database problem.. Pin
IrishSonic18-Feb-03 11:07
IrishSonic18-Feb-03 11:07 
GeneralRe: Modifying SQL database problem.. Pin
Jon Hulatt18-Feb-03 11:52
Jon Hulatt18-Feb-03 11:52 
GeneralRe: Modifying SQL database problem.. Pin
perlmunger18-Feb-03 12:52
perlmunger18-Feb-03 12:52 
GeneralInput and retrieve .doc in MSQL Pin
nacer_6518-Feb-03 10:40
nacer_6518-Feb-03 10:40 
GeneralRe: Input and retrieve .doc in MSQL Pin
Topper Price20-Feb-03 15:59
Topper Price20-Feb-03 15:59 
Questionhow to open binary data type for image in access Pin
Anonymous18-Feb-03 10:38
Anonymous18-Feb-03 10:38 
GeneralRow-level locking Pin
Le centriste18-Feb-03 9:46
Le centriste18-Feb-03 9:46 
GeneralFound it! Pin
Le centriste21-Feb-03 17:02
Le centriste21-Feb-03 17:02 
GeneralDB Schema Decsions Pin
Jason McBurney18-Feb-03 7:51
Jason McBurney18-Feb-03 7:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.