Apr 04, 2014, 8:09 AM
[CLOSED] Grid's DateColumn Format not working in IE8
Hi Ext Team,
Below is my test Code:
//Model
But when i exclude the column from the grid, i can see the rest of the columns.Please refer below screen shot:
This is for Browser IE 8.
Can u pls let me know what am i missing / wrong
Thanks
Below is my test Code:
//Model
public class GridClass
{
public DateTime Month { get; set; }
public double Price { get; set; }
public string CountryName { get; set; }
public string Currency { get; set; }
public static List<GridClass> GetRecords()
{
List<GridClass> list = new List<GridClass>();
list.Add(new GridClass() { CountryName = "Albania" , Currency="EUR" , Month = Convert.ToDateTime("3/2014") , Price =1.1});
list.Add(new GridClass() { CountryName = "Albania", Currency = "EUR", Month = Convert.ToDateTime("4/2014"), Price = 1.1 });
list.Add(new GridClass() { CountryName = "Albania", Currency = "EUR", Month = Convert.ToDateTime("5/2014"), Price = 1.1 });
list.Add(new GridClass() { CountryName = "Albania", Currency = "EUR", Month = Convert.ToDateTime("6/2014"), Price = 1.1 });
list.Add(new GridClass() { CountryName = "Albania", Currency = "EUR", Month = Convert.ToDateTime("6/2014"), Price = 1.1 });
list.Add(new GridClass() { CountryName = "Lativia", Currency = "EUR", Month = Convert.ToDateTime("3/2014"), Price = 1.1 });
list.Add(new GridClass() { CountryName = "France", Currency = "EUR", Month = Convert.ToDateTime("3/2014"), Price = 1.1 });
list.Add(new GridClass() { CountryName = "Belgium", Currency = "EUR", Month = Convert.ToDateTime("3/2014"),Price =1.1 });
return list;
}
}
//View@functions
{
private Store CreateStore(List<GridClass> list)
{
Store store = new Store();
store.ID = "PriceTrendStoreTabView";
var model = new Model();
model.Fields.Add(new ModelField("Month"));
model.Fields.Add(new ModelField("Price"));
model.Fields.Add(new ModelField("CountryName"));
model.Fields.Add(new ModelField("Currency"));
store.Model.Add(model);
store.DataSource = list;
return store;
}
private void Initchart(Container pnlGrafico)
{
Ext.Net.GridPanel grid = new GridPanel()
{
ID = "gridPriceTrendTab",
ForceFit = false,
ColumnLines = true,
EmptyText = "No data found",
};
var result = GridClass.GetRecords();
var store = CreateStore(result);
grid.Store.Add(store);
grid.ColumnModel.Add(new DateColumn()
{
Text = "Month",
DataIndex = "Month",
ID = "colMonth",
Format = "MMM-yy",
StyleSpec = "font-weight:bold",
});
grid.ColumnModel.Add(new Column()
{
Text = "Country",
DataIndex = "CountryName",
ID = "colCountryName",
StyleSpec = "font-weight:bold",
});
grid.ColumnModel.Add(new Column()
{
Text = "Price Value",
DataIndex = "Price",
ID = "colPrice",
StyleSpec = "font-weight:bold",
});
grid.ColumnModel.Add(new Column()
{
Text = "Currency",
DataIndex = "Currency",
ID = "colCurrency",
StyleSpec = "font-weight:bold",
});
pnlGrafico.Items.Add(grid);
}
}
@( Html.X().Container().ID("pnlPriceTrendTabular")
//.ID("container_Trend")
.Height(400)
.DefaultAnchor("100%")
.Layout(LayoutType.Fit)
.AutoScroll(true)
.Control(item => this.Initchart(item))
)
//Controller public ActionResult Grid()
{
return View();
}
when i run this code i get empty grid as shown below:But when i exclude the column from the grid, i can see the rest of the columns.Please refer below screen shot:
This is for Browser IE 8.
Can u pls let me know what am i missing / wrong
Thanks
Last edited by Daniil; Apr 07, 2014 at 5:41 PM.
Reason: [CLOSED]