Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 20-Sep-12 21:17pm
Edited 20-Sep-12 21:18pm
v2
Comments
AdamDavidHill at 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 at 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)

  Print Answers RSS
0 OriginalGriff 490
1 Sergey Alexandrovich Kryukov 395
2 Maciej Los 285
3 ProgramFOX 265
4 CHill60 200
0 OriginalGriff 490
1 Sergey Alexandrovich Kryukov 395
2 Maciej Los 285
3 ProgramFOX 265
4 CHill60 200


Advertise | Privacy | Mobile
Web03 | 2.8.150331.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100