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
19
votes
7 answers

How do you rename DataGrid columns when AutoGenerateColumns = True?

I have a simple data structure class: public class Client { public String name {set; get;} public String claim_number {set; get;} } Which I am feeding into a DataGrid: this.data_grid_clients.ItemSource = this.clients; I would like to…
jmulmer
  • 357
  • 1
  • 3
  • 7
11
votes
3 answers

How to set background of a datagrid cell during AutoGeneratingColumn event depending on its value?

I'm still fighting with manipulation of cell backgrounds so I'm asking a new question. A user "H.B." wrote that I can actually set the cell style during the AutoGeneratingColumn event - Change DataGrid cell colour based on values. The problem is…
Ms. Nobody
  • 1,219
  • 3
  • 14
  • 34
9
votes
3 answers

how do i escape a slash character in a WPF binding path, or how to work around?

I'm just learning WPF, and I gragged a table from a datasource onto a window which generated XAML for each column. Some of those columns had names that caused the following:
Aaron Anodide
  • 16,906
  • 15
  • 62
  • 121
6
votes
2 answers

.Net Core auto-generated string primary key

.Net Core 2.2 Identity framework has string primary key which is an auto-generated GUID. My question is how to have an auto-generated STRING primary key using Entity Framework 2.2?
5
votes
1 answer

Devexpress winform Autogenerate columns

Please help me on how to access AutoGenerateColumns property of GridControl in devexpress just like datagridview in normal control of winform.
Simon Huynh
  • 329
  • 1
  • 3
  • 12
4
votes
0 answers

MySQL bulk insertion: parent table autogenerated key into child table

We are doing migration from SQL Server 2012 to MySQL 5.6. One of the scenarios that came up is inserting bulk records in parent child table. An example: create table parent ( parent_id int primary key auto_increment, parent_name varchar(100)…
trace_70
  • 41
  • 2
3
votes
1 answer

Datagrid is not generating columns when itemssource is Queryable or Enumrable on some Computers

for this example , my computer generate automatic columns, but in others machines, columns are not generating if source is Queryable or Enumrable . what can be the different public MainWindow() { InitializeComponent(); …
mordechai
  • 829
  • 1
  • 7
  • 23
3
votes
2 answers

Generated value for nonPK field

I have the entity of some BusinessParticipant, it just simple flat entity. And these Participants may be organized in groups, by user's wish. The group has no data, just id. So creating entity and table seems overkill... I'll wish to have 2 db…
ellabi
  • 51
  • 2
  • 4
3
votes
2 answers

Accessing all of the columns of an AutoGenerated GridView - ASP.NET

I have a simple Gridview with AutoGenerate on. I need to know how to access these columns, because the column count is always zero, even though they show in the page. I found something about an "AutoGeneratingColumn" event, but that's for DataGrids…
WoF_Angel
  • 2,569
  • 9
  • 35
  • 54
3
votes
3 answers

How to create composite primary key with one auto generated value?

I am trying to map entity with my existing database table which is having two primary keys. Out of two keys, one primary key is auto generated. I am using `Spring Boot`, `JPA`, `Hibernate` and `MySQL`. I have used `@IdClass` to map with the…
3
votes
2 answers

GridView - set width of column in code behind (AutoGenerateColumns="true")

My GridView : In code behind : protected void GridView1_RowDataBound(object…
gadi
  • 481
  • 3
  • 14
  • 32
2
votes
3 answers

Get SQL Computed Column Inserted Value

My Table Structure as follow, CREATE TABLE tbl_Info ( [SSEID] BIGINT NOT NULL IDENTITY(1,1), [ShortenKey] AS ConvertToBase([SSEID]), [Title] VARCHAR(500) NULL, ) ConvertToBase Function as…
Sency
  • 2,818
  • 8
  • 42
  • 59
2
votes
2 answers

Creating a column which should be auto generated by concatenating values in other columns in a table

I got a table in a SQL database with four columns: ID, Comp_Id, Cont_Id and Comp_Cont_Id. The values into ID, Comp_Id, Cont_Id columns are entered manually and the value in the column Comp_Cont_Id is to be generated automatically by concatenating…
xyzwwq
  • 35
  • 1
  • 5
2
votes
2 answers

How can we use pandas to generate min, max, mean, median, ...as new columns for the dataframe?

I just pick up pandas. I have a dataframe as follow: DEST MONTH PRICE SOUR TYPE YEAR 0 DEST7 8 159 SOUR4 WEEKEND 2015 1 DEST2 9 391 SOUR1 WEEKEND 2010 2 DEST5 5 612 SOUR1 WEEKDAY 2013 3 DEST4 …
Haven Shi
  • 457
  • 5
  • 14
  • 19
2
votes
1 answer

Controlling DBML EntityRef creation in DBML with multiple foreign keys

Using Linq to SQL and the autogeneration capabilities of DBML, foreign key relationships create EntityRefs in the DBML designer file. For example : private int _USStateId; private EntityRef _USState; However, if I have the need for a…
Ash Machine
  • 9,601
  • 11
  • 45
  • 52
1
2 3 4 5