I have a radGrid that is not kicking off the delete method when using an ImageButton, the LinkButton and PushButton work fine..
I have tried creating the column manually and also auto generating with code on columncreate that changes it to an imagebutton and neither work. Please help.
I have tried creating the column manually and also auto generating with code on columncreate that changes it to an imagebutton and neither work. Please help.
| <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" |
| AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" |
| GridLines="None" ShowGroupPanel="True" Skin="WebBlue" |
| ondeletecommand="RadGrid1_DeleteCommand" AutoGenerateDeleteColumn="True" |
| oncolumncreated="RadGrid1_ColumnCreated1" > |
| <HeaderContextMenu> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </HeaderContextMenu> |
| <MasterTableView> |
| <Columns> |
| <telerik:GridHyperLinkColumn DataNavigateUrlFields="FilePath" |
| DataTextField="FileName" HeaderText="Attachments" UniqueName="column2"> |
| </telerik:GridHyperLinkColumn> |
| <telerik:GridBoundColumn DataField="AttachType" HeaderText="Attachment Type" |
| UniqueName="column1"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings AllowDragToGroup="True"> |
| </ClientSettings> |
| <FilterMenu> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </FilterMenu> |
| <PagerStyle NextPageText="Next" PrevPageText="Prev" Mode="NextPrevAndNumeric"> |
| </PagerStyle> |
| protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e) |
| { |
| blSharePoint spFiles = new blSharePoint(spPath); |
| GridDataItem filePath = (GridDataItem)e.Item; |
| HyperLink test = (HyperLink)filePath["column2"].Controls[0]; |
| spFiles.DeleteDocFromProposalFolder(test.NavigateUrl.ToString()); |
| RadGrid1.DataSource = spFiles.ListFileCollectionFromProposalFolder(CurrentLocation, "Proposal Documents", CurrentProposalNumber, "Attachment Type"); |
| RadGrid1.DataBind(); |
| } |
| protected void RadGrid1_ColumnCreated1(object sender, GridColumnCreatedEventArgs e) |
| { |
| if (e.Column.UniqueName == "AutoGeneratedDeleteColumn") |
| { |
| GridButtonColumn btncol = (GridButtonColumn)e.Column; |
| btncol.ButtonType = GridButtonColumnType.ImageButton; |
| } |
| } |