datagridview

Assigning values to the datagridview cell.

How can I assign values of the textbox to the datagridview cell ? ...

Can I assign the values to datagridview cells at a time ?

Can I assign the values to datagridview cells at a time like datagridview1[0,0].value = "zero column zero row" datagridview1[1,0].value = "first column zero row" datagridview1[0,1].value = "zero column first row" datagridview1[1,1].value = "first column first row" It gives error Index was out of range. Must be non-negative and less...

How to refresh datagridview when closing child form?

I've a dgv on my main form, there is a button that opens up another form to insert some data into the datasource bounded to the dgv. I want when child form closes the dgv auto refresh. I tried to add this in child form closing event, but it doesn't refresh: private void frmNew_FormClosing(object sender, FormClosingEventArgs e) {...

how to insert value into DataGridView Cell ?

hi i have DataGridView (that hold any DataBase) i want to insert any value into any Cell (and that this value will save on DataBase) how to do it (in C#) thank's in advance ...

How to fill combobox column in datagrid view in vb.net?

My datagrid view contains three columns, column types are checkbox, textbox and combobox. If I check one row, it will load corresponding rows combobox only. How can I do it? ...

How to Edit rows in DataGridView?

I've a button on my frmMain that opens up another frmEdit which has a datagridview that displays the following query: BindingSource bs = new BindingSource(); string sqlqry = "select p_Name from Items where p_Id=" + p_Id; SqlCeCommand cmd = new SqlCeCommand(sqlqry1, conn); SqlCeDataReader rdr = cmd.ExecuteReader(); bs.DataSource = rdr; ...

how to create datagridview dynamically in c#?

how to create datagridview dynamically in c#? ...

GUI freezing after datagridviews have been updated using backgroundworkers

I have made an application which runs three backgroundworkers simultaneously. It basically updates three datagridviews, which it is doing spot on. My problem is if I press maximizebox button or anywhere in any of the datagridview the program hangs for quite a long time. I am able to use the horizontal scroll but not vertical scrolls. I h...

Sort multiple columns while using a bindingsource or bindinglist

Hi everyone. I have a problem I am trying to fix and it's sorting a DataGridView on multiple columns. I have read that this option is not a feature built-in the DataGridView and I have to implement it. I have found multiple solutions, but none quite got to do the work. I'm also quite a newbie in C# and I don't know much of the .Net lib...

How to edit datagridview using SqlCeDataAdapter?

I've a frmEdit with datagridview that's bouned to this: string sqlqry1 = "select p_Name from Items where p_Id=" + p_Id; using (SqlCeDataAdapter a = new SqlCeDataAdapter(sqlqry1, conn)) { DataTable dt1 = new DataTable(); a.Fill(dt1); dataGridView1.DataSource = dt1; } How to ed...

C# how to display datetimepicker control for all rows of gridview

Hi, In my application I am creating rows and columns dynamically. I created a column of type System.DateTime. After this i want to display datetimepicker control for all rows in that column. I created a column using dataTable.Columns.Add("CreatedOn", Type.GetType("System.DateTime")); and i am adding rows as foreach(String filename ....

.NET DataGridViewComboBoxCell behaviour on losing focus

I have a DataGridView bound to a DataTable. Once the binding is done, I manually search through all the cells of the DGV and replace a single regular DGV cell with a DataGridViewComboBoxCell instance. The cell has its own data source bound to it. The problem I'm having is that when the user makes a selection in the DataGridViewComboBoxC...

How to set related column rows into single row in datagridview using vb.net?

Dataset contains name subject total ram tamil 99 ram english 89 ram Maths 70 i need to fill datagrid like name subject total tamil 99 ram english 89 maths 70 how to group rows in datagrid view? using vb.net ...

Binding DataGridView to a list of various obects? c#

Let say I'll create a DataGridView with four columns of types TextBox, Button, ComboBox, and Link. How would I populate something like this? ...

Help with Find() in the BindingSource

I use this to look for values in my DataGridView: private void fndBtn_Click(object sender, EventArgs e) { BindingSource src = new BindingSource(); src.DataSource = dataGridView1.DataSource; src.Position = src.Find("p_Name", textBox1.Text); } But I've two issues. First when I look fo...

WinForms - DataGridView Inherits style from GroupBox

I have a weird problem, and I don't know if this is the default behaviour of .Net DataGridView inside a GroupBox/TabControl. I've created a new WinForm project from scratch, and created a GroupBox(changed the text style). Like this: Then, I've created a simple DataGridView, no font style at all, like this: Then, in design mode, I ...

New records added to DataGridView aren't displayed

I have a custom Order class, groups of which are stored in List<Order> and a DataGridView. I think the problem is in my implementation so here's how I'm using it: In the form enclosing DataGridView (as OrdersDataGrid): public partial class MainForm : Form { public static List<Order> Orders; public MainForm() { // ...

how to connect multiple tables and populate into a datagridview control ?

how to connect multiple tables and populate into a datagridview control ? What i can think is create a view, but if there any other better resolutions ? ...

Databind List Of Objects To A WinForms DataGridView, But Not Show Certain Public Properties

I'm not even sure if i'm doing this correctly. But basically I have a list of objects that are built out of a class. From there, I am binding the list to a datagrid view that is on a Windows Form (C#) From there, it shows all the public properties of the object, in the datagrid view. However there is some properties that i still need ac...

Why should I not use an ASP.NET datagrid control in MVC

I don't want to make this into a "which is better... MVC or WebForms" type of question. Im sure that has been asked a bunch of times here already. My Question: If I am building a MVC web project, why should I not use an ASP.NET datagrid control on one of my "Views" .aspx pages? ...