Hi all,
Please solve my Problem:
I have DataGridView and Dataset. I want to add data from dataset to datagridview row by row and not by using DataGridView.DataSource method.
For ex. following is the way to do the same using Vb.net
dgClient.Columns.Add("client", "Client") dgClient.Columns("client").Width = 150 dgClient.Columns.Add("comments", "Comments") dgClient.Columns("comments").Width = 250
Dim i As Integer For i = 0 To dsClient.Tables("TableClient").Rows.Count - 1 dgClient.Rows.Add() dgClient.Rows(i).Cells("client").Value = dsClient.Tables("TableClient").Rows(i).Item("Client") dgClient.Rows(i).Cells("comments").Value = dsClient.Tables("TableClient").Rows(i).Item("Comments") Next
How I can do above using C#
Thanks in advance
Hi Swap, you will have to do some databinding and invoke the CurrencyManager as well. There is also a BindingManagerBase class that should prove to be usefull as well.
See www.akadia.com/services/dotnet_databinding.html
See ya
edreflak