silverlight中如何获取DataGrid中的值

 private void dg_SelectionChanged(object sender, SelectionChangedEventArgs e)         {           

            //获取选定单元格列

            Int32 i = dg.CurrentColumn.DisplayIndex;

           //取值             string sColumnValue = ((TextBlock)this.dg.Columns[i].GetCellContent(this.dg.SelectedItem)).Text.Trim();

        }

posted @ 2013-03-27 11:06  碧落京豪  阅读(142)  评论(0编辑  收藏  举报