columnwidth

D

dirk van waes

Hi,
I'm pretty new in asp.net, so my questions may be too simple for this newsgroup, but I don't find answers!
I use asp.net 1.1
I created programmatically a datagrid with 4 column (3 boundcolumns and 1 EditCommandColumn)
No problems so far! But...
Now I want the colums to have a fixed width. How do I do that?

I created a routine


Sub dgleerlingen_edit(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

dgleerlingen.EditItemIndex = e.Item.ItemIndex

End Sub



but I still can't enter a new value in the grid. Why is that?

TIA

Dirk

PS my code:

................

dgleerlingen.GridLines = GridLines.Both

dgleerlingen.BorderColor = Color.Blue

dgleerlingen.ShowHeader = True

dgleerlingen.AutoGenerateColumns = False

dgleerlingen.SelectedItemStyle.BackColor = Color.Yellow

'add bound columns to the datagrid

Dim datagridcol As New BoundColumn

datagridcol.HeaderText = "Naam"

datagridcol.DataField = "naamvoornaam"

dgleerlingen.Columns.Add(datagridcol)

datagridcol = New BoundColumn

datagridcol.HeaderText = "Ptn"

datagridcol.DataField = CType(Session("periode2"), String)

dgleerlingen.Columns.Add(datagridcol)

datagridcol = New BoundColumn

datagridcol.HeaderText = "Opmerkingen"

datagridcol.DataField = CType(Session("periode2"), String) & "opmerking"

dgleerlingen.Columns.Add(datagridcol)

dgleerlingen.DataSource = dasleerlingen

Dim editkolon As New EditCommandColumn

editkolon.HeaderText = "Ptn invullen"

dgleerlingen.Columns.AddAt(0, editkolon)

editkolon.ButtonType = ButtonColumnType.PushButton

editkolon.EditText = "ingeven"

dgleerlingen.DataBind()
 
D

dirk van waes

It's ok, I found the answers. Thxs anyway!
"dirk van waes" <[email protected]> schreef in bericht Hi,
I'm pretty new in asp.net, so my questions may be too simple for this newsgroup, but I don't find answers!
I use asp.net 1.1
I created programmatically a datagrid with 4 column (3 boundcolumns and 1 EditCommandColumn)
No problems so far! But...
Now I want the colums to have a fixed width. How do I do that?

I created a routine


Sub dgleerlingen_edit(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

dgleerlingen.EditItemIndex = e.Item.ItemIndex

End Sub



but I still can't enter a new value in the grid. Why is that?

TIA

Dirk

PS my code:

...............

dgleerlingen.GridLines = GridLines.Both

dgleerlingen.BorderColor = Color.Blue

dgleerlingen.ShowHeader = True

dgleerlingen.AutoGenerateColumns = False

dgleerlingen.SelectedItemStyle.BackColor = Color.Yellow

'add bound columns to the datagrid

Dim datagridcol As New BoundColumn

datagridcol.HeaderText = "Naam"

datagridcol.DataField = "naamvoornaam"

dgleerlingen.Columns.Add(datagridcol)

datagridcol = New BoundColumn

datagridcol.HeaderText = "Ptn"

datagridcol.DataField = CType(Session("periode2"), String)

dgleerlingen.Columns.Add(datagridcol)

datagridcol = New BoundColumn

datagridcol.HeaderText = "Opmerkingen"

datagridcol.DataField = CType(Session("periode2"), String) & "opmerking"

dgleerlingen.Columns.Add(datagridcol)

dgleerlingen.DataSource = dasleerlingen

Dim editkolon As New EditCommandColumn

editkolon.HeaderText = "Ptn invullen"

dgleerlingen.Columns.AddAt(0, editkolon)

editkolon.ButtonType = ButtonColumnType.PushButton

editkolon.EditText = "ingeven"

dgleerlingen.DataBind()
 

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,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top