Should I put in a project with VS2010 and DevExpress in C # interface that covers a UserControl, which has a GridControl and its objective is to fill the grid of all the operations performed by the user log.
I made a list
ObservableCollection <LogStruct> loglist <LogStruct> = new ObservableCollection ();
public ObservableCollection <LogStruct> loglist
{
get {return loglist; }
}
and a data structure
public class LogStruct
{
public string Message {get; the set; }
public DateTime Date {get; the set; }
public LogStruct (string mess, DateTime date)
{
Message = mess;
Date = date;
}
I also wrote the property in xaml
<dxg:GridControl Name="grid_logoperations" AutoGenerateColumns="None" ItemsSource="{Binding Path=DataLog}">
<dxg:GridControl.View>
<dxg:TableView x:Name="tableview" AutoWidth="True" NewItemRowPosition="Bottom"/>
</ Dxg: GridControl.View>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="LogMessage" x:Name="columnmess" ReadOnly="True" Width="Auto" HorizontalHeaderContentAlignment="Center" UnboundType="String"/>
<dxg:GridColumn FieldName="LogDate" x:Name="columndata" ReadOnly="True" Width="Auto" HorizontalHeaderContentAlignment="Center" UnboundType="DateTime"/>
</ Dxg: GridControl.Columns>
</ Dxg: GridControl>
My question is: how do I write on the GridControl and to appear in video messages Log? Thanks to those who help me :)
You should specify names of the corresponding properties as the GridColumn.FieldName property value (in your case "Message" and "Date", not "LogMessage" and "LogDate"). You should not also assign the UnboundType property when columns are bounded to the real data source.