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" <alessandrozifiglio@NO-SPAM-hotmail.com> schreef in
bericht news:235Zb.9187$HO2.8969@news.edisontel.com...
> 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" <vrs@REMOVEhome.nl> wrote in message
> news:c12li9$okk$1@news2.tilbu1.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" <alessandrozifiglio@NO-SPAM-hotmail.com> schreef
in
> > bericht news:rK3Zb.9099$HO2.5245@news.edisontel.com...
> > > 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" <alessandrozifiglio@NO-SPAM-hotmail.com> wrote
in
> > > message news:XB3Zb.9094$HO2.5683@news.edisontel.com...
> > > > almost forgot, for the width do :
> > > > boundcolumn1.ItemStyle.Width = Unit.Pixel(100)
> > > > "Alessandro Zifiglio" <alessandrozifiglio@NO-SPAM-hotmail.com> wrote
> in
> > > > message news:Xw3Zb.9092$HO2.5026@news.edisontel.com...
> > > > > boundcolumn1.ItemStyle.Wrap = True
> > > > > sets wrapping for all item cells of the column
> > > > >
> > > > > "ton" <vrs@REMOVEhome.nl> wrote in message
> > > > > news:c12f6j$ubd$1@news2.tilbu1.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" <alessandrozifiglio@NO-SPAM-hotmail.com>
> > schreef
> > > > in
> > > > > > bericht news:NB2Zb.9070$HO2.8320@news.edisontel.com...
> > > > > > > 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" <vrs@REMOVEhome.nl> wrote in message
> > > > > > > news:c0vvff$4bk$1@news4.tilbu1.nb.home.nl...
> > > > > > > > Hi,
> > > > > > > > How can I format (width, wordwrap) of a during runtime added
> > > > > > boundcontrol
> > > > > > > > Ton
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>