Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Eddie Celebi #1
Control ID
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
Eddie Celebi Guest
-
Possible to create a composite control that has a child control that is a validator that validates the composite control itself?
I am attempting to create a composite control which has a label, followed by an optional error message, followed by two text boxes. I have... -
Composite control delegating databound templated features to child <asp:repeater> control
Hi Everybody, I'm creating a composite control in C# that basically renders a bunch of webcontrols such as <asp:Label />, <asp:Repeater />,... -
Page Load fired 3 times Web user control is embedded in a custom control
Hi, I have built a custom control that build a table with 3 cells in it. The custom control is designed to add all child controls to cell#2,... -
ControlDesigner not invoked on custom control when control is rendered within another custom control
I have a custom control that has a simple designer (derived from System.Web.UI.Design.ControlDesigner) associated with it (using the... -
Using Table control in a custom composite control. Control does not render properly in design time.
All, I have written a very simple custom composite control that includes a control of type System.Web.UI.WebControls.Table. The control... -
Zürcher See #2
Control ID
Is it possible to reset the counter of the automatic id generator of the
ControlCollection?
When I add a Control to a new ControlCollection it recive the id "ctl1", if
the ControlCollection is cleared, the automatic counter won't be reset and
the next added control recive the id "ctl2".
Zürcher See Guest
-
Kannan.V [MCSD.net] #3
RE: Control ID
hi,
any reason as to why u need to reset the counter,
You can assign an ID to the control at design time.
Dont implement the inaming container interface to prevent prefixing the
controls with "ctlxxx".
regds,
Kannan.V
"Zürcher See" wrote:
> Is it possible to reset the counter of the automatic id generator of the
> ControlCollection?
> When I add a Control to a new ControlCollection it recive the id "ctl1", if
> the ControlCollection is cleared, the automatic counter won't be reset and
> the next added control recive the id "ctl2".
>
>
>Kannan.V [MCSD.net] Guest



Reply With Quote

