Tuesday, 15 March 2011

c# - Selecting a full row in DataGrid, Silverlight Navigation Application -



c# - Selecting a full row in DataGrid, Silverlight Navigation Application -

this might stupid question haven't been able find reply anywhere.

i trying create possible when user clicks on row in datagrid entire row selected.

in wpf have set selection mode fullrowselect in current project datagrid doesnt have option. 2 options have selectionmode : single or extended.

currently xaml code looks :

<sdk:datagrid x:name="showklant" grid.column="0" autogeneratecolumns="false" canuserreordercolumns="false" isreadonly="true" selectionchanged="showklant_selectionchanged" alternatingrowbackground="#ff4568c7" rowbackground="#aa73a4d4"> <sdk:datagrid.columns> <sdk:datagridtextcolumn header="klant id" binding="{binding klantid}"/> <sdk:datagridtextcolumn header="voornaam" binding="{binding voornaam}"/> <sdk:datagridtextcolumn header="achternaam" binding="{binding achternaam}"/> </sdk:datagrid.columns> </sdk:datagrid>

the reason want when entire row selected can utilize code similar value first cell.

idklant = convert.toint32(showklant.selectedrows[0].cells[0].value);

found solution question, after using error study in search.

link solution: how read value in first cell in selected row of datagrid?

have tried setting selection mode of info grid?

<datagrid x:name="test" selectionmode="single" >

c# xaml datagrid

No comments:

Post a Comment