LIstView Project


Posted Date:     Total Responses: 0    Posted By: Zoana Tayeba   Member Level: Bronze   Points/Cash: 5   


namespace FinalListView
{
public partial class Form1 : Form
{
private string studentName;
private string contactNumber;
private string emailAddress;
private Student selectedStudent;
private int selectedRowIndex;


public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
Savebutton.Visible = true;
Cancelbutton.Visible = false;
Updatebutton.Visible = false;
}

private void Savebutton_Click(object sender, EventArgs e)
{

studentName = StudentNametextBox.Text;

contactNumber = ContactNumbertextBox.Text;

emailAddress = EmailAddresstextBox.Text;

Student studentObj = new Student( StudentNametextBox.Text, ContactNumbertextBox.Text , EmailAddresstextBox.Text);

ListViewItem item = new ListViewItem();
item.Tag = studentObj;
item.Text = studentObj.StudentName_;
item.SubItems.Add(studentObj.ContactNumber_);
item.SubItems.Add(studentObj.EmailAddress_);
StudentlistView.Items.Add(item);

ClearTextBox();


}

private void ClearTextBox()
{
StudentNametextBox.Text = "";
ContactNumbertextBox.Text = "";
EmailAddresstextBox.Text = "";
}

private void StudentlistView_DoubleClick(object sender, EventArgs e)
{
ListViewItem selectedListViewCell = StudentlistView.SelectedItems[0];
selectedStudent = (Student)selectedListViewCell.Tag;
SetDataInTextBoxes();

selectedRowIndex = StudentlistView.SelectedIndices[0];


Savebutton.Visible = false;
Cancelbutton.Visible = true;
Updatebutton.Visible = true;

}

private void SetDataInTextBoxes()
{
StudentNametextBox.Text = selectedStudent.StudentName_;
ContactNumbertextBox.Text = selectedStudent.ContactNumber_;
EmailAddresstextBox.Text = selectedStudent.EmailAddress_;
}

private void Updatebutton_Click(object sender, EventArgs e)
{
Student StudentObj = new Student(StudentNametextBox.Text, ContactNumbertextBox.Text, EmailAddresstextBox.Text);

ListViewItem item = new ListViewItem();
item.Tag = StudentObj;
item.Text = StudentObj.StudentName_;
item.SubItems.Add(StudentObj.ContactNumber_);
item.SubItems.Add(StudentObj.EmailAddress_);
StudentlistView.Items[selectedRowIndex] = item;

MakeOperationForSaveButton();

}

private void MakeOperationForSaveButton()
{
Savebutton.Visible = true;
Cancelbutton.Visible = false;
Updatebutton.Visible = false;
}

private void Cancelbutton_Click(object sender, EventArgs e)
{
foreach ( ListViewItem selctedItem in StudentlistView.SelectedItems)
{
StudentlistView.Items.Remove(selctedItem);

}
MakeOperationForSaveButton();
}
}
}


Attachments

  • LIstView Project (1399-231953-FinalListView.rar)

  • Project Feedbacks

    Author: Member Level: BronzeRevenue Score: 1 out of 5
    really nice project...really that help me


    Author: Member Level: SilverRevenue Score: 1 out of 5
    hi,Very good project,useful also but need some changes


    Author: Member Level: BronzeRevenue Score: 2 out of 52 out of 5
    hi..

    your project was really good.
    can u mail me the documentation of this project at deepti.maluskar14@gmail.com


    Author: Member Level: BronzeRevenue Score: 1 out of 5
    good one.


    Author: Member Level: BronzeRevenue Score: 1 out of 5
    very good code


    CamStudio.txt
    Author: Member Level: SilverRevenue Score: 2 out of 52 out of 5
    hi,
    your project was good but it should have some improvement in adding. if you add some validations it looks better


    Author: Member Level: BronzeRevenue Score: 2 out of 52 out of 5
    hi.......
    your project was good and also helpful to me..
    please send the documentation of this project at potharlankasunitha@gmail.com
    as soon as possible



    Author: Member Level: BronzeRevenue Score: 1 out of 5
    very good code


    Author: Member Level: BronzeRevenue Score: 1 out of 5
    Really very nice project fo begginers.



    Author: Member Level: SilverRevenue Score: 2 out of 52 out of 5
    Hi,

    I can't able to run this project. Please send the upgraded version of code.

    Thanks,
    Vetri


    Author: Member Level: GoldRevenue Score: 2 out of 52 out of 5
    hi,

    It is a good project and also easy to understand .
    when i run this project i feel there need little changes. Hope this will helpful in future.


    from
    mausumi


    Author: Member Level: GoldRevenue Score: 2 out of 52 out of 5
    hi,
    Your Project Was Very good.ican understand it very clearly.but ihav a sugession,that is please improve your project design.
    Thanks and Regards
    Sivasreenath



    Author: Member Level: GoldRevenue Score: 2 out of 52 out of 5
    hi,
    Your Project Was Very good.ican understand it very clearly.but ihav a sugession,that is please improve your project design.
    Thanks and Regards
    Sivasreenath



    Author: Member Level: GoldRevenue Score: Revenue Score: 0
    Hi Zoana Tayeba,

    It is good but way of presentation is not correct.
    I checked your project.
    I can suggest you some changes needs to be done to the code.
    1.After saving, when i select the Listview record and Update the Record, Clicked on 'Update', it is creating one more row, but not updating the record.
    2.And when i select the Listview record and Update the Record, Clicked on 'Cancel', It Shouldn't cancel the operation of update. But it is performing remove

    functionality in Listview. You have to give name 'Remove' for the button.
    3. After the above operation it is offering to save again.

    Hope you understood.





    Post Feedback
    You must Sign In to post a feedback.
    Next Project: online web application for sending sms
    Previous Project: Medical Data Analysis

    Return to Project Index

    Post New Project


    Related Projects


    Top Contributors
    TodayLast 7 Daysmore...

    Awards & Gifts

    Online Members

    More...
     
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India