C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
Java
Learn iOS Programming
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
2
Reply
Add data to dataGridView
Mike Jonson
14y
5.1k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
There are two ways to add data 1) By assigning an Object of Datatable/Hashtable/arraylist etc to the 'Datasource' Property of GridView 2) Or, manually add rows and values to GridView
Nizam Ansari
13y
0
Hi!
There is
a problem:
He created
the following
event handler
:
private void bOk_Click(object sender, EventArgs e)
{
DebitEnter me = new DebitEnter();
float income;
float.TryParse(tbSumm.Text, out income);
me.Debit = income;
me.DateEnter = dateTimePicker_Debit.Value;
me.Category = tbCategory.Text;
me.Description = textBox_Description.Text;
//add debit in table
fdebit.AddDebit(me);
}
Created a method:
//add debit in table
public void AddDebit(DebitEnter me)
{
dataGridView_Debit.Rows.Add(me.Category, me.Description, me.Debit, me.DateEnter);
}
But
when
I press
the button
in
datagridviev
nothing
is added
.
Why
can not
understand
? Please, help!
Mike Jonson
14y
0
Message