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$...
> 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$...
> > > > > 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$...
> > > > > > > Hi,
> > > > > > > How can I format (width, wordwrap) of a during runtime added
> > > > > boundcontrol
> > > > > > > Ton
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|