3 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 26 Mar 2009, 04:51 AM
Hi Derek,
Try any one of the following approach and see whether it helps.
CS:
or
Shinu
Try any one of the following approach and see whether it helps.
CS:
protected void RadGrid1_PreRender(object sender, EventArgs e) |
{ |
GridButtonColumn btncol = (GridButtonColumn)RadGrid1.MasterTableView.GetColumn("AutoGeneratedDeleteColumn"); |
btncol.ButtonType = GridButtonColumnType.ImageButton; |
btncol.ImageUrl = "~/Images/Delete.gif"; |
RadGrid1.MasterTableView.Rebind(); |
} |
or
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) |
{ |
if (e.Column.UniqueName == "AutoGeneratedDeleteColumn") |
{ |
(e.Column as GridButtonColumn).ButtonType = GridButtonColumnType.ImageButton; |
(e.Column as GridButtonColumn).ImageUrl = "~/Images/Delete.gif"; |
} |
} |
Shinu
0
derek
Top achievements
Rank 2
answered on 26 Mar 2009, 03:33 PM
AWESOME, thank you so much. I tried adding an image for the update column like this:
But the Edit link still shows.
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) |
{ |
if (e.Column.UniqueName == "AutoGeneratedDeleteColumn") |
{ |
(e.Column as GridButtonColumn).ConfirmText = "Are you Sure you want to delete this record? Did you ask Bryan?"; |
(e.Column as GridButtonColumn).ButtonType = GridButtonColumnType.ImageButton; |
(e.Column as GridButtonColumn).ImageUrl = "~/NewFolder1/delete.gif"; |
} |
if (e.Column.UniqueName == "AutoGeneratedUpdateColumn") |
{ |
(e.Column as GridButtonColumn).ButtonType = GridButtonColumnType.ImageButton; |
(e.Column as GridButtonColumn).ImageUrl = "~/NewFolder1/update.gif"; |
} |
But the Edit link still shows.
0
derek
Top achievements
Rank 2
answered on 26 Mar 2009, 03:49 PM
So I also tried this:
But then after I publish it, I get an error of "Object reference not set to an instance of an object."
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) |
{ |
if (e.Column.UniqueName == "AutoGeneratedDeleteColumn") |
{ |
(e.Column as GridButtonColumn).ConfirmText = "Are you Sure you want to delete this record? Did you ask Bryan?"; |
(e.Column as GridButtonColumn).ButtonType = GridButtonColumnType.ImageButton; |
(e.Column as GridButtonColumn).ImageUrl = "~/NewFolder1/delete.gif"; |
} |
if (e.Column.UniqueName == "AutoGeneratedEditColumn") |
{ |
(e.Column as GridButtonColumn).ButtonType = GridButtonColumnType.ImageButton; |
(e.Column as GridButtonColumn).ImageUrl = "~/NewFolder1/update.gif"; |
} |
But then after I publish it, I get an error of "Object reference not set to an instance of an object."