Hi,
not really unless you play with only client-side controls (e.g have
client.side HTML which doesn't use server controls).
Certainly you could get over it by assigning the ID (per row, whuch you get
from db) to DataGrid's DataKeyField and get it from there when you get
reference to any particular CheckBox in the grid (the current DataGridItem
is Parent's Parent to the CheckBox in control hierarchy amd with
DataGridItem you get the info on which row you are on the grid).
Idea is exactly opposite to your custom naming that you don't acuyally need
to name them yourself, you can use other means. One other way would be using
just HTML checkboxes (<input type="checkbox" runat="server" />) for which
you could according to the HTML model assign also value to the Value
attribute/property. That's another place where you could place the ID
special to the row/checkbox
--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke
"Alex" <> wrote in message
news:0ACBA69E-5E8E-45D6-AC80-...
> I am building a grid which I am adding my own templated columns to. One
of
> the columns has a checkbox and I am assiging the checkbox an ID based on
the
> row of the griid. When the grid gets built, the checkbox ID is changed so
> that it is a combination of the parent control IDs and its id. Is there
any
> way to prevent this behaviour?
>
> Thanks,
>
> Alex Gadea