Avatar of faridos
faridos
 asked on

how can I find the itemindex in a datalist whilst I am in the item template

Given a datalist and has the item template populated with a textbox and a Button
I want to pressthe button so the form will display the value found in the textbox
many proposals say

((TextBox)DataList.Items(item_index).FindControl("StudentID")).Text;

the question is how can I find the item_index of this datalis

Thanks you for any help provided

Fred
Web Development Software.NET ProgrammingWeb Applications

Avatar of undefined
Last Comment
faridos

8/22/2022 - Mon
avnish_tanna

faridos

ASKER
Thank you Avnish, but this will not solve the qustion onhand. On the same cell (amongst other 10 cells in a datalist) I have label1 and textbox1 and command 1. I want to click on commans1 click event and want it to display the value in textbox1 of that specificly selected cell. so I am not in the selectedvalue stage here, I am interpreting values withing the cell itself. Hope this clarifies it more.
All reseraches I am making are pointing to this type of solution
((TextBox)DataList.Items(item_index).FindControl("StudentID")).Text;
HOw can I get this item_index valu whilst I a m in the cell
ASKER CERTIFIED SOLUTION
avnish_tanna

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
faridos

ASKER
Thank you Avinsh the post helped and fixed what I was looking for. I have another question in a different post, maybe you can help me figure this out
https://www.experts-exchange.com/questions/24193889/How-to-make-the-selected-index-of-a-gridview-residing-inside-a-datalist-to-act-like-a-command-select.html?cid=239&anchorAnswerId=23819597#a23819597
Any assistance in that is also appreciated
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck