Click here to Skip to main content
15,903,033 members
Home / Discussions / C#
   

C#

 
QuestionCheck to see if row index exists Pin
kandiyohiv26-Sep-07 19:14
kandiyohiv26-Sep-07 19:14 
AnswerRe: Check to see if row index exists Pin
Imran Khan Pathan26-Sep-07 19:41
Imran Khan Pathan26-Sep-07 19:41 
AnswerRe: Check to see if row index exists Pin
Xmen Real 26-Sep-07 19:45
professional Xmen Real 26-Sep-07 19:45 
Questionconcurrent database update Pin
anydie26-Sep-07 18:56
anydie26-Sep-07 18:56 
AnswerRe: concurrent database update Pin
pmarfleet26-Sep-07 19:47
pmarfleet26-Sep-07 19:47 
GeneralRe: concurrent database update Pin
anydie27-Sep-07 3:30
anydie27-Sep-07 3:30 
AnswerRe: concurrent database update Pin
Malcolm Smart27-Sep-07 0:41
Malcolm Smart27-Sep-07 0:41 
QuestionSimple example of DataGridView..? Pin
JamesParsons26-Sep-07 18:02
JamesParsons26-Sep-07 18:02 
Hello,

I'm hoping someone can help me out here.

I want to get started using DataGridView, but I've not actually managed to find any examples that fit what I'm trying to do.

What I want to do is very simple:

(1) I have a list of class instances thus:
<br />
List<MyClass> classList = new List<MyClass>();<br />
<br />
classList.Add(new MyClass("Fred"));<br />
classList.Add(new MyClass("Wilma"));<br />
<br />
etc 



(2) I want each MyClass member of classList to be represented as a row in my DataGridView

(3) I want to show only a subset of the class parameters, for example:

<br />
public class MyClass<br />
{<br />
private string name;<br />
private string desc;<br />
<br />
private int anumber;<br />
<br />
// Want to show these in the interface<br />
public String Name<br />
{<br />
get { return (name); }<br />
set { name = value; }<br />
}<br />
public String Description<br />
{<br />
get { return (desc); }<br />
set { desc = value; }<br />
}<br />
<br />
// etc..<br />
<br />
<br />
// I DON'T want to show this in the interface<br />
public int Number<br />
{<br />
get { return (anumber); }<br />
set { anumber= value; }<br />
}<br />
}<br />


I understand that I need to set the DataSource parameter of my DataGridView to my data, in some way, but I don't seem to be able to get it to work. Do I need to do something to my classes to get it to work?

I think that sums it up. No SQL, nothing just a nice list of data that I want to display.

Can anyone help? Many thanks!!

Smile | :)
AnswerRe: Simple example of DataGridView..? Pin
Kodanda Pani27-Sep-07 1:17
Kodanda Pani27-Sep-07 1:17 
AnswerRe: Crystal report display problem Pin
Paul Conrad26-Sep-07 17:51
professionalPaul Conrad26-Sep-07 17:51 
GeneralRe: Crystal report display problem Pin
Malcolm Smart26-Sep-07 22:04
Malcolm Smart26-Sep-07 22:04 
GeneralRe: Crystal report display problem Pin
Paul Conrad27-Sep-07 2:35
professionalPaul Conrad27-Sep-07 2:35 
QuestionProgress Bar Pin
Xmen Real 26-Sep-07 14:03
professional Xmen Real 26-Sep-07 14:03 
AnswerRe: Progress Bar Pin
dengboo26-Sep-07 14:11
dengboo26-Sep-07 14:11 
GeneralRe: Progress Bar Pin
Xmen Real 26-Sep-07 14:21
professional Xmen Real 26-Sep-07 14:21 
AnswerRe: Progress Bar Pin
Liam O'Hagan26-Sep-07 19:46
Liam O'Hagan26-Sep-07 19:46 
QuestionHow to write a generic method to convert int, long, double, etc to a byte array? Pin
rookie nick26-Sep-07 12:03
rookie nick26-Sep-07 12:03 
AnswerRe: How to write a generic method to convert int, long, double, etc to a byte array? Pin
Dave Kreskowiak26-Sep-07 13:10
mveDave Kreskowiak26-Sep-07 13:10 
GeneralRe: How to write a generic method to convert int, long, double, etc to a byte array? Pin
rookie nick26-Sep-07 14:42
rookie nick26-Sep-07 14:42 
GeneralRe: How to write a generic method to convert int, long, double, etc to a byte array? Pin
Judah Gabriel Himango26-Sep-07 17:45
sponsorJudah Gabriel Himango26-Sep-07 17:45 
GeneralRe: How to write a generic method to convert int, long, double, etc to a byte array? Pin
Dave Kreskowiak27-Sep-07 4:25
mveDave Kreskowiak27-Sep-07 4:25 
GeneralRe: How to write a generic method to convert int, long, double, etc to a byte array? Pin
rookie nick27-Sep-07 5:43
rookie nick27-Sep-07 5:43 
GeneralRe: How to write a generic method to convert int, long, double, etc to a byte array? Pin
rookie nick27-Sep-07 6:26
rookie nick27-Sep-07 6:26 
QuestionCreating Textbox with Checkbox Pin
Can_8526-Sep-07 11:41
Can_8526-Sep-07 11:41 
AnswerRe: Creating Textbox with Checkbox Pin
pmarfleet26-Sep-07 11:57
pmarfleet26-Sep-07 11:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.