private void GetDropStatus() { try { STATUSTLMKProvider STATUSTLMKP = new STATUSTLMKProvider(); STATUSTLMKCollection STATUSTLMKColl = new STATUSTLMKCollection(); STATUSTLMKColl = STATUSTLMKP.ReadCollectionByParameter(null, "NOME"); cbStatus.DisplayMember = "NOME"; cbStatus.ValueMember = "IDSTATUSTLMK"; STATUSTLMKEntity STATUSTLMKTy = new STATUSTLMKEntity(); STATUSTLMKTy.NOME = ConfigMessage.Default.MsgDrop; STATUSTLMKTy.IDSTATUSTLMK = -1; STATUSTLMKColl.Add(STATUSTLMKTy); Phydeaux.Utilities.DynamicComparer <STATUSTLMKEntity> comparer = new Phydeaux.Utilities.DynamicComparer <STATUSTLMKEntity>(cbStatus.DisplayMember); STATUSTLMKColl.Sort(comparer.Comparer); cbStatus.DataSource = STATUSTLMKColl; } catch (Exception ex) { MessageBox.Show("Erro técnico: " + ex.Message); } }
private void DataGriewDados_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (STATUSTLMKColl.Count > 0) { string orderBy = DataGriewDados.Columns[e.ColumnIndex].DataPropertyName; if (orderBy.Trim() != string.Empty) { Phydeaux.Utilities.DynamicComparer <STATUSTLMKEntity> comparer = new Phydeaux.Utilities.DynamicComparer <STATUSTLMKEntity>(orderBy); STATUSTLMKColl.Sort(comparer.Comparer); DataGriewDados.DataSource = null; DataGriewDados.DataSource = STATUSTLMKColl; } } }