Skip to content

Instantly share code, notes, and snippets.

@wtuts
Created June 23, 2014 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wtuts/150ccad483515ee1badd to your computer and use it in GitHub Desktop.
Save wtuts/150ccad483515ee1badd to your computer and use it in GitHub Desktop.
Databinding in listbox
public void secondmethod()
{
for (int i = 0; i < 8; i++)
{
//Create a new object of Result class
Resultclass obj = new Resultclass();
//add the corresponding data from the sample array
obj.name = studentnames[i];
obj.marks = studentmarks[i];
//add the object directly into the list box
mylistbox.Items.Add(obj);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment