Controlling the html

  • Thread starter Andy Sutorius via DotNetMonster.com
  • Start date
A

Andy Sutorius via DotNetMonster.com

Hi,

The datagrid auto generates html for everything in the grid, including
controls. Can you manipulate the html the grid outputs? Can you make this
auto generated name for a text box, dgdANSI835:_ctl2:type, into this
manipulated name for the text box, type_119789 (where 119789 represents a
unique row number)?

Thanks,

Andy
 
B

Brock Allen

Sure, but you'll have to use a TemplateColumn. In the TemplateColumn where
you declare the <asp:TextBox> just give it whatever ID="XYZ" you prefer.
The only problem is that it is contained inside of other controls, so the
ID that it will end up with in the broswer will be prefixed/scoped with the
container controls.

I suspect you're trying to do something specific here... Can you shed some
light on what you're trying to accomplish?
 
A

Andy Sutorius via DotNetMonster.com

I want to compare the values from the textbox against the original data in
order to generate an update sql statement. I am trying to get the name of
the textbox to match the column name of the original data.

Brock said:
Sure, but you'll have to use a TemplateColumn. In the TemplateColumn where
you declare the <asp:TextBox> just give it whatever ID="XYZ" you prefer.
The only problem is that it is contained inside of other controls, so the
ID that it will end up with in the broswer will be prefixed/scoped with the
container controls.

I suspect you're trying to do something specific here... Can you shed some
light on what you're trying to accomplish?


[quoted text clipped - 7 lines]
 
G

Guest

As far as I am aware you cannot. But once you understand the naming scheme it
is fairly easy to interact with them:

[containername](unless on parent form)__[controlname]__ctl[rowNum (1
based)]__ctl[columnNum(0 based)]

Also if you're using NUnitASP you can interact with them more directly,
please reply if you want me to expand on that.

Jason L Lind
Senior Software Engineer - Triton Tek
 
S

Shimon Sim

I didn't work with DataSet for a while. But look into DataGrid binding and
wording with dataset.
Shimon.

Andy Sutorius via DotNetMonster.com said:
I want to compare the values from the textbox against the original data in
order to generate an update sql statement. I am trying to get the name of
the textbox to match the column name of the original data.

Brock said:
Sure, but you'll have to use a TemplateColumn. In the TemplateColumn where
you declare the <asp:TextBox> just give it whatever ID="XYZ" you prefer.
The only problem is that it is contained inside of other controls, so the
ID that it will end up with in the broswer will be prefixed/scoped with
the
container controls.

I suspect you're trying to do something specific here... Can you shed some
light on what you're trying to accomplish?


[quoted text clipped - 7 lines]
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top