Questions tagged [autogeneratecolumn]

AutoGenerateColumns is a GridView/DataGrid property that helps create columns automatically.

AutoGenerateColumns is a GridView/DataGrid property that helps create columns automatically. When the AutoGenerateColumns property is set to true, an AutoGeneratedField object is automatically created for each field in the data source. Each field is then displayed as a column in the GridView control in the order that the fields appear in the data source. This option provides a convenient way to display every field in the data source; however, you have limited control of how an automatically generated column field is displayed or behaves.

65 questions
0
votes
0 answers

Update autogenerated datagrid combobox cell selected item at window's opening

I have a datagrid binded to an object collection. one of my object property is used as an index in a collection. The autogenerated combobox column "Type" displays the "label" associated to this index. This combobox update another property which is…
Alexus
  • 276
  • 1
  • 5
  • 22
0
votes
1 answer

How to update programmatically the items source in an autogenerated datagrid combobox cell

I can't find a working solution to my issue I have a datagrid binded to an object collection. one of my object property is used as an index in a collection. The autogenerated combobox column "Type" displays the "label" associated to this index. I…
Alexus
  • 276
  • 1
  • 5
  • 22
0
votes
1 answer

DB2: How to get generated always as statement to work with session user

I need to get a userstamp into a table and have not managed to figure out how the GENERATED FOR EACH ROW ON UPDATE AS statement works with the SESSION_USER variable in DB2 10.5 (LUW). Managed to get an implementation working using a function which…
JMX
  • 21
  • 1
  • 6
0
votes
1 answer

set max display width for a column in WPF datagrid

I have a datagrid in WPF that generate the columns automatically. some columns have a width more than whole screen, I want to check the width and if it is more than 500 then set it to 500 but if it is less than 500 keep the current width. …
user3951476
  • 223
  • 4
  • 7
0
votes
1 answer

How to hide autogenarated Delete and Edit button In asp.net gridview for user?

I want to hide delete edit buttons from the customer role, but admin can see them. My Gridview has set autogenarated column = true. Here is what I did:
Akash
  • 125
  • 1
  • 3
  • 14
0
votes
2 answers

EF6: How to generate a unique number automatically based on entity Id

Consider an entity like this: public class Document { public int Id { get; set; } public long code { get; set; } // Rest of Props } What I need is to generate a unique long code, and I prefer to generate it based on Id. One…
0
votes
2 answers

Auto generate varchar Ticket number via DB

I'm looking for suggestion on how to get the DB to auto generate Ticket numbers (preferably via the SQL DB) for a varchar column. I have the following tables in the DB: Activities & Cases and would prefer the format to be "Act000001" or "Cse000001".…
Rusty
  • 1
  • 1
0
votes
2 answers

ng-grid how to remove auto generated aggregate/grouping columns

Does anyone know how can I remove the auto-generated columns that are added whenever a grouping is added to the ng-grid? The columns are blank and appear at the left hand side and are around 30px wide. There are one of these columns per grouping (so…
Paul Witherspoon
  • 211
  • 3
  • 13
0
votes
0 answers

DataPropertyName used on another column

I'm tired of searching and I can't figure out. Probably this isn't possible. string query = "SELECT cust.id, cust.name, cust.photo, country.description FROM customers AS cust INNER JOIN countries AS country ON…
Linesofcode
  • 5,327
  • 13
  • 62
  • 116
0
votes
1 answer

Making dynamically created linkbutton to fire an event on click

I'm using a gridview and it is bound to a datatable so I've autogeneratecolumns set to true. Next I added a linkbutton dynamically to the last cell of the row and i see the linkbutton appearing on the gridview. Now I'm not able to associate any…
0
votes
2 answers

My autogenerated columns do not show in Datagrid

Most posts regarding DataGrid AutoGenerateColumns seem to deal with how to circumvent default behavior. Unfortunately the default is what I am struggling with. I have several database tables created with Entity Framework 6.0, and would like to…
0
votes
3 answers

Using image in bool-type column when using AutoGenerateColumn (WPF)

I have if (e.PropertyType == typeof(bool)) { e.Column.Header = "Status"; DataGridTemplateColumn templateColumn = new DataGridTemplateColumn(); templateColumn.Header = "Status"; …
VisualBean
  • 4,908
  • 2
  • 28
  • 57
0
votes
2 answers

Procedure or function expects parameter which was not supplied, when parameter is auto-generated

I'm trying to insert data in my db. this is the code im using SqlCommand cmd = new SqlCommand("dbo.UsersInsert", cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@UserID",…
user983983
  • 158
  • 1
  • 2
  • 11
0
votes
3 answers

Setting ToolTip for DataGridView automatically created columns

I would like to programatically set tooltips to automatically generated columns in a DataGridView. I was trying to use AutoGeneratingColumn event (http://msdn.microsoft.com/en-us/library/cc903950%28VS.95%29.aspx), but that in fact can only access…
Adam Szabo
  • 11,302
  • 18
  • 64
  • 100
0
votes
1 answer

Autogenerate Serial Number for DataBound DataGridView gives StackOverflowException

I am generating serial number for a column in Datagridview using the following code it gives me error..., private void dgvQttnfrm_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) { try { if…
Anjali
  • 1,680
  • 4
  • 26
  • 48