Private void maid (Object sender, system. Web. UI. webcontrols. datagriditemeventargs E)
{
//// Enter the editing mode to limit the width of the textbox ////
E. Item. cells [4]. Attributes. Add ("onclick", "Return confirm ('Are you sure you want to delete this item? ');");
If (E. Item. itemtype = listitemtype. edititem)
{
If (E. Item. controls [1]. controls [0]. GetType (). tostring () = "system. Web. UI. webcontrols. textbox ")
{
Textbox TB = (textbox) E. Item. controls [1]. controls [0];
TB. width = unit. parse ("80px ");
TB. cssclass = "textbox ";
TB. Text = server. htmldecode (Tb. Text );
}
If (E. Item. controls [2]. controls [0]. GetType (). tostring () = "system. Web. UI. webcontrols. textbox ")
{
Textbox TB = (textbox) E. Item. controls [2]. controls [0];
TB. width = unit. parse ("250px ");
TB. cssclass = "textbox ";
TB. Text = server. htmldecode (Tb. Text );
}
}
}