Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am trying to add attributes to my gridview at runtime in rowdatabound as


e.Row.Attributes.Add("onclick", "alert('Test')")


I want to remove it for the first two columns.

I have tried

e.Row.Cells(0).Attributes.Remove("onclick")

But its not working.
Help Please!!
Posted
Updated 11-Mar-13 21:21pm
v2

1 solution

i am using

e.Row.cells[icount].Attributes.Add("onclick", "alert('Test')")

in place of

e.Row.Attributes.Add("onclick", "alert('Test')")


I t works fine as i am excluding the first 3 counts (where i dont need these attributes.)

Still a better solution i am seeking.

Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900