webcontrols.datagrid problem...

E

EMW

On my ASPX page I have datagrid control with 6 columns.
4 of them are bound columns, two are link columns.

In the properties I defined the columns with their widths and names.
In designtime I see the column names appear in the datagrid.

Above the datagrid is linkbutton and when the user clicks on it, the
datagrid is supposed to be filled with info.
In the click-event of this linkbutton, first a function is called to fill a
dataset with that info.

then the following is called:

Dim dv As New DataView(ds.Tables("pdalijst"))
Me.dgLijst.DataSource = dv
Me.dgLijst.DataBind()

But the problem is, nothing appears in the datagrid.

If I use the automatic column property, I get to see the info from the
dataset, but the widths of each column is then automaticly set and that is
not what I want.

What am I doing wrong?

rg,
Eric
 
M

Matt Berther

Hello EMW,
On my ASPX page I have datagrid control with 6 columns. 4 of them are
bound columns, two are link columns.

In the properties I defined the columns with their widths and names.
In designtime I see the column names appear in the datagrid.

Have you also set the DataField property to correspond to the fields in ds.Tables["pdalijst"]?
 
E

EMW

nope, that must be the problem...

thanks!


Matt Berther said:
Hello EMW,
On my ASPX page I have datagrid control with 6 columns. 4 of them are
bound columns, two are link columns.

In the properties I defined the columns with their widths and names.
In designtime I see the column names appear in the datagrid.

Have you also set the DataField property to correspond to the fields in ds.Tables["pdalijst"]?
 
E

EMW

Could you give me an example, because I cannot find one in msdn.
I think you meant DataKeyField?

rg.
Eric


Matt Berther said:
Hello EMW,
On my ASPX page I have datagrid control with 6 columns. 4 of them are
bound columns, two are link columns.

In the properties I defined the columns with their widths and names.
In designtime I see the column names appear in the datagrid.

Have you also set the DataField property to correspond to the fields in ds.Tables["pdalijst"]?
 
M

Matt Berther

Hello EMW,
Could you give me an example, because I cannot find one in msdn. I
think you meant DataKeyField?

<asp:BoundColumn DataField="MyField" HeaderText="MyFieldHeader"></asp:BoundColumn>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top