Skip to content

Commit

Permalink
* DataGridTextBoxColumn.cs:
Browse files Browse the repository at this point in the history
	* DataGrid.cs: Don't use this add-pending behaviour to try to add a
	new row until we have the first input char - it was helping us to fix
	other issues we have/had, but it's not matching .net.

2009-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>


svn path=/branches/mono-2-4/mcs/; revision=145941
  • Loading branch information
carlosalberto committed Nov 11, 2009
1 parent d279030 commit 8f26a0a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2009-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>

* DataGridTextBoxColumn.cs:
* DataGrid.cs: Don't use this add-pending behaviour to try to add a
new row until we have the first input char - it was helping us to fix
other issues we have/had, but it's not matching .net.

2009-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>

* TextBoxBase.cs: When returning the preferred height, and we are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ public override string ToString ()
bool from_positionchanged_handler;

/* editing state */
internal bool pending_new_row;
bool cursor_in_add_row;
bool add_row_changed;
internal bool is_editing; // Current cell is edit mode
Expand Down Expand Up @@ -545,11 +544,10 @@ public DataGridCell CurrentCell {
if (CurrentRow == RowsCount && ListManager.AllowNew) {
cursor_in_add_row = true;
add_row_changed = false;
pending_new_row = true;
AddNewRow ();
}
else {
cursor_in_add_row = false;
pending_new_row = false;
}

InvalidateRowHeader (old_row);
Expand Down Expand Up @@ -2549,7 +2547,7 @@ private void OnTableStylesCollectionChanged (object sender, CollectionChangeEven
CalcAreasAndInvalidate ();
}

internal void AddNewRow ()
private void AddNewRow ()
{
ListManager.EndCurrentEdit ();
ListManager.AddNew ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,6 @@ protected internal override void Edit (CurrencyManager source, int rowNum, Recta

void textbox_TextChanged (object o, EventArgs e)
{
// when the focus goes to the add row, the first TextChanged event
// should actually add the new row.
if (grid.pending_new_row) {
grid.pending_new_row = false;
grid.AddNewRow ();
}

textbox.IsInEditOrNavigateMode = false;
}

Expand Down

0 comments on commit 8f26a0a

Please sign in to comment.