columnwidth

Discussion in 'ASP .Net Datagrid Control' started by dirk van waes, Feb 19, 2006.

  1. 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()
     
    dirk van waes, Feb 19, 2006
    #1
    1. Advertising

  2. It's ok, I found the answers. Thxs anyway!
    "dirk van waes" <> schreef in bericht news:XsZJf.266678$-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()
     
    dirk van waes, Feb 20, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?V2lsbGVt?=

    Columnwidth datagrid webform

    =?Utf-8?B?V2lsbGVt?=, Feb 19, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    437
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Feb 20, 2005
Loading...

Share This Page