Re: How to know the selected row in a DataControlField

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi bhavesh,

first of all thanks a lot for the fast answer.

I've tried to explore html code generated and i found out the piece of
information
you tell me about.
So I saw that client ID is a sort of $ separated format in wich i could
find the row number
hide in this code 'ct101', but i'm not sure of that.

This could help me, but i would like to spend many time yet to find a
less complex and more clear
solution.

Please, tell me if i misunderstood either what you told me or how the
client ID is composed.

Bye.

bhavesh ha scritto:

hi james,

just try to view source of ur page generated.

then u will come to know that how the id of image button is generated.


u can access the client id of image button in itemcommand event.

and from there u can split the client id accordingly to get the index
of row in which image button is clicked.

i had this requirement in my repeater control.

and i have achieved this successfully just today.

so u can do same for Gridview control.

try this and then tell me if u got ans.


JamesD wrote:
Hi.

I'm creating a custom WebControl that extends GridView. This control
loads its columns dinamically reading from a XML configuration file.
Many columns loaded by the control may be a custom DataControlField
filled with an ImageButton.
I'm able to handle the click or the command event generated pressing
the ImageButton, directly in the DataControlField i made, but I would
need to know the corresponding row of the pressed ImageButton and i
cannot do that.

Do anyone of you know if is it possible to do that and how?

Thank you so much in advance.

Matteo

.


Quantcast