This is a migrated thread and some comments may be shown as answers.

Delete column image

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jocelyn
Top achievements
Rank 1
Jocelyn asked on 17 Jul 2012, 01:13 PM
Hi, 

Since 2012.2.607.35 my delete column imageurl is not showing my custom image anymore. It is showing the Telerik default one.

I didn't change anything in my code.

ASPX:
<telerik:RadGrid ID="gridAllergies" runat="server" CellSpacing="0" GridLines="None">
            <ClientSettings>
                <Selecting CellSelectionMode="None"></Selecting>
            </ClientSettings>
            <MasterTableView CommandItemDisplay="Top">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column"
                        ButtonType="ImageButton" EditText="Modifier" Resizable="False" EditImageUrl="Images/Icons/006-Write-New-Icon.png"
                        UniqueName="colEdit">
                        <HeaderStyle Width="32px"></HeaderStyle>
                        <ItemStyle Width="32px" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn CommandName="Delete"
                        FilterControlAltText="Filter column column" Text="Supprimer" UniqueName="colDelete"
                        ButtonType="ImageButton" ImageUrl="Images/Icons/059-Close-Delete-circle-Icon.png"
                        ConfirmDialogType="Classic">
                        <HeaderStyle Width="32px"></HeaderStyle>
                        <ItemStyle Width="32px" />
                    </telerik:GridButtonColumn>
                    <telerik:GridBoundColumn DataField="palg_noauto" FilterControlAltText="Filter column1 column"
                        UniqueName="colNoAuto" Visible="False" ReadOnly="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="allergie" FilterControlAltText="Filter column2 column"
                        UniqueName="colAllergie" CurrentFilterFunction="StartsWith" FilterDelay="1500"
                        ShowFilterIcon="false" ReadOnly="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="isGroupe" DataType="System.Boolean" FilterControlAltText="Filter column column"
                        ReadOnly="True" UniqueName="colIsGroupe" ShowFilterIcon="false" AllowFiltering="False">
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center" Width="64px" />
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridDateTimeColumn DataField="Date" FilterControlAltText="Filter column3 column"
                        UniqueName="colDate" CurrentFilterFunction="StartsWith" FilterDelay="1500" ShowFilterIcon="false"
                        DataType="System.String" EditFormHeaderTextFormat="">
                    </telerik:GridDateTimeColumn>
                    <telerik:GridDropDownColumn FilterControlAltText="Filter column8 column" UniqueName="colGenerique"
                        ListValueField="gene_numero" ListTextField="gene_nom" ShowFilterIcon="False"
                        Visible="False" DropDownControlType="RadComboBox" DataField="gene_numero">
                    </telerik:GridDropDownColumn>
                    <telerik:GridDropDownColumn FilterControlAltText="Filter column7 column" UniqueName="colGroupeDesc"
                        ListValueField="gral_numero" ListTextField="gral_description" ShowFilterIcon="False"
                        Visible="False" DropDownControlType="RadComboBox" DataField="gral_numero">
                    </telerik:GridDropDownColumn>
                    <telerik:GridBoundColumn DataField="palg_texte_1" FilterControlAltText="Filter column4 column"
                        UniqueName="colTexte1" CurrentFilterFunction="StartsWith" FilterDelay="1500"
                        ShowFilterIcon="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="palg_texte_2" FilterControlAltText="Filter column5 column"
                        UniqueName="colTexte2" CurrentFilterFunction="StartsWith" FilterDelay="1500"
                        ShowFilterIcon="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="isImprime" FilterControlAltText="Filter colImprimer column"
                        UniqueName="colImprimer" Visible="False">
                    </telerik:GridCheckBoxColumn>
                </Columns>
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="allergie" SortOrder="Ascending" />
                </SortExpressions>
                <EditFormSettings>
                    <EditColumn ButtonType="PushButton" CancelText="Annuler" UpdateText="Enregistrer"
                        InsertText="Ajouter" FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <EditItemStyle BackColor="Silver" />
        </telerik:RadGrid>

Thanks.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Jul 2012, 01:27 PM
Hello,

With reference to this forum thread, this is a known issue. Here is the work around.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
  {
      if (e.Item is GridDataItem)
      {
          GridDataItem item=(GridDataItem)e.Item;
          ImageButton img = (ImageButton)item["UniqueName"].Controls[0];
          img.ImageUrl = "Images/image.gif";
      }
  }

Thanks,
Shinu.

Tags
Grid
Asked by
Jocelyn
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or