Steph
I just ran across your message .....
this message will NOT help you but I wanted to fyi you that
I am trying the same thing (using VB i.e. AddHandler ) and have hit the same
problem ...
additionally, (you'll have to take my word for it)
(a) I own just about ALL the asp.net books out there ....
(I don't read books - I read topics)
(b) Not one of them - (unless I missed it) attempts this ....
(Waltham and Payne are two of the better books out there - if
your goal is to crank up to asp.net )
(c) The standout book (my dumb ass two cents) about GridControls
is Scott Mitchell's - but he does not really pursue the idea of setting ALL
properties, controls, etc. from a CodeBehindPage i.e. his focus
is elsewhere .....
(d) I have spent many hours searching this on google - and cannot
find an example in which this is your HTML page
---------------------
HTML Page
---------------------
<ASP:DATAGRID
id="dg1"
runat="server">
</ASP:DATAGRID>
and everything else happens on the CodeBehindPage ....
(e) which leads me to think .... I am conceptually missing
the *big picture* and just perhaps should accept the idea
that the 5 types of buttons must be initiated in the HTML page ...
If you do find a solution to capturing the Click Event .....
please give me a YELL ...
regards,
John McCarthy
[quoted text, click to view] "Steph" <st@nospam> wrote in message
news:upOLevs1EHA.3504@TK2MSFTNGP12.phx.gbl...
> Hello,
>
> I have a datagrid dgGrid and want add column depending of a context. I am
> usin this following code :
>
> ...
> while (Clcpt<7)
> {
> ButtonColumn myCol = new ButtonColumn();
> myCol.HeaderText = Clcpt.ToString();
> myCol.ButtonType = ButtonColumnType.LinkButton;
> myCol.Text = "<img src='images/Add.gif' border=0>";
> myCol.CommandName = "cmd"+Clcpt;
> Response.Write("cmd"+Clcpt+"/");
> dgGrid.Columns.Add(myCol);
> Clcpt++;
> }
> ..
> Cols are ok but I can't intercept the clik on the button. I have an event
> handler dgDrid_ItemCommand but it is never fired ?
>
> Any idea ?
>
> thanks
>