Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > columnwidth

Reply
Thread Tools

columnwidth

 
 
dirk van waes
Guest
Posts: n/a
 
      02-19-2006
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()

 
Reply With Quote
 
 
 
 
dirk van waes
Guest
Posts: n/a
 
      02-20-2006
It's ok, I found the answers. Thxs anyway!
"dirk van waes" <(E-Mail Removed)> schreef in bericht news:XsZJf.266678$(E-Mail Removed)-ops.be...
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()

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Columnwidth datagrid webform =?Utf-8?B?V2lsbGVt?= ASP .Net 1 02-20-2005 04:19 AM



Advertisments