Number of rows selected in SelectedCells collection Programming Software Development by midnite11 … the number of rows that are included in the total SelectedCells of a datagridview? This is where the user actually selects… is the total number of rows included in the entire SelectedCells collection. Appreciate any feed back. Re: Number of rows selected in SelectedCells collection Programming Software Development by deceptikon … off the top of my head seems reasonable: rowCount = dgv.SelectedCells.OfType(Of DataGridViewCell)().Select(Function(x) x.RowIndex).Distinct().Count… Re: Number of rows selected in SelectedCells collection Programming Software Development by midnite11 … added each row index as I was looping thru the SelectedCells. I then used LINQ to extract out the Distinct Values… Re: Number of rows selected in SelectedCells collection Programming Software Development by midnite11 deceptikon, I could not use your suggestion as the SelectedCells does not include an "Of Type" property. Not sure how to transform what you provided into a valid LINQ query. Re: Number of rows selected in SelectedCells collection Programming Software Development by deceptikon `OfType` is a LINQ extension method. You'd need to add `System.Linq` to your Imports statements and make sure that the appropriate assemblies are referenced. Re: Number of rows selected in SelectedCells collection Programming Software Development by midnite11 **Added System.Linq....received error below:** Error 105 Overload resolution failed because no accessible 'Select' can be called with these arguments: Extension method 'Public Function Select(Of TResult)(selector As System.Func(Of System.Windows.Forms.DataGridViewCell, Integer, TResult)) As System.Collections.Generic.IEnumerable(Of TResult)' … Update MS ACCESS Database VB.NET Programming Software Development by crispexops … dgmain.CellContentClick tbid.Text = dgmain.SelectedCells(0).Value tbname.Text = dgmain.SelectedCells(1).Value tbyear.Text = dgmain.SelectedCells(2).Value tbdescrip.Text = dgmain… How to Show Decimal Places in a Grid View Programming Software Development by sundog1 ….Text = dataGridView1.SelectedCells[4].Value.ToString(); txtAccTown.Text = dataGridView1.SelectedCells[2].Value.ToString(); txtAccCounty.Text = dataGridView1.SelectedCells[5].Value.ToString();…really to sure where to do this. It is 'SelectedCells[5]' and 'SelectedCells[6]' which hold the 'Cost' and 'Value'… Re: How to Show Decimal Places in a Grid View Programming Software Development by ddanbe I thought you wanted to set the Value in the DGV For the textbox do: `txtSell.Text = dataGridView1.SelectedCells[6].Value.ToString("0.00");` Object reference not set to an instance of an object. Programming Software Development by tibebu.s …= ""; } private void time_out_Click(object sender, EventArgs e) { employee_InformationDataGridView.SelectedCells[0].Style.ForeColor = Color.Red; time_out.Enabled = false; time_in.Enabled… Select a datagrid row on load Programming Software Development by harrispc ….CustName Select customers Me.DataGridView1.DataSource = cust Me.DataGridView1.SelectedCells() = '??? Do I assign this a value? Dim custselect …= DataGridView1.SelectedCells(1).Value Me.CustAccountsDataGridView.DataSource = From accounts In … UPDATE SQL statement pulling in GDV value? Programming Software Development by sundog1 … WHERE CashAccRef_FKID = '" + txtAccRef.Text + "' AND cashID = '" + dataGridView2.SelectedCells[0].Value.ToString() +"' "; //Creates a new version of… is causing the trouble is... ` AND cashID = '" + dataGridView2.SelectedCells[0].Value.ToString() +"' ";` even though the form loads… Add rows per data copied from excel to datagrid Programming Software Development by jared.geli … Dim cc, iRow, iCol As Integer iRow = DataGridView1.SelectedCells(0).RowIndex iCol = DataGridView1.SelectedCells(0).ColumnIndex For i = 0 To tArr.Length… Re: Add rows per data copied from excel to datagrid Programming Software Development by jared.geli … grid Dim r As Integer = dgv.SelectedCells(0).RowIndex Dim c As Integer = dgv.SelectedCells(0).ColumnIndex 'add rows into grid to… Cells not to be pasted with values Programming Software Development by jared.geli ….GetText().Split(Environment.NewLine) r = Form1.DataGridView1.SelectedCells(0).RowIndex c = Form1.DataGridView1.SelectedCells(0).ColumnIndex For i = 0 To tArr.Length… Re: UPDATE SQL statement pulling in GDV value? Programming Software Development by ChrisHunter Is cashID an int value? If cashID is an int do `cashID = " + (int)dataGridView2.SelectedCells[0].Value + "";` In the long run the best thing to do is to creats a stored procedures on the database side, it will help prevent the SQL statements from being changed while you're editing you app. Re: UPDATE SQL statement pulling in GDV value? Programming Software Development by ChrisHunter try `Convet.ToInt64(dataGridView2.SelectedCells[0].Value)` and see what happens. Let me know how you get on. Re: UPDATE SQL statement pulling in GDV value? Programming Software Development by sundog1 … IT! It was down to the... `cashID = '" + (int)dataGridView2.SelectedCells[0].Value + "'"` I just has to remove ' ' and… Gridview is Very slow on the Cells change event Programming Web Development by vuyiswamb … stored in this array foreach (UltraGridCell cell in Gridstaff.DisplayLayout.SelectedCells) { if (cell.Column.Index == 0) { if (cell.Value != null &… Value property (DataGgrid, WPF) Programming Software Development by belkobot Where have the property "Value"? in WinForms we can call: [B]DataGrid.SelectedCells[0].Value.ToString();[/B] but WPF DataGrid has not property "Value" ((( Read data from SQL Programming Software Development by ShemoPT …, username FROM [mybase].[myuser].[users] where username ='" & DataGridView1.SelectedCells(0).Value & "'") Dim GetVaule As New SQL… how i insert values from one table to another table (MS-sql) Programming Software Development by tibebu.s … table. 10q private void time_in_Click(object sender, EventArgs e) { employee_InformationDataGridView.SelectedCells[0].Style.ForeColor = Color.Green; time_in.Enabled = false; time_out.Enabled… current cell dirty state changed property Programming Software Development by judithSampathwa …(DataGridViewDataErrorContexts.Commit); if ((dgvSubContract.CurrentCell.Value != null)) { int r = dgvSubContract.SelectedCells[0].RowIndex; String subName = dgvSubContract.Rows[r].Cells[0].Value… regarding datagrid view combo box column Programming Software Development by judithSampathwa …; } } } private void dgvSubContract_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { int r = dgvSubContract.SelectedCells[0].RowIndex; if (!String.IsNullOrEmpty(string.Format("" + dgvSubContract… datagridview cell validation Programming Software Development by judithSampathwa …. the code i wrote is below. [CODE] int row = dgvActions.SelectedCells[0].RowIndex; if (e.ColumnIndex == 2) { if (e.FormattedValue != null… datagridview becomes empty, button disabled Programming Software Development by AngelicOne … = new SqlDataAdapter("DELETE FROM Book WHERE BookNumber = '" + dataGridView1.SelectedCells[2].Value + "'", con); da.Fill(ds); this.Display… Re: datagridview becomes empty, button disabled Programming Software Development by AngelicOne … = new SqlDataAdapter("DELETE FROM Transactions WHERE Transaction_No = '" + dataGridView1.SelectedCells[0].Value + "'", con); da.Fill(ds); this.Display… task manager Programming Software Development by eikal … thinking it would look something like this [code] if datagridview1.selectedcells = anitem.processname then anitem.kill end if [/code] i know… DataGridView Programming Software Development by trippinz ….Text); } } private void button3_Click(object sender, EventArgs e) { FileLocationToRun = dataGridView1.SelectedCells[1].Value.ToString(); Process.Start(FileLocationToRun); } private void button4_Click(object… Re: DataGridView Programming Software Development by trippinz …} } private void button3_Click(object sender, EventArgs e) { try { FileLocationToRun = dataGridView1.SelectedCells[1].Value.ToString(); Process.Start(FileLocationToRun); } catch { MessageBox.Show("…