[Solved] How to show date in diffrent way in GridView?

It is easier for me to answer my question than isolated working code in my complex program. So this is my hack that works inside my program: private void GridView_CustomDrawEvent(object sender, RowCellCustomDrawEventArgs e) { if(e.Column.FieldName == “CreationDate”) { string date = ((DateTime) view.GetRowCellValue(e.RowHandle, “CreationDate”)); string displayDate = date.ToShortDateString() + ” ” time.ToLongTimeString(); e.DisplayText = displayDate; … Read more

[Solved] Value’s Not Appearing In Datagrid? [closed]

Ahhh, At last I found solution to it. instead of declaring properties private they should be public:- private string ProductName { get; set; } private string ProductPrice { get; set; } private string ProductUnit { get; set; } private string ProductStock { get; set; } Correction:- public string ProductName { get; set; } public string … Read more

[Solved] Adding an item to a List which is DataBinded to a DataGrid

Are you adding items to the data bound List<CustomClass> on a background thread? Then you could use the dispatcher to marshall the Add call to back the UI thread: Application.Current.Dispatcher.BeginInvoke(new Action(()=> { yourCollection.Add(yourItem); }))); Do this for all Add and Remove operations that modify the source collection. You should also replace the List<CustomClass> with an … Read more

[Solved] Set datagrid row background color WPF – Loop [closed]

I resolved this problem. So the problem is because I fill DataGrid again with Data. Instead that I don’t fill it I only get ID where I stopped from last time in that Table with some ID. Code for Button Continue: int postID; string fbGroupID; int listID = int.Parse(cmbSelectList.SelectedValue.ToString()); using (OleDbConnection connection = new OleDbConnection(conn)) … Read more