Click here to Skip to main content
12,078,259 members (48,950 online)
Rate this:
 
Please Sign up or sign in to vote.
i have added the context menu on list view and on click of view context i want to get the Ip address of student and on that ip add
i want to assign seperate lesson to only student of that machine plz help me.I just want how i get the IP address on which the context
menu occure and i am assigning lesson then i will using that ip send the message by using socket programming. i am posting my code here..
thanks
Window1.xaml
<window x:class="WpfApplication5.Window1" xmlns:x="#unknown">
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300" Loaded="Window_Loaded">

Window.xaml.cs
<pre lang="cs">using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
 
namespace WpfApplication5
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
            ListView.DataContext = new ObservableCollection<Person>()
                            {
                                new Person() {Position = 1, Name ="abc", Status = "Online",IPAdd="198.168.1.2"},
                                new Person() {Position = 2, Name  = "xyz", Status = "Online",IPAdd="198.168.1.2"},
                                new Person() {Position = 3, Name= "lmn", Status = "Online",IPAdd="198.168.1.2"},
                                new Person() {Position= 4, Name = "pqr", Status = "Online",IPAdd="198.168.1.2"}
                            };
        }
        public class Person
        {
            public int Position { get; set; }
            public string Name { get; set; }
            public string Status { get; set; }
            public string IPAdd { get; set; }
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
        }
 
    }
}


Posted 30-Apr-11 3:52am
Edited 1-May-11 20:21pm
v3

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Your list view already displays the age in a column. So what would you achieve by that view menu?
  Permalink  
v2
Comments
vishal_h 2-May-11 0:50am
   
thanks for prev response.sir i have change my question plz give your some inputs..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web03 | 2.8.160212.1 | Last Updated 2 May 2011
Copyright © CodeProject, 1999-2016
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