datagridviewcolumn

DatagridViewButtonColumn with different Text and different Functionality for different Rows

我只是一个虾纸丫 提交于 2019-12-13 02:22:51
问题 I need to create a datagidview in winforms. It has a Datagridviewbuttoncolumn and few other columns. The Datagridviewbuttoncolumn must intially display text "Upload" and clicking on it should open a location to store files. After file is uploaded the Datagridviewbuttoncolumn text should become "View File" and clicking on it should open the file. A brief idea how it could be done will be helpful. 回答1: Different Text for Buttons Handle CellFormatting event and set e.Value based on value of

C# WinForms: Cannot access a dispose object

旧街凉风 提交于 2019-12-12 14:27:43
问题 I have a datagridview. This datagridview has customs datagridviewcolumns among other like datagridviewtextboxcolumns. Third-party control is hosted in each cell. So as datagridview is designed, on custom cells, content cannot be shown unless you are in cell's edit mode. So to achieve cells content to be shown I have overrided paint method in order to paint the cells when they are not in edit mode. The image to be painted in the cell is obtained in paint method and I use block like: using

Setting DataGridViewComboBoxColumn.Valuemember to a list<string>

吃可爱长大的小学妹 提交于 2019-12-12 10:22:05
问题 I needed to know if one can set the ValueMember property of a DataGridViewComboBoxColumn directly from a list of strings. e.g. List<string> productNames = new List<string>(); List<Products.Product> t = new List<Products.Product>(); foreach (var p in products) { var x = p.Product; itemListing = x; foreach (var pn in x) { productNames.Add(pn.name); } } ............. // set values to combobox column cells in datagridview GridSellProducts.Rows.Add(); DataGridViewComboBoxColumn cmbItems =

How to get dragged column in datagridview when AllowUserToOrderColumns = true

时光毁灭记忆、已成空白 提交于 2019-12-12 04:52:09
问题 I have a windows form application in which i have a datagridview with AllowUserToOrderColumns = true, then user change column order via drag and drop. How can i know which column is dragged ? 回答1: When you set AllowUserToOrderColumns = true then you will know the column name in ColumnDisplayIndexChanged Private Sub Datagridview1_ColumnDisplayIndexChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewColumnEventArgs) Handles dgvGuru.ColumnDisplayIndexChanged MsgBox(e

Uncaught Error: jqxGrid: Missing references to the following module(s): jqxgrid.edit.js

感情迁移 提交于 2019-12-12 01:55:53
问题 i am trying to make editable columns in jqxgrid. But i am having the error Uncaught Error: jqxGrid: Missing references to the following module(s): jqxgrid.edit.js but as you can see from below i have used the reference jqxgrid.edit.js , i also have similar problem with columnresize=true propery. Any idea where i messed up? thanks <!DOCTYPE html> <html lang=”en”> <head> <title id=”description”>Edit Item</title> <link rel=”stylesheet” href=”/Content/jqx.base.css” type=”text/css” /> <script type

how can we loop the column and row in the datagridview?

為{幸葍}努か 提交于 2019-12-12 01:06:20
问题 Let me tell you what we wanted to do, the user has to click every check box because it represents the number of the students attendance and once the user click the button 1 it will show the total number of days present and the button 2 is for the total absent of each students. but when we run our program it only count the number per column. so please help us . . thank you! Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If

Change the text value of a button in DataGridViewButtonColumn

倖福魔咒の 提交于 2019-12-11 14:04:52
问题 I'm trying to change the text of a button in a DataGridViewButtonColumn every time the button is clicked. I define the column like so: DataGridViewButtonColumn sitemapButtonColumn = new DataGridViewButtonColumn { Name = "Process", Text = "Start", UseColumnTextForButtonValue = true, DataPropertyName = "Process", FillWeight = 7, Width = 75 }; dg_list.CellContentClick += dg_list_StartStopProcessClick; Now the function which controls the event once a cell clicked is: private void dg_list

C# adding collection of custom properties from the property grid at design time

♀尐吖头ヾ 提交于 2019-12-11 07:39:58
问题 I have an issue of not being able to add created columns to the collection of that type. I have the following property: public ObservableCollection<BrowseLayoutColumns> _BrowseLayoutColumns = new ObservableCollection<BrowseLayoutColumns>(); [Category("Design")] public ObservableCollection<BrowseLayoutColumns> BrowseLayoutColumns { get { return _BrowseLayoutColumns; } set { _BrowseLayoutColumns = value; } } BrowseLayoutColumns [TypeConverter(typeof(BrowseLayoutColumns))] public class

Datagridview column sorting when clicking on the column header

我们两清 提交于 2019-12-11 07:03:30
问题 I have a datagridview with two columns name and price . If I click on the column header, the corresponding column will be sorted in alphabetical order. Do I need to add any event handler for sorting the datagrid view column? Or is there any property to set for sorting datagrid view column? I am working on a Windows application using C#. Would anyone please help on this? 回答1: If you could use javascrip/jQuery I would suggest you to use the JQuery plugin Datatabe. With that you can get the

show/hide grid-view column by column name

你离开我真会死。 提交于 2019-12-11 05:48:22
问题 I'm creating a web project in Visual Studio 2012 using C# which fetch data from database and shows in a grid-view. There are many number of columns in the database, which shows on the grid-view as it is. I want to make an option for the user to eliminate unwanted columns using check-boxes and after checking, on a button click it must update. I found how to hide a column by its column name. I need to find out how can I display it with the column name. if (CheckBox3.Checked) { dt.Columns.Remove