Control ID

E

Eddie Celebi

Folks

I want to call a vbscript function from a dynamically created template edit
control but I am having trouble with autogenerated control ID I set
control.ID = "X" but when its rendered it has become grid:ctrl12:X or
something.
How can I get round this issue. I either need to be able to set it and
datagrid not to change it or get the generated one.
I set the call in OnDataBinding event eg

public void OnDataBinding(object sender, EventArgs e)

{

TextBox t = (TextBox) sender;

DataGridItem container = (DataGridItem) t.NamingContainer;

object val = ((DataRowView) container.DataItem)[colname];

if (val == null)

t.Text = "";

else

t.Text = val.ToString();

t.ID = "DateCol";

string id = t.ID.ToString();


// t.Attributes.Add("onchange","ConvertDate(" + "grid__ctl12_DateCol" +
".value)");

t.Attributes.Add("onchange","ConvertDate(" + "DateCol" + ".value)");



Any help most welcome.



Eddie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,609
Members
45,253
Latest member
BlytheFant

Latest Threads

Top