Click here to Skip to main content
15,860,859 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi..

i have datagrid control and inside the grid i have added a stack panel control and i added label and image controls.

now i clicked the image inside datagrid and now i need to get the image values and label values inside the stack panel of the particular row.

how to handle this..

need ur suggestions..
regards
gopal.
Posted
Updated 20-Sep-12 20:18pm
v2
Comments
Adam David Hill 21-Sep-12 4:04am    
Can you show some code, specifically how you put the values into those controls in the first place?

By what means are you deciding which row you want to read? Is there some particular event happening related to that row, or maybe you want to retrieve it by index etc.?
Member 10763222 22-May-14 2:20am    
Hi Everyone,

[REFERRING TO THE ABOVE EXAMPLE CODE]

<datagrid name="XCV">
<datagrid.columns>
<datagridtemplatecolumn header="Student">
<datagridtemplatecolumn.celltemplate>
<datatemplate>
<stackpanel>
<stackpanel>
<Label Name="lblStuName" />
</stackpanel>
<stackpanel>
<Button x:Name="btnMyButton" />
</stackpanel>
</stackpanel>
</datatemplate>
</datagridtemplatecolumn.celltemplate>
</datagridtemplatecolumn>
</datagrid.columns>
</datagrid>

Can somebody please tell me, how can I get to the control "datagrid" in visual tree while I know the current keyboard focus

is on the button which is inside the stack panel.( The design cannot be changed.)

All I want to have, is to 'do nothing' in the lost focus event of the datagrid when user clicks on the button. I want to

save the data of the datagrid to a table which is not bound to the datagrid upon lost focus event of the datagrid(not

loosing focus to button, but when user leaves the datagrid and goes to some other control in the window.).

Thank you in advance. Any help is appreciated.

--
Jayaraj

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