<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" style="font-family:'돋움';font-size:12px;color:#333333;line-height:18px;"><tbody><tr><td colspan="2" valign="top"><br><p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;"><br>GridView 의 아이템이 선택되도록 하고싶습니다.</p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;"> </p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;">GridView를 이용하여 list 데이터를 보여주고 있습니다. <br>그리고 특정 셀에 대해서는 내용을 변경하여 db 에 저장하려고 합니다.</p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;">GridView 에 TextBox를 올려서 보여주는것 까지는 되었는데 문제가 있어서 이렇게 글을 남깁니다.</p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;"><br></p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;">item을 선택하면 focus가 잡힙니다. <br>그런데 item 을 선택하지 않고 textbox만 선택하면 item 선택이 되지 않습니다.</p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;">textbox를 선택하면 해당 item 이 선택되도록 하고 싶습니다. <br>어떻게 해야 되면 좋을지 조언 부탁드리겠습니다.</p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;"><br></p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;"><br></p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;"><br></p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;"><br></p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;">private void LstView_textOut(object sender, RoutedEventArgs e)<br>{<br> TextBox aa = (TextBox)sender; <br> string txt = aa.Text(); // 텍스트는 가져옴.<br> <br> ttData td = (ttData)lst.SelectedItem; // item 선택이 안된 상태라 td 값이 null 임. <br> // textbox가 아닌 item을 선택한 후 이 함수 실행하면 td값이 정상적으로 나옴.<br>}</p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;"><br></p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;">private void <span style="font-family:'돋움';font-size:12px;">LstView_textIn(</span><span style="font-family:'돋움';font-size:12px;">object sender, RoutedEventArgs e)</span></p><span style="font-family:'굴림';font-size:13.3333px;">{<br><span style="white-space:pre;"> </span>// 여기서 선택한 text box 의 아이템을 선택한것처럼 하고 싶습니다. <br>}<br></span> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;"><br></p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;"><br></p> <p style="font-size:10pt;margin-bottom:0px;font-family:'굴림';margin-top:0px;line-height:1.2;"><br><Grid><br> <ListView Name="lst" IsSynchronizedWithCurrentItem="True"><br> <ListView.View><br> <GridView><br> <GridViewColumn DisplayMemberBinding="{Binding Path=cat_id}" Header="Idx" Width="80"></GridViewColumn> <br> <GridViewColumn DisplayMemberBinding="{Binding Path=tt_id}" Header="tt" Width="200"></GridViewColumn><br> <GridViewColumn Header="eng" Width="200"><br> <GridViewColumn.CellTemplate><br> <DataTemplate><br> <TextBox Text="{Binding Path=tt_data}" Width="150" LostFocus="LstView_textOut" GotFocus="LstView_textIn" /><br> </DataTemplate><br> </GridViewColumn.CellTemplate><br> </GridViewColumn><br> </GridView><br> </ListView.View><br> </ListView><br> </Grid></p></td></tr></tbody></table>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.