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

Change size of textbox in Edit GridBoundColumn

3 Answers 383 Views
Grid
This is a migrated thread and some comments may be shown as answers.
burak
Top achievements
Rank 1
burak asked on 15 Jul 2009, 03:06 PM
Hi;
I use GridBoundColumn in radgrid and edit like
this (http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx) page.

But I want to change a textbox's size or I want to do textbox multiline.

How can i do that ?

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 16 Jul 2009, 05:24 AM
Hi Burak,

Try the following code snippet in order to set the properties of textbox (if GridBoundColumn in editmode).

C#:
 
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    if(e.Item is GridEditFormItem && e.Item.IsInEditMode) 
    { 
        GridEditFormItem item = (GridEditFormItem)e.Item; 
        TextBox textbox = (TextBox)item["CustomerID"].Controls[0]; // Where CustomerID is ColumnUniqueName
        textbox.Width = Unit.Pixel(400);  // Set width 
      //  textbox.TextMode = TextBoxMode.MultiLine;  // Set to MultiLine mode 
    } 

-Shinu.
0
burak
Top achievements
Rank 1
answered on 16 Jul 2009, 06:08 AM
Thanks, It works

burak altın
0
Princy
Top achievements
Rank 2
answered on 16 Jul 2009, 06:39 AM
Hello Burak,

You can also 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. Refer to the following document to understand better:
Declarative style editors

-Princy.
Tags
Grid
Asked by
burak
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
burak
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or