Welcome Guest Search | Active Topics | Sign In | Register

Grid with datatable as a datasource Options
KA
Posted: Sunday, February 13, 2011 10:12:50 AM
Rank: Newbie
Groups: Member

Joined: 2/13/2011
Posts: 4
I am not seeing any data, can someone please help me...
here is a code sample i wrote: (I am using a demo version)

//HTML


<eo:Grid ID="Grid1" runat="server" Visible="true">
<Columns>
<eo:RowNumberColumn Width="140"></eo:RowNumberColumn>
<eo:StaticColumn Width="140" DataField="NAME" HeaderText="NAME"></eo:StaticColumn>
</Columns>
</eo:Grid>


c#


DataTable dtUser;

//*************************************
//Load the datatable with 10 rows....
//*************************************

if (dtUser.Rows.Count > 0)
{
Grid1.DataSource = dtUser;
Grid1.DataBind();
}
eo_support
Posted: Sunday, February 13, 2011 12:17:51 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Your code is correct. First check whether you get row numbers. If you do not get row numbers at all, then your data source is empty. If you do see row numbers, then your DataField is not set correctly.

Thanks!
KA
Posted: Monday, February 14, 2011 3:48:42 AM
Rank: Newbie
Groups: Member

Joined: 2/13/2011
Posts: 4
1. I am using the demo kit.
2. Framework 4.0
3. Grid1.RecordCount = 10 (the grid is loaded with 10 rows!)

still, i get an empty web form.

any idea?

thanks.
KA
Posted: Monday, February 14, 2011 4:06:05 AM
Rank: Newbie
Groups: Member

Joined: 2/13/2011
Posts: 4
Everything is OK !!!!

The problem was i didn't update the grid width and height (Width="450px" Height="200px")

thanks for all the help
eo_support
Posted: Monday, February 14, 2011 8:12:34 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Cool. Glad that it works for you!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.