Hello,
If need to create a 'delete column' programmatically due to authorization constraints ( I need to show or hide the column based on privilege) that prompts for delete but I would rather it say 'Delete client John Smith?' rather than 'Delete this client?' i.e. I would like to personalize it for each row. This is what I have now:
When using a declarative template column I could do an "Eval" to get the cuurent row on the databaind using a template column like so:
How would one create a dynamic ConfirmText when creating the column programatically?
Thanks
Jonathan
If need to create a 'delete column' programmatically due to authorization constraints ( I need to show or hide the column based on privilege) that prompts for delete but I would rather it say 'Delete client John Smith?' rather than 'Delete this client?' i.e. I would like to personalize it for each row. This is what I have now:
| if (((UserProfile)Session["_userProfile"]).IsAuthorized("Client - Delete")) |
| { |
| _buttonColumn = new GridButtonColumn(); |
| radGridClients.MasterTableView.Columns.Add(_buttonColumn); |
| _buttonColumn.ButtonType = GridButtonColumnType.ImageButton; |
| _buttonColumn.ConfirmDialogType = GridConfirmDialogType.Classic; |
| _buttonColumn.ConfirmText = "Delete this client?"; |
| _buttonColumn.HeaderText = "Delete"; |
| _buttonColumn.HeaderStyle.Width = 40; |
| _buttonColumn.CommandName = "Delete"; |
| _buttonColumn.ImageUrl = "./images/delete.gif"; |
| } |
When using a declarative template column I could do an "Eval" to get the cuurent row on the databaind using a template column like so:
| <telerik:GridTemplateColumn |
| UniqueName="TemplateDeleteColumn" |
| HeaderText="Delete" |
| HeaderStyle-Width="60" > |
| <ItemTemplate> |
| <asp:ImageButton ID="DeleteButton" OnClick='<%# Eval("NameLast2First", "return confirm(\"Delete all record of the Client {0} from the database?\");" ) %>' runat="server" ImageUrl="./images/delete.gif" CommandName="Delete" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
How would one create a dynamic ConfirmText when creating the column programatically?
Thanks
Jonathan
