PDA

View Full Version : [CLOSED] [#1367] [4.1.0] Data is not showing in Grid.



sveins12
Aug 05, 2016, 1:54 PM
The data is not showing up in the Grid. Could I be missing something:



@{
var x = Html.X();
var data = new List<object>{
new
{
Name = "Lisa"
},

new
{
Name = "Bart"
},

new
{
Name = "Homer"
},

new
{
Name = "Marge"
}
};
}

@(
x.Grid()
.Plugins(x.EditableGrid())
.Columns(
x.Column()
.DataIndex("Name")
.Text("Name")
)
.Store(x.Store()
.AutoDataBind(true)
.Fields(
x.ModelField().Name("Name")
)
.Data( data )
)
)

fabricio.murta
Aug 07, 2016, 4:04 AM
Hello @sveins12!

Interesting how this works from user control but not if coded directly on the main view! Thanks for the report, they're simple but awesome!

We've created an issue to track this under #1367 (https://github.com/extnet/Ext.NET/issues/1367). Please sit tight while we fix the bug and get back to you!

Daniil
Aug 07, 2016, 9:05 AM
Hello,

In Ext.NET Mobile a Grid's Column requires an explicit Width setting. If you add Width, all is good.

<ext:Column runat="server" Text="Name" DataIndex="name" Width="100" />
<ext:Column runat="server" Text="More" DataIndex="more" Width="100" />

sveins12
Aug 08, 2016, 12:19 AM
Thanks. Yes the data is showing up when setting the width property of the column. A little bit strange though since the column-header already was showing using a default width.

Now, I added .Editor(x.TextField()) to the column. When double-tapping on a row, a row-editor show up. But there are no column editors showing, so it is impossible to edit the row.

Daniil
Aug 08, 2016, 9:40 AM
Agree, it is confusing. We've decided to set up the default Width for Grid's Columns. Now it is 100 by default if not explicitly set up.

As for editing, please start a new forum thread.