Here is a portion of my code I am using. I have a RadGrid that I am adding columns to programmatically. If I the "removeCol" object as a LinkButton, the TemplateGrid.ItemCommand event fires. However, if I set the ButtonType to ImageButton, all the page does is PostBack.
Any suggestion???
protected void Page_Load(object sender, EventArgs e)
{
......
TemplateGrid.ItemCommand += TemplateGrid_ItemCommand;
TemplateGrid.NeedDataSource += TemplateGrid_NeedDataSource;
TemplateGrid.Rebind();
......
}
private void CreateGridColumns()
{
.....
GridButtonColumn removeCol = new GridButtonColumn();
TemplateGrid.MasterTableView.Columns.Add(removeCol);
removeCol.CommandName = RadGrid.DeleteCommandName;
removeCol.UniqueName = "DeleteColumn";
removeCol.ImageUrl = Presenter.ResourceService.GetImageUrl("toolbars", "delete_small.gif");
removeCol.ButtonType = GridButtonColumnType.ImageButton;
........
}
Any suggestion???
protected void Page_Load(object sender, EventArgs e)
{
......
TemplateGrid.ItemCommand += TemplateGrid_ItemCommand;
TemplateGrid.NeedDataSource += TemplateGrid_NeedDataSource;
TemplateGrid.Rebind();
......
}
private void CreateGridColumns()
{
.....
GridButtonColumn removeCol = new GridButtonColumn();
TemplateGrid.MasterTableView.Columns.Add(removeCol);
removeCol.CommandName = RadGrid.DeleteCommandName;
removeCol.UniqueName = "DeleteColumn";
removeCol.ImageUrl = Presenter.ResourceService.GetImageUrl("toolbars", "delete_small.gif");
removeCol.ButtonType = GridButtonColumnType.ImageButton;
........
}