Hi,
control.getId is for the Grid. There are no controls inside our Grid cells. If you use a CustomColumn, the control will be inside the CustomColumn's EditorTemplate and has nothing to do with grid cells or rows. If that is the case, you will need to use the following code to find out the ClientID of your control ID:
Code: C#
//Get the CustomColumn control
EO.Web.CustomColumn col = (EO.Web.CustomColumn)Grid1.Columns[0];
//Get the text box inside the CustomColumn's EditorTemplate
TextBox tb = (TextBox)col.EditorInstance.FindControl("TextBox1");
//Get the text box's client ID
string id = tb.ClientID;
The above code assumes that the first column is a CustomColumn and you have a TextBox with ID "TextBox1" inside the CustomColumn's EditorTemplate.
If you wish to do this on the client side, the code is very much the same except that you will have to write them all in one statement with ASP.NET rendering syntax:
Code: JavaScript
//Get the ClientID of the TextBox control
var id = '<%=((EO.Web.CustomColumn)Grid1.Columns[0]).EditorInstance.FindControl("TextBox1").ClientID%>';
//Get the DOM textbox object
var tb = document.getElementById(id);
//Change textbox width
tb.style.width = "100px";
You can put such code inside the column's ClientSideBeginEdit handler, then get the current column width from your handler and adjust your textbox (or any other control's width) based on the column width.
Hope this helps. Please feel free to let us know if you have any other questions.
Thanks