Time:05-16
CodePudding user response:
value is formatted, If accurate to multiple small digits, need to use the Format to Format,
DataGridViewColumn dc new DataGridViewColumn (); Dc. DataPropertyName=reader [r]. "the TableColumn" ToString (); Dc. Visible=true; Dc. Name="T" + reader [r]. "the TableColumn" ToString (); Dc. The HeaderText=reader [r]. "ColumnName" ToString (); Dc. Width=reader [r]. "ColumnSize GetHashCode (); DataGridViewCell dgvcell=new DataGridViewTextBoxCell (); If (reader) [r]. "ControlsType" ToString ()=="Numbers") {Dgvcell. Style. The Format="# # # # #"; } Dc. CellTemplate=dgvcell; Dv. Columns. The Add (dc);
Page link:https//www.codepudding.com/net/111271.html