update 20241211
This commit is contained in:
@@ -34,24 +34,31 @@ namespace OnDoc.Helper
|
||||
}
|
||||
}
|
||||
|
||||
public static void FormatTable(ref DataTable tbl, string tablename, ref SfDataGrid grid)
|
||||
public static void FormatTable(ref DataTable tbl, string tablename, ref SfDataGrid grid, bool use_sort = true)
|
||||
{
|
||||
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Get_Tabledata("Select * from spalten where aktiv=1 and tabelle='" + tablename + "'", false, true);
|
||||
foreach (System.Data.DataRow dr in db.dsdaten.Tables[0].Rows)
|
||||
{
|
||||
foreach (DataColumn dc in tbl.Columns)
|
||||
{
|
||||
if (dr["tabellenspalte"].ToString() == dc.ColumnName)
|
||||
{
|
||||
dc.SetOrdinal(Convert.ToInt32(dr["reihenfolge"].ToString()));
|
||||
|
||||
break;
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Get_Tabledata("Select * from spalten where aktiv=1 and tabelle='" + tablename + "'", false, true);
|
||||
if (use_sort)
|
||||
{
|
||||
|
||||
foreach (System.Data.DataRow dr in db.dsdaten.Tables[0].Rows)
|
||||
{
|
||||
foreach (DataColumn dc in tbl.Columns)
|
||||
{
|
||||
if (dr["tabellenspalte"].ToString() == dc.ColumnName)
|
||||
{
|
||||
if (tablename != "Partner")
|
||||
dc.SetOrdinal(Convert.ToInt32(dr["reihenfolge"].ToString()));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
tbl.AcceptChanges();
|
||||
}
|
||||
tbl.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
grid.DataSource = tbl;
|
||||
foreach (System.Data.DataRow dr in db.dsdaten.Tables[0].Rows)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user