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()
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()