Sunday, 6 July 2014

How to get column value from the selected row in data grid in wpf c#.net


Data grid is a control for display the data in tabular format in our application. In data grid when u select any row then for getting this rows unique id write code like :

Ex : //   here we will take ‘dgcustomer’ as datagrid with following column name (Id,Name,RollNumber,Pass) I

string strid = "";

                        DataRowView rowview = dgcustomer.SelectedItem as   DataRowView;

              strid = rowview.Row["Id"].ToString();

MessageBox.Show("ID : " + strid);

 

 

See Also :   Follow Me On Facebook

--
/\/ir@\/  <(.'.)>

0 comments:

Post a Comment

Thanks for comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

 
Toggle Footer