webcontrols.datagrid problem...

  • Thread starter Thread starter EMW
  • Start date Start date
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
 
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"]?
 
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"]?
 
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"]?
 
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>
 
Back
Top