This is a migrated thread and some comments may be shown as answers.

[Solved] size of textboxes in EditMode="InPlace"

2 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 14 Dec 2009, 10:48 AM
Hello Telerik - Team,

how can I set the size of textboxes weh I update a row in the EditMode="InPlace"

Now all textboxes have the same size.

thanks
Christian

2 Answers, 1 is accepted

Sort by
0
Accepted
Radoslav
Telerik team
answered on 14 Dec 2009, 11:46 AM
Hi Christian,

To set the textbox size of the GridBoundColumn when it is in edit mode, you can either use the following code:

 

void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))
    {
        GridEditableItem edititem = (GridEditableItem)e.Item;
        TextBox txtbx = (TextBox)edititem["ColumnUniqueName"].Controls[0];
        txtbx.Width = Unit.Pixel(250);
    }  
}

Or you can set column editors for various columns and set their styles declaratively. Refer to the following help document for more information:

http://www.telerik.com/help/aspnet-ajax/grdstylingthroughdeclarativecustomeditors.html

Sincerely yours,
Radoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Princy
Top achievements
Rank 2
answered on 14 Dec 2009, 11:51 AM
Hello Christian,

You can set the column editors declaratively by setting the ColumnEditorID property of the corresponding column to the ID of the custom column editor which will help you customize the look of the column editors easily. Take a look at the following document to understand better:
Declarative style editors

-Princy.
Tags
Grid
Asked by
Christian
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Princy
Top achievements
Rank 2
Share this question
or