Gridview template parent row reference?

I was wondering how, from an event on a child, inside a template field belonging to a gridview, I could refer to a row.

[edit: Apparently I'm wrong and the parent is not empty, weird stuff is everything.]

A Thing is a checkbox representing a logical state regarding the user's relationship to an ID. I have to update this information manually, either by deleting the target row or by inserting it depending on the state of the checkbox.

Username I can get pretty easily, actual state via function too.

So how do I get the ID that is in the row referenced by the gridview from within this event?

I absolutely need this information, I cannot use a workaround involving changes to the database or the method used to accomplish what I intend to do. I absolutely have to use a checkbox and this event.

0


a source to share


1 answer


It seems like the simplest solution I could use was to add a hidden field associated with the ID and reference that instead of going knee deep into esoteric references. It became a simple FindControl question.

like (myChkBox.Parent.FindControl ("myHiddenField") as HiddenField) .Value



Maybe not as sexy as it could be, but still, it works I guess.

0


a source







All Articles