Public Class ClassDataGridRefresh {public classdataGridrefresh () {}
#Region DataGrid Refresh
///
///
String [] columnWidths = m_strwidth.split (';'); string [] strhiddens = m_strhidden.split (';'); Numcols = DV.TABLE.COLUMNS.COUNT;
if (m_blnIsReDraw == true) {foreach (string strHiddenTemp in strHiddens) {if (strHiddenTemp.Length> 0) {DV.Table.Columns [strHiddenTemp] .ColumnMapping = System.Data.MappingType.Hidden;}}
Dg.font = new system.drawing.font ("Song", 10, System.drawing.FontStyle.regular;
DG.DataSource = DV;
IF (m_blnisredraw == true) {ts.mappingname = DV.TABLE.TABLENAME;
For (i = 0; i IF (ColumnWidths.Length> i) {acolumnBoolColumn.width = (int) (ColumnWidths [i]) * 50);} Ts.GridColumnStyles.Add (acolumnBoolColumn); // Add a custom Column style Break; default: // Default (Text) Column aColumnTextColumn = new System.Windows.Forms.DataGridTextBoxColumn (); // To change the column header name, change the value of the sentence HeaderText aColumnTextColumn.HeaderText = DV.Table.Columns [i]. ColumnName; acolumntextColumn.mappingname = DV.TABLE.COLUMNS [i] .columnname; IF (ColumnWidths.Length> i) {acolumnTextColumn.width = (int) (columnwidths [i]) * 50);} Ts.GridColumnStyles.add (acolumntextColumn); // Add a custom Column style break;}} DG.TABLESTYLES.CLEAR (); DG.TABLESTYLES.ADD (TS);}} catch (exception ex) {system. Windows.Forms.MessageBox.show (ex.Message.toString (), "DataGrid Refresh Error");}} #ENDREGION }