I think this is the default behavior. I solved this problem writing the
following code in the EditCommand event, which you can adapt to your
purposes:
private void grdPolicy_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e) {
this.lblMessage.Text = "";
this.saveSelection();
this.grdPolicy.EditItemIndex = (int) e.Item.ItemIndex;
this.gridBind();
this.grdPolicy.Columns[(int) NumColumns.select].Visible = false;
// cambiare le dimensioni del text grid per l'editazione
System.Web.UI.WebControls.TextBox txt;
txt = (TextBox) this.grdPolicy.Items[(int) e.Item.ItemIndex].Cells[(int)
NumColumns.issuing].Controls[0];
txt.Columns = 10;
txt = (TextBox) this.grdPolicy.Items[(int) e.Item.ItemIndex].Cells[(int)
NumColumns.expiry].Controls[0];
txt.Columns = 10;
txt = (TextBox) this.grdPolicy.Items[(int) e.Item.ItemIndex].Cells[(int)
NumColumns.premium].Controls[0];
txt.Columns = 10;
if (decimal.Parse(txt.Text) == 0) {
txt.Text = "";
}
}
As you can realize, you can change the Columns property of the text boxes
for the columns which aren't read only. I hope this can help you.
--
Vanni Tomezzoli
S. Donato Mil., Milano, Italy
http://xoomer.virgilio.it/vtomezzo
"Bazza Formez" <ba**********@paradise.net.nz> ha scritto nel messaggio
news:lM********************@news02.tsnz.net...
Hi there,
What determines the sizes of rows / columns / cells when a grid is in edit
mode ?
When I click the edit command of a row item, the whole grid 'bounces' to a
much larger size... and after update it reduces back again.
I have a custom crafted grid (AutoGenerateColumns = False) ... and can
have not placed any setting that would seem to cause this behaviour.
Is this a default type bahaviour ? How should I work around this such that
disconcerting size changes do not occur ?
thanks,
Bazza