Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > ButtonColumn info

Reply
Thread Tools

ButtonColumn info

 
 
Steph
Guest
Posts: n/a
 
      11-30-2004
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


 
Reply With Quote
 
 
 
 
John
Guest
Posts: n/a
 
      07-01-2005
You need an event handler:

In the code behind sorry for the C#

private void InitializeComponent()
{
this.RouteDataGrid.ItemCommand += new System.Web.UI.WebControls.DataGridCommandEventHand ler(this.RouteDataGrid_ItemCommand);
}

Hope this helps.

From http://www.developmentnow.com/g/12_2...olumn-info.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ButtonColumn postback problem =?Utf-8?B?Sm9obiBNY0RvbmFnaA==?= ASP .Net 0 03-06-2004 03:56 AM
ButtonColumn Roger ASP .Net 1 01-23-2004 03:54 AM
DataGrid ButtonColumn/BoundColumn problem John ASP .Net 3 11-03-2003 02:20 PM
Enabling/Disabling a DataGrid ButtonColumn CGuy ASP .Net 2 10-22-2003 05:43 PM
How to use ButtonColumn to select a Datagrid row? Northern ASP .Net 0 07-22-2003 08:34 PM



Advertisments