Format datagrid columns

Discussion in 'ASP .Net Web Controls' started by ton, Feb 18, 2004.

  1. ton

    ton Guest

    Hi,
    How can I format (width, wordwrap) of a during runtime added boundcontrol
    Ton
     
    ton, Feb 18, 2004
    #1
    1. Advertising

  2. are you adding a boundColumn at runtime ?
    What exactly is the control you are adding at runtime. If its a BoundColumn,
    it already exposes various header/item/footer style properties which you can
    use for formatting . .look in the BoundColumn Members section

    "ton" <> wrote in message
    news:c0vvff$4bk$1.nb.home.nl...
    > Hi,
    > How can I format (width, wordwrap) of a during runtime added boundcontrol
    > Ton
    >
    >
     
    Alessandro Zifiglio, Feb 19, 2004
    #2
    1. Advertising

  3. ton

    ton Guest

    I add a Buttoncolumn, allthough I rather add a button with a text on it.
    This column is bound to the dataset. And for the other columns I add
    Boundcolumns, but the do not look good.
    Text is wrapped up (several lines) and I cannot set the with of a column.

    Do you have any suggestions (and/or additional reading)

    Thanks
    "Alessandro Zifiglio" <> schreef in
    bericht news:NB2Zb.9070$...
    > are you adding a boundColumn at runtime ?
    > What exactly is the control you are adding at runtime. If its a

    BoundColumn,
    > it already exposes various header/item/footer style properties which you

    can
    > use for formatting . .look in the BoundColumn Members section
    >
    > "ton" <> wrote in message
    > news:c0vvff$4bk$1.nb.home.nl...
    > > Hi,
    > > How can I format (width, wordwrap) of a during runtime added

    boundcontrol
    > > Ton
    > >
    > >

    >
    >
     
    ton, Feb 19, 2004
    #3
  4. boundcolumn1.ItemStyle.Wrap = True
    sets wrapping for all item cells of the column

    "ton" <> wrote in message
    news:c12f6j$ubd$1.nb.home.nl...
    > I add a Buttoncolumn, allthough I rather add a button with a text on it.
    > This column is bound to the dataset. And for the other columns I add
    > Boundcolumns, but the do not look good.
    > Text is wrapped up (several lines) and I cannot set the with of a column.
    >
    > Do you have any suggestions (and/or additional reading)
    >
    > Thanks
    > "Alessandro Zifiglio" <> schreef in
    > bericht news:NB2Zb.9070$...
    > > are you adding a boundColumn at runtime ?
    > > What exactly is the control you are adding at runtime. If its a

    > BoundColumn,
    > > it already exposes various header/item/footer style properties which you

    > can
    > > use for formatting . .look in the BoundColumn Members section
    > >
    > > "ton" <> wrote in message
    > > news:c0vvff$4bk$1.nb.home.nl...
    > > > Hi,
    > > > How can I format (width, wordwrap) of a during runtime added

    > boundcontrol
    > > > Ton
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alessandro Zifiglio, Feb 19, 2004
    #4
  5. ton

    ton Guest

    Perfect !
    When the previous button works in the datagrid then this control would be
    very usefull.
    Next is still possible, but previous canbe pushed after 1 or more next (>),
    buto does not change the rows which are displayes and is then disabled
    (allthough I pushed several time on next)

    Ton



    "Alessandro Zifiglio" <> schreef in
    bericht news:Xw3Zb.9092$...
    > boundcolumn1.ItemStyle.Wrap = True
    > sets wrapping for all item cells of the column
    >
    > "ton" <> wrote in message
    > news:c12f6j$ubd$1.nb.home.nl...
    > > I add a Buttoncolumn, allthough I rather add a button with a text on it.
    > > This column is bound to the dataset. And for the other columns I add
    > > Boundcolumns, but the do not look good.
    > > Text is wrapped up (several lines) and I cannot set the with of a

    column.
    > >
    > > Do you have any suggestions (and/or additional reading)
    > >
    > > Thanks
    > > "Alessandro Zifiglio" <> schreef

    in
    > > bericht news:NB2Zb.9070$...
    > > > are you adding a boundColumn at runtime ?
    > > > What exactly is the control you are adding at runtime. If its a

    > > BoundColumn,
    > > > it already exposes various header/item/footer style properties which

    you
    > > can
    > > > use for formatting . .look in the BoundColumn Members section
    > > >
    > > > "ton" <> wrote in message
    > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > Hi,
    > > > > How can I format (width, wordwrap) of a during runtime added

    > > boundcontrol
    > > > > Ton
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    ton, Feb 19, 2004
    #5
  6. almost forgot, for the width do :
    boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    "Alessandro Zifiglio" <> wrote in
    message news:Xw3Zb.9092$...
    > boundcolumn1.ItemStyle.Wrap = True
    > sets wrapping for all item cells of the column
    >
    > "ton" <> wrote in message
    > news:c12f6j$ubd$1.nb.home.nl...
    > > I add a Buttoncolumn, allthough I rather add a button with a text on it.
    > > This column is bound to the dataset. And for the other columns I add
    > > Boundcolumns, but the do not look good.
    > > Text is wrapped up (several lines) and I cannot set the with of a

    column.
    > >
    > > Do you have any suggestions (and/or additional reading)
    > >
    > > Thanks
    > > "Alessandro Zifiglio" <> schreef

    in
    > > bericht news:NB2Zb.9070$...
    > > > are you adding a boundColumn at runtime ?
    > > > What exactly is the control you are adding at runtime. If its a

    > > BoundColumn,
    > > > it already exposes various header/item/footer style properties which

    you
    > > can
    > > > use for formatting . .look in the BoundColumn Members section
    > > >
    > > > "ton" <> wrote in message
    > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > Hi,
    > > > > How can I format (width, wordwrap) of a during runtime added

    > > boundcontrol
    > > > > Ton
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alessandro Zifiglio, Feb 19, 2004
    #6
  7. This last one is probably a bug in your application. I suggest you try and
    run in debug mode again and step through this line by line and see the
    execution of your code and what happens as you hit the next or previous
    buttons.

    The previous button should be able to go all the way to the first page and
    then stay disabled if its the first page, and the next button should be able
    to go to the last record and then disable on the last. Try and use numbered
    links and see if your getting the same behavior whereas to next-previous
    links. That is set pager mode to NumericPages whereas to NextPrev.

    From your previous posts i've noted that you are doing this correctly and
    are also using the OnPageIndexChanged method correctly, so surely you have a
    small bug in your code.

    "Alessandro Zifiglio" <> wrote in
    message news:XB3Zb.9094$...
    > almost forgot, for the width do :
    > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > "Alessandro Zifiglio" <> wrote in
    > message news:Xw3Zb.9092$...
    > > boundcolumn1.ItemStyle.Wrap = True
    > > sets wrapping for all item cells of the column
    > >
    > > "ton" <> wrote in message
    > > news:c12f6j$ubd$1.nb.home.nl...
    > > > I add a Buttoncolumn, allthough I rather add a button with a text on

    it.
    > > > This column is bound to the dataset. And for the other columns I add
    > > > Boundcolumns, but the do not look good.
    > > > Text is wrapped up (several lines) and I cannot set the with of a

    > column.
    > > >
    > > > Do you have any suggestions (and/or additional reading)
    > > >
    > > > Thanks
    > > > "Alessandro Zifiglio" <> schreef

    > in
    > > > bericht news:NB2Zb.9070$...
    > > > > are you adding a boundColumn at runtime ?
    > > > > What exactly is the control you are adding at runtime. If its a
    > > > BoundColumn,
    > > > > it already exposes various header/item/footer style properties which

    > you
    > > > can
    > > > > use for formatting . .look in the BoundColumn Members section
    > > > >
    > > > > "ton" <> wrote in message
    > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > Hi,
    > > > > > How can I format (width, wordwrap) of a during runtime added
    > > > boundcontrol
    > > > > > Ton
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alessandro Zifiglio, Feb 19, 2004
    #7
  8. ton

    ton Guest

    I will do what you suggest.

    In the mean time I'm trying to handle the event of the buttoncolumn. I
    receive the event, but I want to get the ID of the row:

    col = New ButtonColumn '' BoundColumn

    col.HeaderText = "ID"

    col.DataTextField = "ID"

    col.ButtonType = ButtonColumnType.PushButton

    col.HeaderStyle.Wrap = False

    col.CommandName = "Card"

    Datagrid.Columns.Add(col)

    AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard

    ----
    the datagridcard procedure
    Private Sub DataGridCard(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.DataGridCommandEventArgs)

    Dim datagrid As DataGrid, x As Label

    datagrid = CType(sender, DataGrid)

    x = FindControl("X")

    datagrid.EditItemIndex = e.Item.ItemIndex

    x.Text = "Xpage " + CStr(e.CommandName) + " " & e.Item.ItemIndex &
    e.CommandArgument ''DataItem

    datagrid.DataBind()

    End Sub

    Since the buttoncolumn displays the recordnumber I want to get that ID. With
    that ID i can call my dialog to edit the cardrecord.
    How do I get there. The datagrid.edititemindex only modifies the way the
    record is shown (an you may edit it), buto that's not what I want to do,
    Thanks

    Ton



    "Alessandro Zifiglio" <> schreef in
    bericht news:rK3Zb.9099$...
    > This last one is probably a bug in your application. I suggest you try and
    > run in debug mode again and step through this line by line and see the
    > execution of your code and what happens as you hit the next or previous
    > buttons.
    >
    > The previous button should be able to go all the way to the first page and
    > then stay disabled if its the first page, and the next button should be

    able
    > to go to the last record and then disable on the last. Try and use

    numbered
    > links and see if your getting the same behavior whereas to next-previous
    > links. That is set pager mode to NumericPages whereas to NextPrev.
    >
    > From your previous posts i've noted that you are doing this correctly and
    > are also using the OnPageIndexChanged method correctly, so surely you have

    a
    > small bug in your code.
    >
    > "Alessandro Zifiglio" <> wrote in
    > message news:XB3Zb.9094$...
    > > almost forgot, for the width do :
    > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > "Alessandro Zifiglio" <> wrote in
    > > message news:Xw3Zb.9092$...
    > > > boundcolumn1.ItemStyle.Wrap = True
    > > > sets wrapping for all item cells of the column
    > > >
    > > > "ton" <> wrote in message
    > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > I add a Buttoncolumn, allthough I rather add a button with a text on

    > it.
    > > > > This column is bound to the dataset. And for the other columns I add
    > > > > Boundcolumns, but the do not look good.
    > > > > Text is wrapped up (several lines) and I cannot set the with of a

    > > column.
    > > > >
    > > > > Do you have any suggestions (and/or additional reading)
    > > > >
    > > > > Thanks
    > > > > "Alessandro Zifiglio" <>

    schreef
    > > in
    > > > > bericht news:NB2Zb.9070$...
    > > > > > are you adding a boundColumn at runtime ?
    > > > > > What exactly is the control you are adding at runtime. If its a
    > > > > BoundColumn,
    > > > > > it already exposes various header/item/footer style properties

    which
    > > you
    > > > > can
    > > > > > use for formatting . .look in the BoundColumn Members section
    > > > > >
    > > > > > "ton" <> wrote in message
    > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > Hi,
    > > > > > > How can I format (width, wordwrap) of a during runtime added
    > > > > boundcontrol
    > > > > > > Ton
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    ton, Feb 19, 2004
    #8
  9. ton

    ton Guest

    allthough I have an event firing on:
    AddHandler Datagrid.PageIndexChanged, AddressOf Me.nextprev

    The debugmode only enters the next buton, when clicking previous, the
    NextPrev event is not called ?

    Private Sub nextprev(ByVal sender As Object, ByVal e As
    DataGridPageChangedEventArgs)

    Dim datagrid As DataGrid, x As Label

    datagrid = CType(sender, DataGrid)

    datagrid.CurrentPageIndex = e.NewPageIndex

    datagrid.DataBind()

    End Sub


    "Alessandro Zifiglio" <> schreef in
    bericht news:rK3Zb.9099$...
    > This last one is probably a bug in your application. I suggest you try and
    > run in debug mode again and step through this line by line and see the
    > execution of your code and what happens as you hit the next or previous
    > buttons.
    >
    > The previous button should be able to go all the way to the first page and
    > then stay disabled if its the first page, and the next button should be

    able
    > to go to the last record and then disable on the last. Try and use

    numbered
    > links and see if your getting the same behavior whereas to next-previous
    > links. That is set pager mode to NumericPages whereas to NextPrev.
    >
    > From your previous posts i've noted that you are doing this correctly and
    > are also using the OnPageIndexChanged method correctly, so surely you have

    a
    > small bug in your code.
    >
    > "Alessandro Zifiglio" <> wrote in
    > message news:XB3Zb.9094$...
    > > almost forgot, for the width do :
    > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > "Alessandro Zifiglio" <> wrote in
    > > message news:Xw3Zb.9092$...
    > > > boundcolumn1.ItemStyle.Wrap = True
    > > > sets wrapping for all item cells of the column
    > > >
    > > > "ton" <> wrote in message
    > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > I add a Buttoncolumn, allthough I rather add a button with a text on

    > it.
    > > > > This column is bound to the dataset. And for the other columns I add
    > > > > Boundcolumns, but the do not look good.
    > > > > Text is wrapped up (several lines) and I cannot set the with of a

    > > column.
    > > > >
    > > > > Do you have any suggestions (and/or additional reading)
    > > > >
    > > > > Thanks
    > > > > "Alessandro Zifiglio" <>

    schreef
    > > in
    > > > > bericht news:NB2Zb.9070$...
    > > > > > are you adding a boundColumn at runtime ?
    > > > > > What exactly is the control you are adding at runtime. If its a
    > > > > BoundColumn,
    > > > > > it already exposes various header/item/footer style properties

    which
    > > you
    > > > > can
    > > > > > use for formatting . .look in the BoundColumn Members section
    > > > > >
    > > > > > "ton" <> wrote in message
    > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > Hi,
    > > > > > > How can I format (width, wordwrap) of a during runtime added
    > > > > boundcontrol
    > > > > > > Ton
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    ton, Feb 19, 2004
    #9
  10. the onitemcommand is the right place for this. however try Try :
    dim MyButton as string
    MyButton = CType(e.CommandSource, Button).CommandName


    Not sure where you are stuck, are you saying your unable to retrieve what
    you stored in the buttons commandName, and commandArugment values or your
    not able to get the cell where this button is located

    "ton" <> wrote in message
    news:c12li9$okk$1.nb.home.nl...
    > I will do what you suggest.
    >
    > In the mean time I'm trying to handle the event of the buttoncolumn. I
    > receive the event, but I want to get the ID of the row:
    >
    > col = New ButtonColumn '' BoundColumn
    >
    > col.HeaderText = "ID"
    >
    > col.DataTextField = "ID"
    >
    > col.ButtonType = ButtonColumnType.PushButton
    >
    > col.HeaderStyle.Wrap = False
    >
    > col.CommandName = "Card"
    >
    > Datagrid.Columns.Add(col)
    >
    > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    >
    > ----
    > the datagridcard procedure
    > Private Sub DataGridCard(ByVal sender As Object, ByVal e As
    > System.Web.UI.WebControls.DataGridCommandEventArgs)
    >
    > Dim datagrid As DataGrid, x As Label
    >
    > datagrid = CType(sender, DataGrid)
    >
    > x = FindControl("X")
    >
    > datagrid.EditItemIndex = e.Item.ItemIndex
    >
    > x.Text = "Xpage " + CStr(e.CommandName) + " " & e.Item.ItemIndex &
    > e.CommandArgument ''DataItem
    >
    > datagrid.DataBind()
    >
    > End Sub
    >
    > Since the buttoncolumn displays the recordnumber I want to get that ID.

    With
    > that ID i can call my dialog to edit the cardrecord.
    > How do I get there. The datagrid.edititemindex only modifies the way the
    > record is shown (an you may edit it), buto that's not what I want to do,
    > Thanks
    >
    > Ton
    >
    >
    >
    > "Alessandro Zifiglio" <> schreef in
    > bericht news:rK3Zb.9099$...
    > > This last one is probably a bug in your application. I suggest you try

    and
    > > run in debug mode again and step through this line by line and see the
    > > execution of your code and what happens as you hit the next or previous
    > > buttons.
    > >
    > > The previous button should be able to go all the way to the first page

    and
    > > then stay disabled if its the first page, and the next button should be

    > able
    > > to go to the last record and then disable on the last. Try and use

    > numbered
    > > links and see if your getting the same behavior whereas to next-previous
    > > links. That is set pager mode to NumericPages whereas to NextPrev.
    > >
    > > From your previous posts i've noted that you are doing this correctly

    and
    > > are also using the OnPageIndexChanged method correctly, so surely you

    have
    > a
    > > small bug in your code.
    > >
    > > "Alessandro Zifiglio" <> wrote in
    > > message news:XB3Zb.9094$...
    > > > almost forgot, for the width do :
    > > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > > "Alessandro Zifiglio" <> wrote

    in
    > > > message news:Xw3Zb.9092$...
    > > > > boundcolumn1.ItemStyle.Wrap = True
    > > > > sets wrapping for all item cells of the column
    > > > >
    > > > > "ton" <> wrote in message
    > > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > > I add a Buttoncolumn, allthough I rather add a button with a text

    on
    > > it.
    > > > > > This column is bound to the dataset. And for the other columns I

    add
    > > > > > Boundcolumns, but the do not look good.
    > > > > > Text is wrapped up (several lines) and I cannot set the with of a
    > > > column.
    > > > > >
    > > > > > Do you have any suggestions (and/or additional reading)
    > > > > >
    > > > > > Thanks
    > > > > > "Alessandro Zifiglio" <>

    > schreef
    > > > in
    > > > > > bericht news:NB2Zb.9070$...
    > > > > > > are you adding a boundColumn at runtime ?
    > > > > > > What exactly is the control you are adding at runtime. If its a
    > > > > > BoundColumn,
    > > > > > > it already exposes various header/item/footer style properties

    > which
    > > > you
    > > > > > can
    > > > > > > use for formatting . .look in the BoundColumn Members section
    > > > > > >
    > > > > > > "ton" <> wrote in message
    > > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > > Hi,
    > > > > > > > How can I format (width, wordwrap) of a during runtime added
    > > > > > boundcontrol
    > > > > > > > Ton
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alessandro Zifiglio, Feb 19, 2004
    #10
  11. ton

    ton Guest

    dim but as Button

    but = CType(e.CommandSource, Button) ''.CommandName

    x.Text = "Xpage " + but.Text

    the but.text gives the text on the button which is the recordid. (Offcourse
    I rather do not like to show the recordid, but for now it works.)
    Thanx,
    Now the prev and it begins to look at a sophisticated control.



    "Alessandro Zifiglio" <> schreef in
    bericht news:235Zb.9187$...
    > the onitemcommand is the right place for this. however try Try :
    > dim MyButton as string
    > MyButton = CType(e.CommandSource, Button).CommandName
    >
    >
    > Not sure where you are stuck, are you saying your unable to retrieve what
    > you stored in the buttons commandName, and commandArugment values or your
    > not able to get the cell where this button is located
    >
    > "ton" <> wrote in message
    > news:c12li9$okk$1.nb.home.nl...
    > > I will do what you suggest.
    > >
    > > In the mean time I'm trying to handle the event of the buttoncolumn. I
    > > receive the event, but I want to get the ID of the row:
    > >
    > > col = New ButtonColumn '' BoundColumn
    > >
    > > col.HeaderText = "ID"
    > >
    > > col.DataTextField = "ID"
    > >
    > > col.ButtonType = ButtonColumnType.PushButton
    > >
    > > col.HeaderStyle.Wrap = False
    > >
    > > col.CommandName = "Card"
    > >
    > > Datagrid.Columns.Add(col)
    > >
    > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > >
    > > ----
    > > the datagridcard procedure
    > > Private Sub DataGridCard(ByVal sender As Object, ByVal e As
    > > System.Web.UI.WebControls.DataGridCommandEventArgs)
    > >
    > > Dim datagrid As DataGrid, x As Label
    > >
    > > datagrid = CType(sender, DataGrid)
    > >
    > > x = FindControl("X")
    > >
    > > datagrid.EditItemIndex = e.Item.ItemIndex
    > >
    > > x.Text = "Xpage " + CStr(e.CommandName) + " " & e.Item.ItemIndex &
    > > e.CommandArgument ''DataItem
    > >
    > > datagrid.DataBind()
    > >
    > > End Sub
    > >
    > > Since the buttoncolumn displays the recordnumber I want to get that ID.

    > With
    > > that ID i can call my dialog to edit the cardrecord.
    > > How do I get there. The datagrid.edititemindex only modifies the way the
    > > record is shown (an you may edit it), buto that's not what I want to do,
    > > Thanks
    > >
    > > Ton
    > >
    > >
    > >
    > > "Alessandro Zifiglio" <> schreef

    in
    > > bericht news:rK3Zb.9099$...
    > > > This last one is probably a bug in your application. I suggest you try

    > and
    > > > run in debug mode again and step through this line by line and see the
    > > > execution of your code and what happens as you hit the next or

    previous
    > > > buttons.
    > > >
    > > > The previous button should be able to go all the way to the first page

    > and
    > > > then stay disabled if its the first page, and the next button should

    be
    > > able
    > > > to go to the last record and then disable on the last. Try and use

    > > numbered
    > > > links and see if your getting the same behavior whereas to

    next-previous
    > > > links. That is set pager mode to NumericPages whereas to NextPrev.
    > > >
    > > > From your previous posts i've noted that you are doing this correctly

    > and
    > > > are also using the OnPageIndexChanged method correctly, so surely you

    > have
    > > a
    > > > small bug in your code.
    > > >
    > > > "Alessandro Zifiglio" <> wrote

    in
    > > > message news:XB3Zb.9094$...
    > > > > almost forgot, for the width do :
    > > > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > > > "Alessandro Zifiglio" <> wrote

    > in
    > > > > message news:Xw3Zb.9092$...
    > > > > > boundcolumn1.ItemStyle.Wrap = True
    > > > > > sets wrapping for all item cells of the column
    > > > > >
    > > > > > "ton" <> wrote in message
    > > > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > > > I add a Buttoncolumn, allthough I rather add a button with a

    text
    > on
    > > > it.
    > > > > > > This column is bound to the dataset. And for the other columns I

    > add
    > > > > > > Boundcolumns, but the do not look good.
    > > > > > > Text is wrapped up (several lines) and I cannot set the with of

    a
    > > > > column.
    > > > > > >
    > > > > > > Do you have any suggestions (and/or additional reading)
    > > > > > >
    > > > > > > Thanks
    > > > > > > "Alessandro Zifiglio" <>

    > > schreef
    > > > > in
    > > > > > > bericht news:NB2Zb.9070$...
    > > > > > > > are you adding a boundColumn at runtime ?
    > > > > > > > What exactly is the control you are adding at runtime. If its

    a
    > > > > > > BoundColumn,
    > > > > > > > it already exposes various header/item/footer style properties

    > > which
    > > > > you
    > > > > > > can
    > > > > > > > use for formatting . .look in the BoundColumn Members section
    > > > > > > >
    > > > > > > > "ton" <> wrote in message
    > > > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > > > Hi,
    > > > > > > > > How can I format (width, wordwrap) of a during runtime added
    > > > > > > boundcontrol
    > > > > > > > > Ton
    > > > > > > > >
    > > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    ton, Feb 19, 2004
    #11
  12. well dont store it in text, store it in commandName, its there for this
    purpose. Yeah these little bugs are hard to trace, try the numeric buttons
    and see if you still have the same problem.
    "ton" <> wrote in message
    news:c12nh0$daa$1.nb.home.nl...
    > dim but as Button
    >
    > but = CType(e.CommandSource, Button) ''.CommandName
    >
    > x.Text = "Xpage " + but.Text
    >
    > the but.text gives the text on the button which is the recordid.

    (Offcourse
    > I rather do not like to show the recordid, but for now it works.)
    > Thanx,
    > Now the prev and it begins to look at a sophisticated control.
    >
    >
    >
    > "Alessandro Zifiglio" <> schreef in
    > bericht news:235Zb.9187$...
    > > the onitemcommand is the right place for this. however try Try :
    > > dim MyButton as string
    > > MyButton = CType(e.CommandSource, Button).CommandName
    > >
    > >
    > > Not sure where you are stuck, are you saying your unable to retrieve

    what
    > > you stored in the buttons commandName, and commandArugment values or

    your
    > > not able to get the cell where this button is located
    > >
    > > "ton" <> wrote in message
    > > news:c12li9$okk$1.nb.home.nl...
    > > > I will do what you suggest.
    > > >
    > > > In the mean time I'm trying to handle the event of the buttoncolumn. I
    > > > receive the event, but I want to get the ID of the row:
    > > >
    > > > col = New ButtonColumn '' BoundColumn
    > > >
    > > > col.HeaderText = "ID"
    > > >
    > > > col.DataTextField = "ID"
    > > >
    > > > col.ButtonType = ButtonColumnType.PushButton
    > > >
    > > > col.HeaderStyle.Wrap = False
    > > >
    > > > col.CommandName = "Card"
    > > >
    > > > Datagrid.Columns.Add(col)
    > > >
    > > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > > >
    > > > ----
    > > > the datagridcard procedure
    > > > Private Sub DataGridCard(ByVal sender As Object, ByVal e As
    > > > System.Web.UI.WebControls.DataGridCommandEventArgs)
    > > >
    > > > Dim datagrid As DataGrid, x As Label
    > > >
    > > > datagrid = CType(sender, DataGrid)
    > > >
    > > > x = FindControl("X")
    > > >
    > > > datagrid.EditItemIndex = e.Item.ItemIndex
    > > >
    > > > x.Text = "Xpage " + CStr(e.CommandName) + " " & e.Item.ItemIndex &
    > > > e.CommandArgument ''DataItem
    > > >
    > > > datagrid.DataBind()
    > > >
    > > > End Sub
    > > >
    > > > Since the buttoncolumn displays the recordnumber I want to get that

    ID.
    > > With
    > > > that ID i can call my dialog to edit the cardrecord.
    > > > How do I get there. The datagrid.edititemindex only modifies the way

    the
    > > > record is shown (an you may edit it), buto that's not what I want to

    do,
    > > > Thanks
    > > >
    > > > Ton
    > > >
    > > >
    > > >
    > > > "Alessandro Zifiglio" <> schreef

    > in
    > > > bericht news:rK3Zb.9099$...
    > > > > This last one is probably a bug in your application. I suggest you

    try
    > > and
    > > > > run in debug mode again and step through this line by line and see

    the
    > > > > execution of your code and what happens as you hit the next or

    > previous
    > > > > buttons.
    > > > >
    > > > > The previous button should be able to go all the way to the first

    page
    > > and
    > > > > then stay disabled if its the first page, and the next button should

    > be
    > > > able
    > > > > to go to the last record and then disable on the last. Try and use
    > > > numbered
    > > > > links and see if your getting the same behavior whereas to

    > next-previous
    > > > > links. That is set pager mode to NumericPages whereas to NextPrev.
    > > > >
    > > > > From your previous posts i've noted that you are doing this

    correctly
    > > and
    > > > > are also using the OnPageIndexChanged method correctly, so surely

    you
    > > have
    > > > a
    > > > > small bug in your code.
    > > > >
    > > > > "Alessandro Zifiglio" <> wrote

    > in
    > > > > message news:XB3Zb.9094$...
    > > > > > almost forgot, for the width do :
    > > > > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > > > > "Alessandro Zifiglio" <>

    wrote
    > > in
    > > > > > message news:Xw3Zb.9092$...
    > > > > > > boundcolumn1.ItemStyle.Wrap = True
    > > > > > > sets wrapping for all item cells of the column
    > > > > > >
    > > > > > > "ton" <> wrote in message
    > > > > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > > > > I add a Buttoncolumn, allthough I rather add a button with a

    > text
    > > on
    > > > > it.
    > > > > > > > This column is bound to the dataset. And for the other columns

    I
    > > add
    > > > > > > > Boundcolumns, but the do not look good.
    > > > > > > > Text is wrapped up (several lines) and I cannot set the with

    of
    > a
    > > > > > column.
    > > > > > > >
    > > > > > > > Do you have any suggestions (and/or additional reading)
    > > > > > > >
    > > > > > > > Thanks
    > > > > > > > "Alessandro Zifiglio" <>
    > > > schreef
    > > > > > in
    > > > > > > > bericht news:NB2Zb.9070$...
    > > > > > > > > are you adding a boundColumn at runtime ?
    > > > > > > > > What exactly is the control you are adding at runtime. If

    its
    > a
    > > > > > > > BoundColumn,
    > > > > > > > > it already exposes various header/item/footer style

    properties
    > > > which
    > > > > > you
    > > > > > > > can
    > > > > > > > > use for formatting . .look in the BoundColumn Members

    section
    > > > > > > > >
    > > > > > > > > "ton" <> wrote in message
    > > > > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > > > > Hi,
    > > > > > > > > > How can I format (width, wordwrap) of a during runtime

    added
    > > > > > > > boundcontrol
    > > > > > > > > > Ton
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > >
    > > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alessandro Zifiglio, Feb 19, 2004
    #12
  13. ton

    ton Guest

    this works, but when I push the next button the procedure DataGridCard is
    also handled:

    So the nextprev button fires (only the next button) via:
    AddHandler Datagrid.PageIndexChanged, AddressOf Me.nextprev

    but the datagridcard procedure is fired first. Via

    AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard

    Probaly handlers the next also the itemcommand, but why should it come
    first?

    "ton" <> schreef in bericht
    news:c12nh0$daa$1.nb.home.nl...
    > dim but as Button
    >
    > but = CType(e.CommandSource, Button) ''.CommandName
    >
    > x.Text = "Xpage " + but.Text
    >
    > the but.text gives the text on the button which is the recordid.

    (Offcourse
    > I rather do not like to show the recordid, but for now it works.)
    > Thanx,
    > Now the prev and it begins to look at a sophisticated control.
    >
    >
    >
    > "Alessandro Zifiglio" <> schreef in
    > bericht news:235Zb.9187$...
    > > the onitemcommand is the right place for this. however try Try :
    > > dim MyButton as string
    > > MyButton = CType(e.CommandSource, Button).CommandName
    > >
    > >
    > > Not sure where you are stuck, are you saying your unable to retrieve

    what
    > > you stored in the buttons commandName, and commandArugment values or

    your
    > > not able to get the cell where this button is located
    > >
    > > "ton" <> wrote in message
    > > news:c12li9$okk$1.nb.home.nl...
    > > > I will do what you suggest.
    > > >
    > > > In the mean time I'm trying to handle the event of the buttoncolumn. I
    > > > receive the event, but I want to get the ID of the row:
    > > >
    > > > col = New ButtonColumn '' BoundColumn
    > > >
    > > > col.HeaderText = "ID"
    > > >
    > > > col.DataTextField = "ID"
    > > >
    > > > col.ButtonType = ButtonColumnType.PushButton
    > > >
    > > > col.HeaderStyle.Wrap = False
    > > >
    > > > col.CommandName = "Card"
    > > >
    > > > Datagrid.Columns.Add(col)
    > > >
    > > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > > >
    > > > ----
    > > > the datagridcard procedure
    > > > Private Sub DataGridCard(ByVal sender As Object, ByVal e As
    > > > System.Web.UI.WebControls.DataGridCommandEventArgs)
    > > >
    > > > Dim datagrid As DataGrid, x As Label
    > > >
    > > > datagrid = CType(sender, DataGrid)
    > > >
    > > > x = FindControl("X")
    > > >
    > > > datagrid.EditItemIndex = e.Item.ItemIndex
    > > >
    > > > x.Text = "Xpage " + CStr(e.CommandName) + " " & e.Item.ItemIndex &
    > > > e.CommandArgument ''DataItem
    > > >
    > > > datagrid.DataBind()
    > > >
    > > > End Sub
    > > >
    > > > Since the buttoncolumn displays the recordnumber I want to get that

    ID.
    > > With
    > > > that ID i can call my dialog to edit the cardrecord.
    > > > How do I get there. The datagrid.edititemindex only modifies the way

    the
    > > > record is shown (an you may edit it), buto that's not what I want to

    do,
    > > > Thanks
    > > >
    > > > Ton
    > > >
    > > >
    > > >
    > > > "Alessandro Zifiglio" <> schreef

    > in
    > > > bericht news:rK3Zb.9099$...
    > > > > This last one is probably a bug in your application. I suggest you

    try
    > > and
    > > > > run in debug mode again and step through this line by line and see

    the
    > > > > execution of your code and what happens as you hit the next or

    > previous
    > > > > buttons.
    > > > >
    > > > > The previous button should be able to go all the way to the first

    page
    > > and
    > > > > then stay disabled if its the first page, and the next button should

    > be
    > > > able
    > > > > to go to the last record and then disable on the last. Try and use
    > > > numbered
    > > > > links and see if your getting the same behavior whereas to

    > next-previous
    > > > > links. That is set pager mode to NumericPages whereas to NextPrev.
    > > > >
    > > > > From your previous posts i've noted that you are doing this

    correctly
    > > and
    > > > > are also using the OnPageIndexChanged method correctly, so surely

    you
    > > have
    > > > a
    > > > > small bug in your code.
    > > > >
    > > > > "Alessandro Zifiglio" <> wrote

    > in
    > > > > message news:XB3Zb.9094$...
    > > > > > almost forgot, for the width do :
    > > > > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > > > > "Alessandro Zifiglio" <>

    wrote
    > > in
    > > > > > message news:Xw3Zb.9092$...
    > > > > > > boundcolumn1.ItemStyle.Wrap = True
    > > > > > > sets wrapping for all item cells of the column
    > > > > > >
    > > > > > > "ton" <> wrote in message
    > > > > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > > > > I add a Buttoncolumn, allthough I rather add a button with a

    > text
    > > on
    > > > > it.
    > > > > > > > This column is bound to the dataset. And for the other columns

    I
    > > add
    > > > > > > > Boundcolumns, but the do not look good.
    > > > > > > > Text is wrapped up (several lines) and I cannot set the with

    of
    > a
    > > > > > column.
    > > > > > > >
    > > > > > > > Do you have any suggestions (and/or additional reading)
    > > > > > > >
    > > > > > > > Thanks
    > > > > > > > "Alessandro Zifiglio" <>
    > > > schreef
    > > > > > in
    > > > > > > > bericht news:NB2Zb.9070$...
    > > > > > > > > are you adding a boundColumn at runtime ?
    > > > > > > > > What exactly is the control you are adding at runtime. If

    its
    > a
    > > > > > > > BoundColumn,
    > > > > > > > > it already exposes various header/item/footer style

    properties
    > > > which
    > > > > > you
    > > > > > > > can
    > > > > > > > > use for formatting . .look in the BoundColumn Members

    section
    > > > > > > > >
    > > > > > > > > "ton" <> wrote in message
    > > > > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > > > > Hi,
    > > > > > > > > > How can I format (width, wordwrap) of a during runtime

    added
    > > > > > > > boundcontrol
    > > > > > > > > > Ton
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > >
    > > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    ton, Feb 19, 2004
    #13
  14. ton

    ton Guest

    this works, but when I push the next button the procedure DataGridCard is
    also handled:

    So the nextprev button fires (only the next button) via:
    AddHandler Datagrid.PageIndexChanged, AddressOf Me.nextprev

    but the datagridcard procedure is fired first. Via

    AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard

    Probaly handlers the next also the itemcommand, but why should it come
    first?

    "ton" <> schreef in bericht
    news:c12nh0$daa$1.nb.home.nl...
    > dim but as Button
    >
    > but = CType(e.CommandSource, Button) ''.CommandName
    >
    > x.Text = "Xpage " + but.Text
    >
    > the but.text gives the text on the button which is the recordid.

    (Offcourse
    > I rather do not like to show the recordid, but for now it works.)
    > Thanx,
    > Now the prev and it begins to look at a sophisticated control.
    >
    >
    >
    > "Alessandro Zifiglio" <> schreef in
    > bericht news:235Zb.9187$...
    > > the onitemcommand is the right place for this. however try Try :
    > > dim MyButton as string
    > > MyButton = CType(e.CommandSource, Button).CommandName
    > >
    > >
    > > Not sure where you are stuck, are you saying your unable to retrieve

    what
    > > you stored in the buttons commandName, and commandArugment values or

    your
    > > not able to get the cell where this button is located
    > >
    > > "ton" <> wrote in message
    > > news:c12li9$okk$1.nb.home.nl...
    > > > I will do what you suggest.
    > > >
    > > > In the mean time I'm trying to handle the event of the buttoncolumn. I
    > > > receive the event, but I want to get the ID of the row:
    > > >
    > > > col = New ButtonColumn '' BoundColumn
    > > >
    > > > col.HeaderText = "ID"
    > > >
    > > > col.DataTextField = "ID"
    > > >
    > > > col.ButtonType = ButtonColumnType.PushButton
    > > >
    > > > col.HeaderStyle.Wrap = False
    > > >
    > > > col.CommandName = "Card"
    > > >
    > > > Datagrid.Columns.Add(col)
    > > >
    > > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > > >
    > > > ----
    > > > the datagridcard procedure
    > > > Private Sub DataGridCard(ByVal sender As Object, ByVal e As
    > > > System.Web.UI.WebControls.DataGridCommandEventArgs)
    > > >
    > > > Dim datagrid As DataGrid, x As Label
    > > >
    > > > datagrid = CType(sender, DataGrid)
    > > >
    > > > x = FindControl("X")
    > > >
    > > > datagrid.EditItemIndex = e.Item.ItemIndex
    > > >
    > > > x.Text = "Xpage " + CStr(e.CommandName) + " " & e.Item.ItemIndex &
    > > > e.CommandArgument ''DataItem
    > > >
    > > > datagrid.DataBind()
    > > >
    > > > End Sub
    > > >
    > > > Since the buttoncolumn displays the recordnumber I want to get that

    ID.
    > > With
    > > > that ID i can call my dialog to edit the cardrecord.
    > > > How do I get there. The datagrid.edititemindex only modifies the way

    the
    > > > record is shown (an you may edit it), buto that's not what I want to

    do,
    > > > Thanks
    > > >
    > > > Ton
    > > >
    > > >
    > > >
    > > > "Alessandro Zifiglio" <> schreef

    > in
    > > > bericht news:rK3Zb.9099$...
    > > > > This last one is probably a bug in your application. I suggest you

    try
    > > and
    > > > > run in debug mode again and step through this line by line and see

    the
    > > > > execution of your code and what happens as you hit the next or

    > previous
    > > > > buttons.
    > > > >
    > > > > The previous button should be able to go all the way to the first

    page
    > > and
    > > > > then stay disabled if its the first page, and the next button should

    > be
    > > > able
    > > > > to go to the last record and then disable on the last. Try and use
    > > > numbered
    > > > > links and see if your getting the same behavior whereas to

    > next-previous
    > > > > links. That is set pager mode to NumericPages whereas to NextPrev.
    > > > >
    > > > > From your previous posts i've noted that you are doing this

    correctly
    > > and
    > > > > are also using the OnPageIndexChanged method correctly, so surely

    you
    > > have
    > > > a
    > > > > small bug in your code.
    > > > >
    > > > > "Alessandro Zifiglio" <> wrote

    > in
    > > > > message news:XB3Zb.9094$...
    > > > > > almost forgot, for the width do :
    > > > > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > > > > "Alessandro Zifiglio" <>

    wrote
    > > in
    > > > > > message news:Xw3Zb.9092$...
    > > > > > > boundcolumn1.ItemStyle.Wrap = True
    > > > > > > sets wrapping for all item cells of the column
    > > > > > >
    > > > > > > "ton" <> wrote in message
    > > > > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > > > > I add a Buttoncolumn, allthough I rather add a button with a

    > text
    > > on
    > > > > it.
    > > > > > > > This column is bound to the dataset. And for the other columns

    I
    > > add
    > > > > > > > Boundcolumns, but the do not look good.
    > > > > > > > Text is wrapped up (several lines) and I cannot set the with

    of
    > a
    > > > > > column.
    > > > > > > >
    > > > > > > > Do you have any suggestions (and/or additional reading)
    > > > > > > >
    > > > > > > > Thanks
    > > > > > > > "Alessandro Zifiglio" <>
    > > > schreef
    > > > > > in
    > > > > > > > bericht news:NB2Zb.9070$...
    > > > > > > > > are you adding a boundColumn at runtime ?
    > > > > > > > > What exactly is the control you are adding at runtime. If

    its
    > a
    > > > > > > > BoundColumn,
    > > > > > > > > it already exposes various header/item/footer style

    properties
    > > > which
    > > > > > you
    > > > > > > > can
    > > > > > > > > use for formatting . .look in the BoundColumn Members

    section
    > > > > > > > >
    > > > > > > > > "ton" <> wrote in message
    > > > > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > > > > Hi,
    > > > > > > > > > How can I format (width, wordwrap) of a during runtime

    added
    > > > > > > > boundcontrol
    > > > > > > > > > Ton
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > >
    > > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    ton, Feb 19, 2004
    #14
  15. ton

    ton Guest

    but how can i store this property in the commandname, it is a buttoncolumn,
    which is databind:
    col = New ButtonColumn '' BoundColumn

    col.HeaderText = "ID"

    col.DataTextField = "ID"

    col.ButtonType = ButtonColumnType.PushButton

    col.HeaderStyle.Wrap = False

    col.CommandName = "Card"

    col.ItemStyle.Wrap = False

    col.ItemStyle.HorizontalAlign = HorizontalAlign.Center

    col.ItemStyle.Width = Unit.Pixel(80)

    Datagrid.Columns.Add(col)

    AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard

    My commandname card does not mean anything, but how can I get the
    columnvalue of the dataset.

    "Alessandro Zifiglio" <> schreef in
    bericht news:a%5Zb.9201$...
    > well dont store it in text, store it in commandName, its there for this
    > purpose. Yeah these little bugs are hard to trace, try the numeric buttons
    > and see if you still have the same problem.
    > "ton" <> wrote in message
    > news:c12nh0$daa$1.nb.home.nl...
    > > dim but as Button
    > >
    > > but = CType(e.CommandSource, Button) ''.CommandName
    > >
    > > x.Text = "Xpage " + but.Text
    > >
    > > the but.text gives the text on the button which is the recordid.

    > (Offcourse
    > > I rather do not like to show the recordid, but for now it works.)
    > > Thanx,
    > > Now the prev and it begins to look at a sophisticated control.
    > >
    > >
    > >
    > > "Alessandro Zifiglio" <> schreef

    in
    > > bericht news:235Zb.9187$...
    > > > the onitemcommand is the right place for this. however try Try :
    > > > dim MyButton as string
    > > > MyButton = CType(e.CommandSource, Button).CommandName
    > > >
    > > >
    > > > Not sure where you are stuck, are you saying your unable to retrieve

    > what
    > > > you stored in the buttons commandName, and commandArugment values or

    > your
    > > > not able to get the cell where this button is located
    > > >
    > > > "ton" <> wrote in message
    > > > news:c12li9$okk$1.nb.home.nl...
    > > > > I will do what you suggest.
    > > > >
    > > > > In the mean time I'm trying to handle the event of the buttoncolumn.

    I
    > > > > receive the event, but I want to get the ID of the row:
    > > > >
    > > > > col = New ButtonColumn '' BoundColumn
    > > > >
    > > > > col.HeaderText = "ID"
    > > > >
    > > > > col.DataTextField = "ID"
    > > > >
    > > > > col.ButtonType = ButtonColumnType.PushButton
    > > > >
    > > > > col.HeaderStyle.Wrap = False
    > > > >
    > > > > col.CommandName = "Card"
    > > > >
    > > > > Datagrid.Columns.Add(col)
    > > > >
    > > > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > > > >
    > > > > ----
    > > > > the datagridcard procedure
    > > > > Private Sub DataGridCard(ByVal sender As Object, ByVal e As
    > > > > System.Web.UI.WebControls.DataGridCommandEventArgs)
    > > > >
    > > > > Dim datagrid As DataGrid, x As Label
    > > > >
    > > > > datagrid = CType(sender, DataGrid)
    > > > >
    > > > > x = FindControl("X")
    > > > >
    > > > > datagrid.EditItemIndex = e.Item.ItemIndex
    > > > >
    > > > > x.Text = "Xpage " + CStr(e.CommandName) + " " & e.Item.ItemIndex &
    > > > > e.CommandArgument ''DataItem
    > > > >
    > > > > datagrid.DataBind()
    > > > >
    > > > > End Sub
    > > > >
    > > > > Since the buttoncolumn displays the recordnumber I want to get that

    > ID.
    > > > With
    > > > > that ID i can call my dialog to edit the cardrecord.
    > > > > How do I get there. The datagrid.edititemindex only modifies the way

    > the
    > > > > record is shown (an you may edit it), buto that's not what I want to

    > do,
    > > > > Thanks
    > > > >
    > > > > Ton
    > > > >
    > > > >
    > > > >
    > > > > "Alessandro Zifiglio" <>

    schreef
    > > in
    > > > > bericht news:rK3Zb.9099$...
    > > > > > This last one is probably a bug in your application. I suggest you

    > try
    > > > and
    > > > > > run in debug mode again and step through this line by line and see

    > the
    > > > > > execution of your code and what happens as you hit the next or

    > > previous
    > > > > > buttons.
    > > > > >
    > > > > > The previous button should be able to go all the way to the first

    > page
    > > > and
    > > > > > then stay disabled if its the first page, and the next button

    should
    > > be
    > > > > able
    > > > > > to go to the last record and then disable on the last. Try and

    use
    > > > > numbered
    > > > > > links and see if your getting the same behavior whereas to

    > > next-previous
    > > > > > links. That is set pager mode to NumericPages whereas to NextPrev.
    > > > > >
    > > > > > From your previous posts i've noted that you are doing this

    > correctly
    > > > and
    > > > > > are also using the OnPageIndexChanged method correctly, so surely

    > you
    > > > have
    > > > > a
    > > > > > small bug in your code.
    > > > > >
    > > > > > "Alessandro Zifiglio" <>

    wrote
    > > in
    > > > > > message news:XB3Zb.9094$...
    > > > > > > almost forgot, for the width do :
    > > > > > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > > > > > "Alessandro Zifiglio" <>

    > wrote
    > > > in
    > > > > > > message news:Xw3Zb.9092$...
    > > > > > > > boundcolumn1.ItemStyle.Wrap = True
    > > > > > > > sets wrapping for all item cells of the column
    > > > > > > >
    > > > > > > > "ton" <> wrote in message
    > > > > > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > > > > > I add a Buttoncolumn, allthough I rather add a button with a

    > > text
    > > > on
    > > > > > it.
    > > > > > > > > This column is bound to the dataset. And for the other

    columns
    > I
    > > > add
    > > > > > > > > Boundcolumns, but the do not look good.
    > > > > > > > > Text is wrapped up (several lines) and I cannot set the with

    > of
    > > a
    > > > > > > column.
    > > > > > > > >
    > > > > > > > > Do you have any suggestions (and/or additional reading)
    > > > > > > > >
    > > > > > > > > Thanks
    > > > > > > > > "Alessandro Zifiglio"

    <>
    > > > > schreef
    > > > > > > in
    > > > > > > > > bericht news:NB2Zb.9070$...
    > > > > > > > > > are you adding a boundColumn at runtime ?
    > > > > > > > > > What exactly is the control you are adding at runtime. If

    > its
    > > a
    > > > > > > > > BoundColumn,
    > > > > > > > > > it already exposes various header/item/footer style

    > properties
    > > > > which
    > > > > > > you
    > > > > > > > > can
    > > > > > > > > > use for formatting . .look in the BoundColumn Members

    > section
    > > > > > > > > >
    > > > > > > > > > "ton" <> wrote in message
    > > > > > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > > > > > Hi,
    > > > > > > > > > > How can I format (width, wordwrap) of a during runtime

    > added
    > > > > > > > > boundcontrol
    > > > > > > > > > > Ton
    > > > > > > > > > >
    > > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > >
    > > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    ton, Feb 19, 2004
    #15
  16. The buttonColumn has a CommandName property. Set your text value here
    instead of the doing it in the buttons text property because this will
    display as caption.


    "ton" <> wrote in message
    news:c12qh3$ft8$1.nb.home.nl...
    > but how can i store this property in the commandname, it is a

    buttoncolumn,
    > which is databind:
    > col = New ButtonColumn '' BoundColumn
    >
    > col.HeaderText = "ID"
    >
    > col.DataTextField = "ID"
    >
    > col.ButtonType = ButtonColumnType.PushButton
    >
    > col.HeaderStyle.Wrap = False
    >
    > col.CommandName = "Card"
    >
    > col.ItemStyle.Wrap = False
    >
    > col.ItemStyle.HorizontalAlign = HorizontalAlign.Center
    >
    > col.ItemStyle.Width = Unit.Pixel(80)
    >
    > Datagrid.Columns.Add(col)
    >
    > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    >
    > My commandname card does not mean anything, but how can I get the
    > columnvalue of the dataset.
    >
    > "Alessandro Zifiglio" <> schreef in
    > bericht news:a%5Zb.9201$...
    > > well dont store it in text, store it in commandName, its there for this
    > > purpose. Yeah these little bugs are hard to trace, try the numeric

    buttons
    > > and see if you still have the same problem.
    > > "ton" <> wrote in message
    > > news:c12nh0$daa$1.nb.home.nl...
    > > > dim but as Button
    > > >
    > > > but = CType(e.CommandSource, Button) ''.CommandName
    > > >
    > > > x.Text = "Xpage " + but.Text
    > > >
    > > > the but.text gives the text on the button which is the recordid.

    > > (Offcourse
    > > > I rather do not like to show the recordid, but for now it works.)
    > > > Thanx,
    > > > Now the prev and it begins to look at a sophisticated control.
    > > >
    > > >
    > > >
    > > > "Alessandro Zifiglio" <> schreef

    > in
    > > > bericht news:235Zb.9187$...
    > > > > the onitemcommand is the right place for this. however try Try :
    > > > > dim MyButton as string
    > > > > MyButton = CType(e.CommandSource, Button).CommandName
    > > > >
    > > > >
    > > > > Not sure where you are stuck, are you saying your unable to retrieve

    > > what
    > > > > you stored in the buttons commandName, and commandArugment values or

    > > your
    > > > > not able to get the cell where this button is located
    > > > >
    > > > > "ton" <> wrote in message
    > > > > news:c12li9$okk$1.nb.home.nl...
    > > > > > I will do what you suggest.
    > > > > >
    > > > > > In the mean time I'm trying to handle the event of the

    buttoncolumn.
    > I
    > > > > > receive the event, but I want to get the ID of the row:
    > > > > >
    > > > > > col = New ButtonColumn '' BoundColumn
    > > > > >
    > > > > > col.HeaderText = "ID"
    > > > > >
    > > > > > col.DataTextField = "ID"
    > > > > >
    > > > > > col.ButtonType = ButtonColumnType.PushButton
    > > > > >
    > > > > > col.HeaderStyle.Wrap = False
    > > > > >
    > > > > > col.CommandName = "Card"
    > > > > >
    > > > > > Datagrid.Columns.Add(col)
    > > > > >
    > > > > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > > > > >
    > > > > > ----
    > > > > > the datagridcard procedure
    > > > > > Private Sub DataGridCard(ByVal sender As Object, ByVal e As
    > > > > > System.Web.UI.WebControls.DataGridCommandEventArgs)
    > > > > >
    > > > > > Dim datagrid As DataGrid, x As Label
    > > > > >
    > > > > > datagrid = CType(sender, DataGrid)
    > > > > >
    > > > > > x = FindControl("X")
    > > > > >
    > > > > > datagrid.EditItemIndex = e.Item.ItemIndex
    > > > > >
    > > > > > x.Text = "Xpage " + CStr(e.CommandName) + " " & e.Item.ItemIndex &
    > > > > > e.CommandArgument ''DataItem
    > > > > >
    > > > > > datagrid.DataBind()
    > > > > >
    > > > > > End Sub
    > > > > >
    > > > > > Since the buttoncolumn displays the recordnumber I want to get

    that
    > > ID.
    > > > > With
    > > > > > that ID i can call my dialog to edit the cardrecord.
    > > > > > How do I get there. The datagrid.edititemindex only modifies the

    way
    > > the
    > > > > > record is shown (an you may edit it), buto that's not what I want

    to
    > > do,
    > > > > > Thanks
    > > > > >
    > > > > > Ton
    > > > > >
    > > > > >
    > > > > >
    > > > > > "Alessandro Zifiglio" <>

    > schreef
    > > > in
    > > > > > bericht news:rK3Zb.9099$...
    > > > > > > This last one is probably a bug in your application. I suggest

    you
    > > try
    > > > > and
    > > > > > > run in debug mode again and step through this line by line and

    see
    > > the
    > > > > > > execution of your code and what happens as you hit the next or
    > > > previous
    > > > > > > buttons.
    > > > > > >
    > > > > > > The previous button should be able to go all the way to the

    first
    > > page
    > > > > and
    > > > > > > then stay disabled if its the first page, and the next button

    > should
    > > > be
    > > > > > able
    > > > > > > to go to the last record and then disable on the last. Try and

    > use
    > > > > > numbered
    > > > > > > links and see if your getting the same behavior whereas to
    > > > next-previous
    > > > > > > links. That is set pager mode to NumericPages whereas to

    NextPrev.
    > > > > > >
    > > > > > > From your previous posts i've noted that you are doing this

    > > correctly
    > > > > and
    > > > > > > are also using the OnPageIndexChanged method correctly, so

    surely
    > > you
    > > > > have
    > > > > > a
    > > > > > > small bug in your code.
    > > > > > >
    > > > > > > "Alessandro Zifiglio" <>

    > wrote
    > > > in
    > > > > > > message news:XB3Zb.9094$...
    > > > > > > > almost forgot, for the width do :
    > > > > > > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > > > > > > "Alessandro Zifiglio" <>

    > > wrote
    > > > > in
    > > > > > > > message news:Xw3Zb.9092$...
    > > > > > > > > boundcolumn1.ItemStyle.Wrap = True
    > > > > > > > > sets wrapping for all item cells of the column
    > > > > > > > >
    > > > > > > > > "ton" <> wrote in message
    > > > > > > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > > > > > > I add a Buttoncolumn, allthough I rather add a button with

    a
    > > > text
    > > > > on
    > > > > > > it.
    > > > > > > > > > This column is bound to the dataset. And for the other

    > columns
    > > I
    > > > > add
    > > > > > > > > > Boundcolumns, but the do not look good.
    > > > > > > > > > Text is wrapped up (several lines) and I cannot set the

    with
    > > of
    > > > a
    > > > > > > > column.
    > > > > > > > > >
    > > > > > > > > > Do you have any suggestions (and/or additional reading)
    > > > > > > > > >
    > > > > > > > > > Thanks
    > > > > > > > > > "Alessandro Zifiglio"

    > <>
    > > > > > schreef
    > > > > > > > in
    > > > > > > > > > bericht news:NB2Zb.9070$...
    > > > > > > > > > > are you adding a boundColumn at runtime ?
    > > > > > > > > > > What exactly is the control you are adding at runtime.

    If
    > > its
    > > > a
    > > > > > > > > > BoundColumn,
    > > > > > > > > > > it already exposes various header/item/footer style

    > > properties
    > > > > > which
    > > > > > > > you
    > > > > > > > > > can
    > > > > > > > > > > use for formatting . .look in the BoundColumn Members

    > > section
    > > > > > > > > > >
    > > > > > > > > > > "ton" <> wrote in message
    > > > > > > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > > > > > > Hi,
    > > > > > > > > > > > How can I format (width, wordwrap) of a during runtime

    > > added
    > > > > > > > > > boundcontrol
    > > > > > > > > > > > Ton
    > > > > > > > > > > >
    > > > > > > > > > > >
    > > > > > > > > > >
    > > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > >
    > > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alessandro Zifiglio, Feb 19, 2004
    #16
  17. ton

    ton Guest

    i do not understand what you mean.
    in my prev. question I added the source, a few lines below. Can you modify
    it ?

    Ton
    "Alessandro Zifiglio" <> schreef in
    bericht news:Bd6Zb.9207$...
    > The buttonColumn has a CommandName property. Set your text value here
    > instead of the doing it in the buttons text property because this will
    > display as caption.
    >
    >
    > "ton" <> wrote in message
    > news:c12qh3$ft8$1.nb.home.nl...
    > > but how can i store this property in the commandname, it is a

    > buttoncolumn,
    > > which is databind:
    > > col = New ButtonColumn '' BoundColumn
    > >
    > > col.HeaderText = "ID"
    > >
    > > col.DataTextField = "ID"
    > >
    > > col.ButtonType = ButtonColumnType.PushButton
    > >
    > > col.HeaderStyle.Wrap = False
    > >
    > > col.CommandName = "Card"
    > >
    > > col.ItemStyle.Wrap = False
    > >
    > > col.ItemStyle.HorizontalAlign = HorizontalAlign.Center
    > >
    > > col.ItemStyle.Width = Unit.Pixel(80)
    > >
    > > Datagrid.Columns.Add(col)
    > >
    > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > >
    > > My commandname card does not mean anything, but how can I get the
    > > columnvalue of the dataset.
    > >
    > > "Alessandro Zifiglio" <> schreef

    in
    > > bericht news:a%5Zb.9201$...
    > > > well dont store it in text, store it in commandName, its there for

    this
    > > > purpose. Yeah these little bugs are hard to trace, try the numeric

    > buttons
    > > > and see if you still have the same problem.
    > > > "ton" <> wrote in message
    > > > news:c12nh0$daa$1.nb.home.nl...
    > > > > dim but as Button
    > > > >
    > > > > but = CType(e.CommandSource, Button) ''.CommandName
    > > > >
    > > > > x.Text = "Xpage " + but.Text
    > > > >
    > > > > the but.text gives the text on the button which is the recordid.
    > > > (Offcourse
    > > > > I rather do not like to show the recordid, but for now it works.)
    > > > > Thanx,
    > > > > Now the prev and it begins to look at a sophisticated control.
    > > > >
    > > > >
    > > > >
    > > > > "Alessandro Zifiglio" <>

    schreef
    > > in
    > > > > bericht news:235Zb.9187$...
    > > > > > the onitemcommand is the right place for this. however try Try :
    > > > > > dim MyButton as string
    > > > > > MyButton = CType(e.CommandSource, Button).CommandName
    > > > > >
    > > > > >
    > > > > > Not sure where you are stuck, are you saying your unable to

    retrieve
    > > > what
    > > > > > you stored in the buttons commandName, and commandArugment values

    or
    > > > your
    > > > > > not able to get the cell where this button is located
    > > > > >
    > > > > > "ton" <> wrote in message
    > > > > > news:c12li9$okk$1.nb.home.nl...
    > > > > > > I will do what you suggest.
    > > > > > >
    > > > > > > In the mean time I'm trying to handle the event of the

    > buttoncolumn.
    > > I
    > > > > > > receive the event, but I want to get the ID of the row:
    > > > > > >
    > > > > > > col = New ButtonColumn '' BoundColumn
    > > > > > >
    > > > > > > col.HeaderText = "ID"
    > > > > > >
    > > > > > > col.DataTextField = "ID"
    > > > > > >
    > > > > > > col.ButtonType = ButtonColumnType.PushButton
    > > > > > >
    > > > > > > col.HeaderStyle.Wrap = False
    > > > > > >
    > > > > > > col.CommandName = "Card"
    > > > > > >
    > > > > > > Datagrid.Columns.Add(col)
    > > > > > >
    > > > > > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > > > > > >
    > > > > > > ----
    > > > > > > the datagridcard procedure
    > > > > > > Private Sub DataGridCard(ByVal sender As Object, ByVal e As
    > > > > > > System.Web.UI.WebControls.DataGridCommandEventArgs)
    > > > > > >
    > > > > > > Dim datagrid As DataGrid, x As Label
    > > > > > >
    > > > > > > datagrid = CType(sender, DataGrid)
    > > > > > >
    > > > > > > x = FindControl("X")
    > > > > > >
    > > > > > > datagrid.EditItemIndex = e.Item.ItemIndex
    > > > > > >
    > > > > > > x.Text = "Xpage " + CStr(e.CommandName) + " " & e.Item.ItemIndex

    &
    > > > > > > e.CommandArgument ''DataItem
    > > > > > >
    > > > > > > datagrid.DataBind()
    > > > > > >
    > > > > > > End Sub
    > > > > > >
    > > > > > > Since the buttoncolumn displays the recordnumber I want to get

    > that
    > > > ID.
    > > > > > With
    > > > > > > that ID i can call my dialog to edit the cardrecord.
    > > > > > > How do I get there. The datagrid.edititemindex only modifies the

    > way
    > > > the
    > > > > > > record is shown (an you may edit it), buto that's not what I

    want
    > to
    > > > do,
    > > > > > > Thanks
    > > > > > >
    > > > > > > Ton
    > > > > > >
    > > > > > >
    > > > > > >
    > > > > > > "Alessandro Zifiglio" <>

    > > schreef
    > > > > in
    > > > > > > bericht news:rK3Zb.9099$...
    > > > > > > > This last one is probably a bug in your application. I suggest

    > you
    > > > try
    > > > > > and
    > > > > > > > run in debug mode again and step through this line by line and

    > see
    > > > the
    > > > > > > > execution of your code and what happens as you hit the next or
    > > > > previous
    > > > > > > > buttons.
    > > > > > > >
    > > > > > > > The previous button should be able to go all the way to the

    > first
    > > > page
    > > > > > and
    > > > > > > > then stay disabled if its the first page, and the next button

    > > should
    > > > > be
    > > > > > > able
    > > > > > > > to go to the last record and then disable on the last. Try

    and
    > > use
    > > > > > > numbered
    > > > > > > > links and see if your getting the same behavior whereas to
    > > > > next-previous
    > > > > > > > links. That is set pager mode to NumericPages whereas to

    > NextPrev.
    > > > > > > >
    > > > > > > > From your previous posts i've noted that you are doing this
    > > > correctly
    > > > > > and
    > > > > > > > are also using the OnPageIndexChanged method correctly, so

    > surely
    > > > you
    > > > > > have
    > > > > > > a
    > > > > > > > small bug in your code.
    > > > > > > >
    > > > > > > > "Alessandro Zifiglio" <>

    > > wrote
    > > > > in
    > > > > > > > message news:XB3Zb.9094$...
    > > > > > > > > almost forgot, for the width do :
    > > > > > > > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > > > > > > > "Alessandro Zifiglio"

    <>
    > > > wrote
    > > > > > in
    > > > > > > > > message news:Xw3Zb.9092$...
    > > > > > > > > > boundcolumn1.ItemStyle.Wrap = True
    > > > > > > > > > sets wrapping for all item cells of the column
    > > > > > > > > >
    > > > > > > > > > "ton" <> wrote in message
    > > > > > > > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > > > > > > > I add a Buttoncolumn, allthough I rather add a button

    with
    > a
    > > > > text
    > > > > > on
    > > > > > > > it.
    > > > > > > > > > > This column is bound to the dataset. And for the other

    > > columns
    > > > I
    > > > > > add
    > > > > > > > > > > Boundcolumns, but the do not look good.
    > > > > > > > > > > Text is wrapped up (several lines) and I cannot set the

    > with
    > > > of
    > > > > a
    > > > > > > > > column.
    > > > > > > > > > >
    > > > > > > > > > > Do you have any suggestions (and/or additional reading)
    > > > > > > > > > >
    > > > > > > > > > > Thanks
    > > > > > > > > > > "Alessandro Zifiglio"

    > > <>
    > > > > > > schreef
    > > > > > > > > in
    > > > > > > > > > > bericht news:NB2Zb.9070$...
    > > > > > > > > > > > are you adding a boundColumn at runtime ?
    > > > > > > > > > > > What exactly is the control you are adding at runtime.

    > If
    > > > its
    > > > > a
    > > > > > > > > > > BoundColumn,
    > > > > > > > > > > > it already exposes various header/item/footer style
    > > > properties
    > > > > > > which
    > > > > > > > > you
    > > > > > > > > > > can
    > > > > > > > > > > > use for formatting . .look in the BoundColumn Members
    > > > section
    > > > > > > > > > > >
    > > > > > > > > > > > "ton" <> wrote in message
    > > > > > > > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > > > > > > > Hi,
    > > > > > > > > > > > > How can I format (width, wordwrap) of a during

    runtime
    > > > added
    > > > > > > > > > > boundcontrol
    > > > > > > > > > > > > Ton
    > > > > > > > > > > > >
    > > > > > > > > > > > >
    > > > > > > > > > > >
    > > > > > > > > > > >
    > > > > > > > > > >
    > > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > >
    > > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    ton, Feb 19, 2004
    #17
  18. ton

    ton Guest

    I think I've solved it. I add the button in unbound mode, add a second
    boundcolumn for the ID column, which visible property = False. Via the cell
    text property
    e.Item.Cells(1).Text I receive the not visible ID



    Thanx Alessandro, you helped me very good !!

    "ton" <> schreef in bericht
    news:c130oh$o5j$1.nb.home.nl...

    > i do not understand what you mean.
    > in my prev. question I added the source, a few lines below. Can you modify
    > it ?
    >
    > Ton
    > "Alessandro Zifiglio" <> schreef in
    > bericht news:Bd6Zb.9207$...
    > > The buttonColumn has a CommandName property. Set your text value here
    > > instead of the doing it in the buttons text property because this will
    > > display as caption.
    > >
    > >
    > > "ton" <> wrote in message
    > > news:c12qh3$ft8$1.nb.home.nl...
    > > > but how can i store this property in the commandname, it is a

    > > buttoncolumn,
    > > > which is databind:
    > > > col = New ButtonColumn '' BoundColumn
    > > >
    > > > col.HeaderText = "ID"
    > > >
    > > > col.DataTextField = "ID"
    > > >
    > > > col.ButtonType = ButtonColumnType.PushButton
    > > >
    > > > col.HeaderStyle.Wrap = False
    > > >
    > > > col.CommandName = "Card"
    > > >
    > > > col.ItemStyle.Wrap = False
    > > >
    > > > col.ItemStyle.HorizontalAlign = HorizontalAlign.Center
    > > >
    > > > col.ItemStyle.Width = Unit.Pixel(80)
    > > >
    > > > Datagrid.Columns.Add(col)
    > > >
    > > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > > >
    > > > My commandname card does not mean anything, but how can I get the
    > > > columnvalue of the dataset.
    > > >
    > > > "Alessandro Zifiglio" <> schreef

    > in
    > > > bericht news:a%5Zb.9201$...
    > > > > well dont store it in text, store it in commandName, its there for

    > this
    > > > > purpose. Yeah these little bugs are hard to trace, try the numeric

    > > buttons
    > > > > and see if you still have the same problem.
    > > > > "ton" <> wrote in message
    > > > > news:c12nh0$daa$1.nb.home.nl...
    > > > > > dim but as Button
    > > > > >
    > > > > > but = CType(e.CommandSource, Button) ''.CommandName
    > > > > >
    > > > > > x.Text = "Xpage " + but.Text
    > > > > >
    > > > > > the but.text gives the text on the button which is the recordid.
    > > > > (Offcourse
    > > > > > I rather do not like to show the recordid, but for now it works.)
    > > > > > Thanx,
    > > > > > Now the prev and it begins to look at a sophisticated control.
    > > > > >
    > > > > >
    > > > > >
    > > > > > "Alessandro Zifiglio" <>

    > schreef
    > > > in
    > > > > > bericht news:235Zb.9187$...
    > > > > > > the onitemcommand is the right place for this. however try Try :
    > > > > > > dim MyButton as string
    > > > > > > MyButton = CType(e.CommandSource, Button).CommandName
    > > > > > >
    > > > > > >
    > > > > > > Not sure where you are stuck, are you saying your unable to

    > retrieve
    > > > > what
    > > > > > > you stored in the buttons commandName, and commandArugment

    values
    > or
    > > > > your
    > > > > > > not able to get the cell where this button is located
    > > > > > >
    > > > > > > "ton" <> wrote in message
    > > > > > > news:c12li9$okk$1.nb.home.nl...
    > > > > > > > I will do what you suggest.
    > > > > > > >
    > > > > > > > In the mean time I'm trying to handle the event of the

    > > buttoncolumn.
    > > > I
    > > > > > > > receive the event, but I want to get the ID of the row:
    > > > > > > >
    > > > > > > > col = New ButtonColumn '' BoundColumn
    > > > > > > >
    > > > > > > > col.HeaderText = "ID"
    > > > > > > >
    > > > > > > > col.DataTextField = "ID"
    > > > > > > >
    > > > > > > > col.ButtonType = ButtonColumnType.PushButton
    > > > > > > >
    > > > > > > > col.HeaderStyle.Wrap = False
    > > > > > > >
    > > > > > > > col.CommandName = "Card"
    > > > > > > >
    > > > > > > > Datagrid.Columns.Add(col)
    > > > > > > >
    > > > > > > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > > > > > > >
    > > > > > > > ----
    > > > > > > > the datagridcard procedure
    > > > > > > > Private Sub DataGridCard(ByVal sender As Object, ByVal e As
    > > > > > > > System.Web.UI.WebControls.DataGridCommandEventArgs)
    > > > > > > >
    > > > > > > > Dim datagrid As DataGrid, x As Label
    > > > > > > >
    > > > > > > > datagrid = CType(sender, DataGrid)
    > > > > > > >
    > > > > > > > x = FindControl("X")
    > > > > > > >
    > > > > > > > datagrid.EditItemIndex = e.Item.ItemIndex
    > > > > > > >
    > > > > > > > x.Text = "Xpage " + CStr(e.CommandName) + " " &

    e.Item.ItemIndex
    > &
    > > > > > > > e.CommandArgument ''DataItem
    > > > > > > >
    > > > > > > > datagrid.DataBind()
    > > > > > > >
    > > > > > > > End Sub
    > > > > > > >
    > > > > > > > Since the buttoncolumn displays the recordnumber I want to get

    > > that
    > > > > ID.
    > > > > > > With
    > > > > > > > that ID i can call my dialog to edit the cardrecord.
    > > > > > > > How do I get there. The datagrid.edititemindex only modifies

    the
    > > way
    > > > > the
    > > > > > > > record is shown (an you may edit it), buto that's not what I

    > want
    > > to
    > > > > do,
    > > > > > > > Thanks
    > > > > > > >
    > > > > > > > Ton
    > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > > > "Alessandro Zifiglio" <>
    > > > schreef
    > > > > > in
    > > > > > > > bericht news:rK3Zb.9099$...
    > > > > > > > > This last one is probably a bug in your application. I

    suggest
    > > you
    > > > > try
    > > > > > > and
    > > > > > > > > run in debug mode again and step through this line by line

    and
    > > see
    > > > > the
    > > > > > > > > execution of your code and what happens as you hit the next

    or
    > > > > > previous
    > > > > > > > > buttons.
    > > > > > > > >
    > > > > > > > > The previous button should be able to go all the way to the

    > > first
    > > > > page
    > > > > > > and
    > > > > > > > > then stay disabled if its the first page, and the next

    button
    > > > should
    > > > > > be
    > > > > > > > able
    > > > > > > > > to go to the last record and then disable on the last. Try

    > and
    > > > use
    > > > > > > > numbered
    > > > > > > > > links and see if your getting the same behavior whereas to
    > > > > > next-previous
    > > > > > > > > links. That is set pager mode to NumericPages whereas to

    > > NextPrev.
    > > > > > > > >
    > > > > > > > > From your previous posts i've noted that you are doing this
    > > > > correctly
    > > > > > > and
    > > > > > > > > are also using the OnPageIndexChanged method correctly, so

    > > surely
    > > > > you
    > > > > > > have
    > > > > > > > a
    > > > > > > > > small bug in your code.
    > > > > > > > >
    > > > > > > > > "Alessandro Zifiglio"

    <>
    > > > wrote
    > > > > > in
    > > > > > > > > message news:XB3Zb.9094$...
    > > > > > > > > > almost forgot, for the width do :
    > > > > > > > > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > > > > > > > > "Alessandro Zifiglio"

    > <>
    > > > > wrote
    > > > > > > in
    > > > > > > > > > message news:Xw3Zb.9092$...
    > > > > > > > > > > boundcolumn1.ItemStyle.Wrap = True
    > > > > > > > > > > sets wrapping for all item cells of the column
    > > > > > > > > > >
    > > > > > > > > > > "ton" <> wrote in message
    > > > > > > > > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > > > > > > > > I add a Buttoncolumn, allthough I rather add a button

    > with
    > > a
    > > > > > text
    > > > > > > on
    > > > > > > > > it.
    > > > > > > > > > > > This column is bound to the dataset. And for the other
    > > > columns
    > > > > I
    > > > > > > add
    > > > > > > > > > > > Boundcolumns, but the do not look good.
    > > > > > > > > > > > Text is wrapped up (several lines) and I cannot set

    the
    > > with
    > > > > of
    > > > > > a
    > > > > > > > > > column.
    > > > > > > > > > > >
    > > > > > > > > > > > Do you have any suggestions (and/or additional

    reading)
    > > > > > > > > > > >
    > > > > > > > > > > > Thanks
    > > > > > > > > > > > "Alessandro Zifiglio"
    > > > <>
    > > > > > > > schreef
    > > > > > > > > > in
    > > > > > > > > > > > bericht news:NB2Zb.9070$...
    > > > > > > > > > > > > are you adding a boundColumn at runtime ?
    > > > > > > > > > > > > What exactly is the control you are adding at

    runtime.
    > > If
    > > > > its
    > > > > > a
    > > > > > > > > > > > BoundColumn,
    > > > > > > > > > > > > it already exposes various header/item/footer style
    > > > > properties
    > > > > > > > which
    > > > > > > > > > you
    > > > > > > > > > > > can
    > > > > > > > > > > > > use for formatting . .look in the BoundColumn

    Members
    > > > > section
    > > > > > > > > > > > >
    > > > > > > > > > > > > "ton" <> wrote in message
    > > > > > > > > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > > > > > > > > Hi,
    > > > > > > > > > > > > > How can I format (width, wordwrap) of a during

    > runtime
    > > > > added
    > > > > > > > > > > > boundcontrol
    > > > > > > > > > > > > > Ton
    > > > > > > > > > > > > >
    > > > > > > > > > > > > >
    > > > > > > > > > > > >
    > > > > > > > > > > > >
    > > > > > > > > > > >
    > > > > > > > > > > >
    > > > > > > > > > >
    > > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > >
    > > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    ton, Feb 19, 2004
    #18
  19. yep, using an invisible boundcolumn for the id is widely used and is much
    better. Good job ;)
    "ton" <> wrote in message
    news:c1322j$5f3$1.nb.home.nl...
    > I think I've solved it. I add the button in unbound mode, add a second
    > boundcolumn for the ID column, which visible property = False. Via the

    cell
    > text property
    > e.Item.Cells(1).Text I receive the not visible ID
    >
    >
    >
    > Thanx Alessandro, you helped me very good !!
    >
    > "ton" <> schreef in bericht
    > news:c130oh$o5j$1.nb.home.nl...
    >
    > > i do not understand what you mean.
    > > in my prev. question I added the source, a few lines below. Can you

    modify
    > > it ?
    > >
    > > Ton
    > > "Alessandro Zifiglio" <> schreef

    in
    > > bericht news:Bd6Zb.9207$...
    > > > The buttonColumn has a CommandName property. Set your text value here
    > > > instead of the doing it in the buttons text property because this will
    > > > display as caption.
    > > >
    > > >
    > > > "ton" <> wrote in message
    > > > news:c12qh3$ft8$1.nb.home.nl...
    > > > > but how can i store this property in the commandname, it is a
    > > > buttoncolumn,
    > > > > which is databind:
    > > > > col = New ButtonColumn '' BoundColumn
    > > > >
    > > > > col.HeaderText = "ID"
    > > > >
    > > > > col.DataTextField = "ID"
    > > > >
    > > > > col.ButtonType = ButtonColumnType.PushButton
    > > > >
    > > > > col.HeaderStyle.Wrap = False
    > > > >
    > > > > col.CommandName = "Card"
    > > > >
    > > > > col.ItemStyle.Wrap = False
    > > > >
    > > > > col.ItemStyle.HorizontalAlign = HorizontalAlign.Center
    > > > >
    > > > > col.ItemStyle.Width = Unit.Pixel(80)
    > > > >
    > > > > Datagrid.Columns.Add(col)
    > > > >
    > > > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > > > >
    > > > > My commandname card does not mean anything, but how can I get the
    > > > > columnvalue of the dataset.
    > > > >
    > > > > "Alessandro Zifiglio" <>

    schreef
    > > in
    > > > > bericht news:a%5Zb.9201$...
    > > > > > well dont store it in text, store it in commandName, its there for

    > > this
    > > > > > purpose. Yeah these little bugs are hard to trace, try the numeric
    > > > buttons
    > > > > > and see if you still have the same problem.
    > > > > > "ton" <> wrote in message
    > > > > > news:c12nh0$daa$1.nb.home.nl...
    > > > > > > dim but as Button
    > > > > > >
    > > > > > > but = CType(e.CommandSource, Button) ''.CommandName
    > > > > > >
    > > > > > > x.Text = "Xpage " + but.Text
    > > > > > >
    > > > > > > the but.text gives the text on the button which is the recordid.
    > > > > > (Offcourse
    > > > > > > I rather do not like to show the recordid, but for now it

    works.)
    > > > > > > Thanx,
    > > > > > > Now the prev and it begins to look at a sophisticated control.
    > > > > > >
    > > > > > >
    > > > > > >
    > > > > > > "Alessandro Zifiglio" <>

    > > schreef
    > > > > in
    > > > > > > bericht news:235Zb.9187$...
    > > > > > > > the onitemcommand is the right place for this. however try Try

    :
    > > > > > > > dim MyButton as string
    > > > > > > > MyButton = CType(e.CommandSource, Button).CommandName
    > > > > > > >
    > > > > > > >
    > > > > > > > Not sure where you are stuck, are you saying your unable to

    > > retrieve
    > > > > > what
    > > > > > > > you stored in the buttons commandName, and commandArugment

    > values
    > > or
    > > > > > your
    > > > > > > > not able to get the cell where this button is located
    > > > > > > >
    > > > > > > > "ton" <> wrote in message
    > > > > > > > news:c12li9$okk$1.nb.home.nl...
    > > > > > > > > I will do what you suggest.
    > > > > > > > >
    > > > > > > > > In the mean time I'm trying to handle the event of the
    > > > buttoncolumn.
    > > > > I
    > > > > > > > > receive the event, but I want to get the ID of the row:
    > > > > > > > >
    > > > > > > > > col = New ButtonColumn '' BoundColumn
    > > > > > > > >
    > > > > > > > > col.HeaderText = "ID"
    > > > > > > > >
    > > > > > > > > col.DataTextField = "ID"
    > > > > > > > >
    > > > > > > > > col.ButtonType = ButtonColumnType.PushButton
    > > > > > > > >
    > > > > > > > > col.HeaderStyle.Wrap = False
    > > > > > > > >
    > > > > > > > > col.CommandName = "Card"
    > > > > > > > >
    > > > > > > > > Datagrid.Columns.Add(col)
    > > > > > > > >
    > > > > > > > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > > > > > > > >
    > > > > > > > > ----
    > > > > > > > > the datagridcard procedure
    > > > > > > > > Private Sub DataGridCard(ByVal sender As Object, ByVal e As
    > > > > > > > > System.Web.UI.WebControls.DataGridCommandEventArgs)
    > > > > > > > >
    > > > > > > > > Dim datagrid As DataGrid, x As Label
    > > > > > > > >
    > > > > > > > > datagrid = CType(sender, DataGrid)
    > > > > > > > >
    > > > > > > > > x = FindControl("X")
    > > > > > > > >
    > > > > > > > > datagrid.EditItemIndex = e.Item.ItemIndex
    > > > > > > > >
    > > > > > > > > x.Text = "Xpage " + CStr(e.CommandName) + " " &

    > e.Item.ItemIndex
    > > &
    > > > > > > > > e.CommandArgument ''DataItem
    > > > > > > > >
    > > > > > > > > datagrid.DataBind()
    > > > > > > > >
    > > > > > > > > End Sub
    > > > > > > > >
    > > > > > > > > Since the buttoncolumn displays the recordnumber I want to

    get
    > > > that
    > > > > > ID.
    > > > > > > > With
    > > > > > > > > that ID i can call my dialog to edit the cardrecord.
    > > > > > > > > How do I get there. The datagrid.edititemindex only modifies

    > the
    > > > way
    > > > > > the
    > > > > > > > > record is shown (an you may edit it), buto that's not what I

    > > want
    > > > to
    > > > > > do,
    > > > > > > > > Thanks
    > > > > > > > >
    > > > > > > > > Ton
    > > > > > > > >
    > > > > > > > >
    > > > > > > > >
    > > > > > > > > "Alessandro Zifiglio"

    <>
    > > > > schreef
    > > > > > > in
    > > > > > > > > bericht news:rK3Zb.9099$...
    > > > > > > > > > This last one is probably a bug in your application. I

    > suggest
    > > > you
    > > > > > try
    > > > > > > > and
    > > > > > > > > > run in debug mode again and step through this line by line

    > and
    > > > see
    > > > > > the
    > > > > > > > > > execution of your code and what happens as you hit the

    next
    > or
    > > > > > > previous
    > > > > > > > > > buttons.
    > > > > > > > > >
    > > > > > > > > > The previous button should be able to go all the way to

    the
    > > > first
    > > > > > page
    > > > > > > > and
    > > > > > > > > > then stay disabled if its the first page, and the next

    > button
    > > > > should
    > > > > > > be
    > > > > > > > > able
    > > > > > > > > > to go to the last record and then disable on the last.

    Try
    > > and
    > > > > use
    > > > > > > > > numbered
    > > > > > > > > > links and see if your getting the same behavior whereas to
    > > > > > > next-previous
    > > > > > > > > > links. That is set pager mode to NumericPages whereas to
    > > > NextPrev.
    > > > > > > > > >
    > > > > > > > > > From your previous posts i've noted that you are doing

    this
    > > > > > correctly
    > > > > > > > and
    > > > > > > > > > are also using the OnPageIndexChanged method correctly, so
    > > > surely
    > > > > > you
    > > > > > > > have
    > > > > > > > > a
    > > > > > > > > > small bug in your code.
    > > > > > > > > >
    > > > > > > > > > "Alessandro Zifiglio"

    > <>
    > > > > wrote
    > > > > > > in
    > > > > > > > > > message news:XB3Zb.9094$...
    > > > > > > > > > > almost forgot, for the width do :
    > > > > > > > > > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > > > > > > > > > "Alessandro Zifiglio"

    > > <>
    > > > > > wrote
    > > > > > > > in
    > > > > > > > > > > message news:Xw3Zb.9092$...
    > > > > > > > > > > > boundcolumn1.ItemStyle.Wrap = True
    > > > > > > > > > > > sets wrapping for all item cells of the column
    > > > > > > > > > > >
    > > > > > > > > > > > "ton" <> wrote in message
    > > > > > > > > > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > > > > > > > > > I add a Buttoncolumn, allthough I rather add a

    button
    > > with
    > > > a
    > > > > > > text
    > > > > > > > on
    > > > > > > > > > it.
    > > > > > > > > > > > > This column is bound to the dataset. And for the

    other
    > > > > columns
    > > > > > I
    > > > > > > > add
    > > > > > > > > > > > > Boundcolumns, but the do not look good.
    > > > > > > > > > > > > Text is wrapped up (several lines) and I cannot set

    > the
    > > > with
    > > > > > of
    > > > > > > a
    > > > > > > > > > > column.
    > > > > > > > > > > > >
    > > > > > > > > > > > > Do you have any suggestions (and/or additional

    > reading)
    > > > > > > > > > > > >
    > > > > > > > > > > > > Thanks
    > > > > > > > > > > > > "Alessandro Zifiglio"
    > > > > <>
    > > > > > > > > schreef
    > > > > > > > > > > in
    > > > > > > > > > > > > bericht

    news:NB2Zb.9070$...
    > > > > > > > > > > > > > are you adding a boundColumn at runtime ?
    > > > > > > > > > > > > > What exactly is the control you are adding at

    > runtime.
    > > > If
    > > > > > its
    > > > > > > a
    > > > > > > > > > > > > BoundColumn,
    > > > > > > > > > > > > > it already exposes various header/item/footer

    style
    > > > > > properties
    > > > > > > > > which
    > > > > > > > > > > you
    > > > > > > > > > > > > can
    > > > > > > > > > > > > > use for formatting . .look in the BoundColumn

    > Members
    > > > > > section
    > > > > > > > > > > > > >
    > > > > > > > > > > > > > "ton" <> wrote in message
    > > > > > > > > > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > > > > > > > > > Hi,
    > > > > > > > > > > > > > > How can I format (width, wordwrap) of a during

    > > runtime
    > > > > > added
    > > > > > > > > > > > > boundcontrol
    > > > > > > > > > > > > > > Ton
    > > > > > > > > > > > > > >
    > > > > > > > > > > > > > >
    > > > > > > > > > > > > >
    > > > > > > > > > > > > >
    > > > > > > > > > > > >
    > > > > > > > > > > > >
    > > > > > > > > > > >
    > > > > > > > > > > >
    > > > > > > > > > >
    > > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > >
    > > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alessandro Zifiglio, Feb 19, 2004
    #19
  20. ton

    ton Guest

    In the prev/next page I do not get any progressing. I'show the code:
    I've changed several properties, such as
    allowpaging=true, allow custompaging=true and the vitualpagingcount=100
    in the control creation I added 2 button (prev en next) and they where
    "redirected" to this procedure:
    Private Sub PrevNext(ByVal sender As Object, ByVal e As System.EventArgs)

    Dim But As New Button, a As String, b As String

    Dim datagrid As DataGrid, x As Label

    But = CType(sender, Button)

    a = But.CommandName

    datagrid = FindControl("GRID" + ClientID)

    If But.CommandName = "next" Then

    datagrid.CurrentPageIndex = datagrid.CurrentPageIndex + 1

    ElseIf But.CommandName = "prev" Then

    datagrid.CurrentPageIndex = datagrid.CurrentPageIndex - 1

    End If

    datagrid.DataBind()

    End Sub

    Nothing happend, allthough in debug mode I can see that the currentpageindex
    is modified




    "Alessandro Zifiglio" <> schreef in
    bericht news:Yh8Zb.9265$...
    > yep, using an invisible boundcolumn for the id is widely used and is much
    > better. Good job ;)
    > "ton" <> wrote in message
    > news:c1322j$5f3$1.nb.home.nl...
    > > I think I've solved it. I add the button in unbound mode, add a second
    > > boundcolumn for the ID column, which visible property = False. Via the

    > cell
    > > text property
    > > e.Item.Cells(1).Text I receive the not visible ID
    > >
    > >
    > >
    > > Thanx Alessandro, you helped me very good !!
    > >
    > > "ton" <> schreef in bericht
    > > news:c130oh$o5j$1.nb.home.nl...
    > >
    > > > i do not understand what you mean.
    > > > in my prev. question I added the source, a few lines below. Can you

    > modify
    > > > it ?
    > > >
    > > > Ton
    > > > "Alessandro Zifiglio" <> schreef

    > in
    > > > bericht news:Bd6Zb.9207$...
    > > > > The buttonColumn has a CommandName property. Set your text value

    here
    > > > > instead of the doing it in the buttons text property because this

    will
    > > > > display as caption.
    > > > >
    > > > >
    > > > > "ton" <> wrote in message
    > > > > news:c12qh3$ft8$1.nb.home.nl...
    > > > > > but how can i store this property in the commandname, it is a
    > > > > buttoncolumn,
    > > > > > which is databind:
    > > > > > col = New ButtonColumn '' BoundColumn
    > > > > >
    > > > > > col.HeaderText = "ID"
    > > > > >
    > > > > > col.DataTextField = "ID"
    > > > > >
    > > > > > col.ButtonType = ButtonColumnType.PushButton
    > > > > >
    > > > > > col.HeaderStyle.Wrap = False
    > > > > >
    > > > > > col.CommandName = "Card"
    > > > > >
    > > > > > col.ItemStyle.Wrap = False
    > > > > >
    > > > > > col.ItemStyle.HorizontalAlign = HorizontalAlign.Center
    > > > > >
    > > > > > col.ItemStyle.Width = Unit.Pixel(80)
    > > > > >
    > > > > > Datagrid.Columns.Add(col)
    > > > > >
    > > > > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > > > > >
    > > > > > My commandname card does not mean anything, but how can I get the
    > > > > > columnvalue of the dataset.
    > > > > >
    > > > > > "Alessandro Zifiglio" <>

    > schreef
    > > > in
    > > > > > bericht news:a%5Zb.9201$...
    > > > > > > well dont store it in text, store it in commandName, its there

    for
    > > > this
    > > > > > > purpose. Yeah these little bugs are hard to trace, try the

    numeric
    > > > > buttons
    > > > > > > and see if you still have the same problem.
    > > > > > > "ton" <> wrote in message
    > > > > > > news:c12nh0$daa$1.nb.home.nl...
    > > > > > > > dim but as Button
    > > > > > > >
    > > > > > > > but = CType(e.CommandSource, Button) ''.CommandName
    > > > > > > >
    > > > > > > > x.Text = "Xpage " + but.Text
    > > > > > > >
    > > > > > > > the but.text gives the text on the button which is the

    recordid.
    > > > > > > (Offcourse
    > > > > > > > I rather do not like to show the recordid, but for now it

    > works.)
    > > > > > > > Thanx,
    > > > > > > > Now the prev and it begins to look at a sophisticated control.
    > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > > > "Alessandro Zifiglio" <>
    > > > schreef
    > > > > > in
    > > > > > > > bericht news:235Zb.9187$...
    > > > > > > > > the onitemcommand is the right place for this. however try

    Try
    > :
    > > > > > > > > dim MyButton as string
    > > > > > > > > MyButton = CType(e.CommandSource, Button).CommandName
    > > > > > > > >
    > > > > > > > >
    > > > > > > > > Not sure where you are stuck, are you saying your unable to
    > > > retrieve
    > > > > > > what
    > > > > > > > > you stored in the buttons commandName, and commandArugment

    > > values
    > > > or
    > > > > > > your
    > > > > > > > > not able to get the cell where this button is located
    > > > > > > > >
    > > > > > > > > "ton" <> wrote in message
    > > > > > > > > news:c12li9$okk$1.nb.home.nl...
    > > > > > > > > > I will do what you suggest.
    > > > > > > > > >
    > > > > > > > > > In the mean time I'm trying to handle the event of the
    > > > > buttoncolumn.
    > > > > > I
    > > > > > > > > > receive the event, but I want to get the ID of the row:
    > > > > > > > > >
    > > > > > > > > > col = New ButtonColumn '' BoundColumn
    > > > > > > > > >
    > > > > > > > > > col.HeaderText = "ID"
    > > > > > > > > >
    > > > > > > > > > col.DataTextField = "ID"
    > > > > > > > > >
    > > > > > > > > > col.ButtonType = ButtonColumnType.PushButton
    > > > > > > > > >
    > > > > > > > > > col.HeaderStyle.Wrap = False
    > > > > > > > > >
    > > > > > > > > > col.CommandName = "Card"
    > > > > > > > > >
    > > > > > > > > > Datagrid.Columns.Add(col)
    > > > > > > > > >
    > > > > > > > > > AddHandler Datagrid.ItemCommand, AddressOf Me.DataGridCard
    > > > > > > > > >
    > > > > > > > > > ----
    > > > > > > > > > the datagridcard procedure
    > > > > > > > > > Private Sub DataGridCard(ByVal sender As Object, ByVal e

    As
    > > > > > > > > > System.Web.UI.WebControls.DataGridCommandEventArgs)
    > > > > > > > > >
    > > > > > > > > > Dim datagrid As DataGrid, x As Label
    > > > > > > > > >
    > > > > > > > > > datagrid = CType(sender, DataGrid)
    > > > > > > > > >
    > > > > > > > > > x = FindControl("X")
    > > > > > > > > >
    > > > > > > > > > datagrid.EditItemIndex = e.Item.ItemIndex
    > > > > > > > > >
    > > > > > > > > > x.Text = "Xpage " + CStr(e.CommandName) + " " &

    > > e.Item.ItemIndex
    > > > &
    > > > > > > > > > e.CommandArgument ''DataItem
    > > > > > > > > >
    > > > > > > > > > datagrid.DataBind()
    > > > > > > > > >
    > > > > > > > > > End Sub
    > > > > > > > > >
    > > > > > > > > > Since the buttoncolumn displays the recordnumber I want to

    > get
    > > > > that
    > > > > > > ID.
    > > > > > > > > With
    > > > > > > > > > that ID i can call my dialog to edit the cardrecord.
    > > > > > > > > > How do I get there. The datagrid.edititemindex only

    modifies
    > > the
    > > > > way
    > > > > > > the
    > > > > > > > > > record is shown (an you may edit it), buto that's not what

    I
    > > > want
    > > > > to
    > > > > > > do,
    > > > > > > > > > Thanks
    > > > > > > > > >
    > > > > > > > > > Ton
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > > "Alessandro Zifiglio"

    > <>
    > > > > > schreef
    > > > > > > > in
    > > > > > > > > > bericht news:rK3Zb.9099$...
    > > > > > > > > > > This last one is probably a bug in your application. I

    > > suggest
    > > > > you
    > > > > > > try
    > > > > > > > > and
    > > > > > > > > > > run in debug mode again and step through this line by

    line
    > > and
    > > > > see
    > > > > > > the
    > > > > > > > > > > execution of your code and what happens as you hit the

    > next
    > > or
    > > > > > > > previous
    > > > > > > > > > > buttons.
    > > > > > > > > > >
    > > > > > > > > > > The previous button should be able to go all the way to

    > the
    > > > > first
    > > > > > > page
    > > > > > > > > and
    > > > > > > > > > > then stay disabled if its the first page, and the next

    > > button
    > > > > > should
    > > > > > > > be
    > > > > > > > > > able
    > > > > > > > > > > to go to the last record and then disable on the last.

    > Try
    > > > and
    > > > > > use
    > > > > > > > > > numbered
    > > > > > > > > > > links and see if your getting the same behavior whereas

    to
    > > > > > > > next-previous
    > > > > > > > > > > links. That is set pager mode to NumericPages whereas to
    > > > > NextPrev.
    > > > > > > > > > >
    > > > > > > > > > > From your previous posts i've noted that you are doing

    > this
    > > > > > > correctly
    > > > > > > > > and
    > > > > > > > > > > are also using the OnPageIndexChanged method correctly,

    so
    > > > > surely
    > > > > > > you
    > > > > > > > > have
    > > > > > > > > > a
    > > > > > > > > > > small bug in your code.
    > > > > > > > > > >
    > > > > > > > > > > "Alessandro Zifiglio"

    > > <>
    > > > > > wrote
    > > > > > > > in
    > > > > > > > > > > message news:XB3Zb.9094$...
    > > > > > > > > > > > almost forgot, for the width do :
    > > > > > > > > > > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
    > > > > > > > > > > > "Alessandro Zifiglio"
    > > > <>
    > > > > > > wrote
    > > > > > > > > in
    > > > > > > > > > > > message news:Xw3Zb.9092$...
    > > > > > > > > > > > > boundcolumn1.ItemStyle.Wrap = True
    > > > > > > > > > > > > sets wrapping for all item cells of the column
    > > > > > > > > > > > >
    > > > > > > > > > > > > "ton" <> wrote in message
    > > > > > > > > > > > > news:c12f6j$ubd$1.nb.home.nl...
    > > > > > > > > > > > > > I add a Buttoncolumn, allthough I rather add a

    > button
    > > > with
    > > > > a
    > > > > > > > text
    > > > > > > > > on
    > > > > > > > > > > it.
    > > > > > > > > > > > > > This column is bound to the dataset. And for the

    > other
    > > > > > columns
    > > > > > > I
    > > > > > > > > add
    > > > > > > > > > > > > > Boundcolumns, but the do not look good.
    > > > > > > > > > > > > > Text is wrapped up (several lines) and I cannot

    set
    > > the
    > > > > with
    > > > > > > of
    > > > > > > > a
    > > > > > > > > > > > column.
    > > > > > > > > > > > > >
    > > > > > > > > > > > > > Do you have any suggestions (and/or additional

    > > reading)
    > > > > > > > > > > > > >
    > > > > > > > > > > > > > Thanks
    > > > > > > > > > > > > > "Alessandro Zifiglio"
    > > > > > <>
    > > > > > > > > > schreef
    > > > > > > > > > > > in
    > > > > > > > > > > > > > bericht

    > news:NB2Zb.9070$...
    > > > > > > > > > > > > > > are you adding a boundColumn at runtime ?
    > > > > > > > > > > > > > > What exactly is the control you are adding at

    > > runtime.
    > > > > If
    > > > > > > its
    > > > > > > > a
    > > > > > > > > > > > > > BoundColumn,
    > > > > > > > > > > > > > > it already exposes various header/item/footer

    > style
    > > > > > > properties
    > > > > > > > > > which
    > > > > > > > > > > > you
    > > > > > > > > > > > > > can
    > > > > > > > > > > > > > > use for formatting . .look in the BoundColumn

    > > Members
    > > > > > > section
    > > > > > > > > > > > > > >
    > > > > > > > > > > > > > > "ton" <> wrote in message
    > > > > > > > > > > > > > > news:c0vvff$4bk$1.nb.home.nl...
    > > > > > > > > > > > > > > > Hi,
    > > > > > > > > > > > > > > > How can I format (width, wordwrap) of a during
    > > > runtime
    > > > > > > added
    > > > > > > > > > > > > > boundcontrol
    > > > > > > > > > > > > > > > Ton
    > > > > > > > > > > > > > > >
    > > > > > > > > > > > > > > >
    > > > > > > > > > > > > > >
    > > > > > > > > > > > > > >
    > > > > > > > > > > > > >
    > > > > > > > > > > > > >
    > > > > > > > > > > > >
    > > > > > > > > > > > >
    > > > > > > > > > > >
    > > > > > > > > > > >
    > > > > > > > > > >
    > > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > >
    > > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    ton, Feb 19, 2004
    #20
    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. J.B
    Replies:
    1
    Views:
    2,591
    Natty Gur
    Oct 23, 2003
  2. helpful sql
    Replies:
    0
    Views:
    819
    helpful sql
    May 19, 2005
  3. Andy
    Replies:
    0
    Views:
    350
  4. rob thomson
    Replies:
    0
    Views:
    264
    rob thomson
    Sep 4, 2003
  5. ton
    Replies:
    2
    Views:
    207
    Alvin Bruney [MVP]
    Feb 11, 2004
Loading...

Share This Page