Click here to Skip to main content
15,885,771 members
Home / Discussions / Database
   

Database

 
GeneralRe: XML Database Pin
Colin Angus Mackay20-Aug-05 6:29
Colin Angus Mackay20-Aug-05 6:29 
GeneralRe: XML Database Pin
surfman1920-Aug-05 12:41
surfman1920-Aug-05 12:41 
GeneralRe: XML Database Pin
Colin Angus Mackay20-Aug-05 23:03
Colin Angus Mackay20-Aug-05 23:03 
GeneralRe: XML Database Pin
Frank Kerrigan23-Aug-05 0:15
Frank Kerrigan23-Aug-05 0:15 
QuestionNewbie: ODBC or OleDb SQL Command Dictionary? Pin
zPaul19-Aug-05 9:49
zPaul19-Aug-05 9:49 
GeneralDataGrid bounded to a DataTable with composite key Pin
miah alom19-Aug-05 7:33
miah alom19-Aug-05 7:33 
Generaldropdownlist in datagrid Pin
sarah_chandran19-Aug-05 1:01
sarah_chandran19-Aug-05 1:01 
GeneralRe: dropdownlist in datagrid Pin
miah alom19-Aug-05 6:24
miah alom19-Aug-05 6:24 
override the DataGridTextBoxColumn's Edit function as following and file a custom event

protected override void Edit(System.Windows.Forms.CurrencyManager source, int row, System.Drawing.Rectangle bounds, bool readOnly, string instantText, bool cellIsVisible)
{
CustomEventArgs e = null;

this.row = row;
//
//Fire Event and Take Decision
//
if (this.CustomCellEvent != null)
{
e = new CustomEventArgs (row, this.column, isEnabled, bounds);
//Fire the Event in Client Code
this.EnableDisableCellEvent(this, e);
//Take decision based on value of e.IsEnable and e.IsReadOnly set by Client Code
this.isEnabled = e.IsEnable;
this.isReadOnly = e.IsReadOnly;
}
if (this.isEnabled)
{
if (((CurrencyManager) source).Position == row)
{
base.Edit(source, row, bounds, readOnly, instantText, cellIsVisible);
this.source = source;
}
}
}

Subscribe to this event in the User control where the DataGrid is created.

Now in the event handler do the following to display the combobox.

comboBox.Left = this.dataGridAllocation.GetCellBounds(this.currentGridRow, this.currentGridColumn).Left;
comboBox.Top = this.dataGridAllocation.GetCellBounds(this.currentGridRow, this.currentGridColumn).Top;
comboBox.Width = this.dataGridAllocation.GetCellBounds(this.currentGridRow, this.currentGridColumn).Width;
comboBox.Height = this.dataGridAllocation.GetCellBounds(this.currentGridRow, this.currentGridColumn).Height;
comboBox.Visible = true;
comboBox.Focus();


On the SelectedIndexChanged event handler of the combobox

this.dataTable[this.dataGrid.CurrentCell.Row][this.dataGrid.CurrentCell.Column] = this.combobox.Text;

Hope this is useful.
GeneralHELP unable to connect to sql server Pin
christy1818-Aug-05 23:56
christy1818-Aug-05 23:56 
GeneralRe: HELP unable to connect to sql server Pin
Colin Angus Mackay19-Aug-05 0:21
Colin Angus Mackay19-Aug-05 0:21 
GeneralRe: an aside: localhost Pin
Scott Serl19-Aug-05 10:28
Scott Serl19-Aug-05 10:28 
GeneralRe: an aside: localhost Pin
Luis Alonso Ramos19-Aug-05 14:26
Luis Alonso Ramos19-Aug-05 14:26 
GeneralRe: an aside: localhost Pin
Scott Serl20-Aug-05 7:29
Scott Serl20-Aug-05 7:29 
GeneralThank you Pin
christy1819-Aug-05 18:06
christy1819-Aug-05 18:06 
GeneralRe: HELP unable to connect to sql server Pin
Rob Graham20-Aug-05 4:01
Rob Graham20-Aug-05 4:01 
GeneralUsing Check Boxes Pin
Binary011018-Aug-05 8:52
Binary011018-Aug-05 8:52 
GeneralRe: Using Check Boxes Pin
Christian Graus18-Aug-05 17:01
protectorChristian Graus18-Aug-05 17:01 
GeneralRe: Using Check Boxes Pin
Binary011018-Aug-05 20:44
Binary011018-Aug-05 20:44 
GeneralRe: Using Check Boxes Pin
toxcct18-Aug-05 20:37
toxcct18-Aug-05 20:37 
GeneralRe: Using Check Boxes Pin
miah alom19-Aug-05 6:42
miah alom19-Aug-05 6:42 
GeneralAbstraction Layer Factory Tool Pin
Tristan Rhodes18-Aug-05 2:26
Tristan Rhodes18-Aug-05 2:26 
GeneralRe: Abstraction Layer Factory Tool Pin
miah alom19-Aug-05 6:27
miah alom19-Aug-05 6:27 
GeneralRe: Abstraction Layer Factory Tool Pin
airbus38021-Aug-05 2:37
airbus38021-Aug-05 2:37 
GeneralHelp with crystal reports!!!! Pin
korso_rogan17-Aug-05 23:39
korso_rogan17-Aug-05 23:39 
GeneralCannot open backup device Pin
dhtuan17-Aug-05 22:21
dhtuan17-Aug-05 22:21 

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.