Click here to Skip to main content
15,912,493 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Am trying to edit the values in the database but Gridview changes the size when I Clicks the edit button again when I will update the data it will reduced to original size ? What will be the solution for the problem?
Posted

i think it is issue of editmode textboxes sizes.
try this to that:-
C#
protected void RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowState == DataControlRowState.Edit)
    {
        TextBox comments = (TextBox)e.Row.Cells[column_index].Controls[control_index];
        comments.TextMode = TextBoxMode.MultiLine;
        comments.Height = 100;
        comments.Width = 400;
    }
}


or in design
Set the ItemStyle-Width and ControlStyle-Width, and if you want wrap the text use ItemStyle-Wrap.
 
Share this answer
 
There must be any css applying to your table. Check properly with the help of "Inspect element" in chrome or firebug in mozilla.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900