datagridview

DatagridviewComboBoxCell for just one cell

↘锁芯ラ 提交于 2019-12-25 11:48:33
问题 .NET 3.5 Winforms I have a datagridview bound to a datatable at RUNTIME. There are three columns. The third column is the only editable one. Sometimes the value is free text, sometimes the value is a selection from a combobox, or at least that is the design. After I bind the data table to the Datagridview with this code: With dgvColumnFilters .DataSource = _dtFilter .AllowUserToAddRows = False .AllowUserToDeleteRows = False .Columns(0).Visible = False .Columns(0).ReadOnly = True .Columns(1)

DatagridviewComboBoxCell for just one cell

走远了吗. 提交于 2019-12-25 11:48:04
问题 .NET 3.5 Winforms I have a datagridview bound to a datatable at RUNTIME. There are three columns. The third column is the only editable one. Sometimes the value is free text, sometimes the value is a selection from a combobox, or at least that is the design. After I bind the data table to the Datagridview with this code: With dgvColumnFilters .DataSource = _dtFilter .AllowUserToAddRows = False .AllowUserToDeleteRows = False .Columns(0).Visible = False .Columns(0).ReadOnly = True .Columns(1)

Index out of range exception in datagridview when header is selected

喜夏-厌秋 提交于 2019-12-25 10:56:04
问题 I have a datagridview that when I click on a header to sort or for any reason I get the follow error on the following line of code.... Argument our of range exception (Index was out of range. Must be non negative and less than the size of the collection. private void firearmView_CellClick(object sender, DataGridViewCellEventArgs e) { //I get the above error on the IF line below. if (!firearmView.Rows[e.RowIndex].IsNewRow) { selectedFirearmPictureBox.Image = Image.FromFile(firearmView.Rows[e

binding gridview to objects

ε祈祈猫儿з 提交于 2019-12-25 10:05:12
问题 My C# app contains a Data Object like this: public class Data { public class a {get;set;} public class b {get;set;} } public class a { public int first {get;set;} } public class b { public int second{get;set;} } I initialize my data when the application starts and my data changes evey time the app is running. I have a dataGridView and I want to bind to the first property and to second property. The DataGrid contains two columns, that bound to first and to second property. How can I do this

How to make the list of Items displayed in the dataGridView to be (filtered?)

浪子不回头ぞ 提交于 2019-12-25 09:24:50
问题 How to do this? From the users perspective, C# Winforms, as user types into a search textbox, I want the list of Items displayed in the dataGridView to be (filtered?) Here’s what is currently happening: dataGridView uses a list of items as its datasource similar to this: dgv.DataSource = _myItemList; Each item of _myItemListhas 2 properties (id, description) Below the dgv there is a textbox in which user can search for items in the list Currently, when user types in the textbox , a filtered

RouterLink not working in grid in angular 2

送分小仙女□ 提交于 2019-12-25 08:59:29
问题 Recently i started using jqwidgets (here) for my Angular project, it worked well but the only problem is I put edit at each cell.To that edit button routerLink is not working. My code, this.columns = [ { text: 'Id', columntype: 'textbox', width: 80 }, { text: 'Name', columntype: 'textbox',datafield: 'name', width: 130 }, { text: 'Group Name', columntype: 'textbox', datafield: 'group_id', width: 130 }, { text: 'Actions',datafield: 'id', cellsrenderer: Action, width: 100 } ]; This is my action

Best way to pass data to a DataGridView form from another non-form class

纵饮孤独 提交于 2019-12-25 08:47:50
问题 As the title says, I need to pass a list of hashtables from a regular class to a form class to be rendered in a DataGridView. What I've got so far is this: namespace somenamespace { class aldeloUpdater { private static string client = "chanchitos"; private static string establishment = "c1"; static void Main() { try { var guiForm = new GuiForm(); // Instantiating the Form-derived class. string deliveriesListResp = getOrders(); Processing... foreach (...) { if ((bool)DBresponse["status"]) {

DataGridView comboboxcolumn dynamic binding

徘徊边缘 提交于 2019-12-25 08:27:13
问题 I'm building a pretty basic table editor for an SQL Server DB in C#; basically a bit like the old forms that used to come with MS Access for editing tables. So far I have a combobox on the form where you select the table you want to edit, and then a datagridview that shows the table that has been selected in the combobox. I want to add comboboxcolumns at runtime according to whether the column has a relationship or not , so the user can see the value they're picking, not just the ID. So

Set DataGridView.DataSource async

寵の児 提交于 2019-12-25 08:23:47
问题 I must say I've been reading this site for a long time and always found what I was looking for. Sadly, today is not the case. I have a .NET C# Winforms Application that uses MySQL .NET Connector to query a database and fill a DataGridView with the results. Here is my code: using (var SqlConn = new MySqlConnection(MyConnectionString) { using (var SqlComm = new MySqlCommand("SELECT * FROM my_database.city", SqlConn) { using (var SqlAdapter = new MySqlDataAdapter(SqlComm) { DataTable SqlOutput =

Perform an event on selecting a prticular row in dojox.grid.DataGrid

走远了吗. 提交于 2019-12-25 08:20:41
问题 I have a code which is working fine and displaying some set of values to me in a grid which is dojox.grid.DataGrid. Now i want to perform some event like when i click on a particular row it will redirect me to a new JSP page. Or will open a window where i can do something. How to do that ? Please help me out. thanks. The code is :: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="MyPackage.PopulateTextbox" %> <%@ page import=