Generate click event for items in DataList?
-
Hi I have a button in my Datalist rows. I want to generate click event for this button in the datalist. Along with the clicking I want to pass row id of that row. How will I do that? Thanks, Sandy
-
Hi I have a button in my Datalist rows. I want to generate click event for this button in the datalist. Along with the clicking I want to pass row id of that row. How will I do that? Thanks, Sandy
-
Hi, You can use OnItemCommand event to handle your button click event. And to send the row ID you can use the commandargument which you can use in that event. Best Regards, Apurva Kaushal
but how can I pass the row ID for the button. I am getting row id from the database. Thanks, Sandy
-
but how can I pass the row ID for the button. I am getting row id from the database. Thanks, Sandy
-
Hi, There is a property called commandargument for the button there you can set the rowID of that row. This you can do either in the onitemdatabound or at the html section. Best Regards, Apurva Kaushal
Thanx for ur replies. it really helped me. How can I set the visibility of the button to false on ItemCommand event. I want to set the visibility of the button in DataList to false. How can I do it? Thanks, Sandy
-
Thanx for ur replies. it really helped me. How can I set the visibility of the button to false on ItemCommand event. I want to set the visibility of the button in DataList to false. How can I do it? Thanks, Sandy
Hi, You can iterate through all the items of the datalist and then you can find the image button and then can make that invisible or visible. But the same you can do in the OnItemDataBound event because it also iterates through all the items of the datalist. Hope this will help you. Best Regards, Apurva Kaushal
-
Hi, You can iterate through all the items of the datalist and then you can find the image button and then can make that invisible or visible. But the same you can do in the OnItemDataBound event because it also iterates through all the items of the datalist. Hope this will help you. Best Regards, Apurva Kaushal
Thanx for the reply. Thanks, Sandy
-
Thanx for the reply. Thanks, Sandy