Home » FAQ » ASP.NET » DataGrid » How to get the DataField name of a BoundColumn from code-behind
Try [VB.NET]
Dim bc As BoundColumn = CType(Me.DataGrid1.Columns(1), BoundColumn) Response.Write(bc.DataField)
[C#]
BoundColumn bc = (BoundColumn)this.DataGrid1.Columns[1]; Response.Write(bc.DataField);
Platform BlazorASP.NETWinFormsWPF.NET MAUI
Question *
Answer (Optional)
Email (Optional)
Email address is only for further clarification on your FAQ request. It will not be used for any other purpose.
Please leave this field empty.
Share with