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

GridBinaryImageColumn in RadGrid FormTemplate

1 Answer 151 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Zahra asked on 07 Jun 2010, 01:21 AM

I'm having a problem with using GridBinaryImageColumn in  RadGrid. I want to customize my Insert/Edit form by using <EditFormSettings EditFormType="Template">and <FormTemplate>. But the problem is I can not access the GridBinaryImageColumn in the form template as other RadGrid elements. The GridBinaryImageColumnWhat auto generates the upload button.

Below is the code that I have:

<telerik:RadGrid runat="server" ID="RadGrid_Exercises" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" ShowStatusBar="True" GridLines="None"
            OnNeedDataSource="RadGrid_Exercises_NeedDataSource" OnUpdateCommand="RadGrid_Exercises_UpdateCommand"
            OnDeleteCommand="RadGrid_Exercises_DeleteCommand" OnInsertCommand="RadGrid_Exercises_InsertCommand">

<PagerStyle Mode="NumericPages" AlwaysVisible="true" />
            <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="Id">
              <telerik:GridEditCommandColumn ButtonType="ImageButton">
                        <HeaderStyle Width="3%" />
               <telerik:GridBoundColumn DataField="Id" DataType="System.Int16" HeaderText="Id" ReadOnly="True"
                        SortExpression="Id" UniqueName="Id" Visible="false">
                <telerik:GridBoundColumn  DataField="Name"  HeaderText="Name" UniqueName="Name" >
                <telerik:GridBinaryImageColumn DataField="HowToImage1" HeaderText="HowToImage1" ResizeMode="Fit"
                            UniqueName="HowToImage1" ImageWidth="180px" ImageHeight="180px" />
               <EditFormSettings EditFormType="Template">
                     <asp:Label runat="server" ID="NameLBL" Text="Name" ></asp:Label>
                     <telerik:RadTextBox ID="NameRTB" runat="server" Text='<%# Bind("Name") %>' Skin="WebBlue" MaxLength="30">

<<<<Here I need to define the layout of the Image upload>>>>>>


Actually the code is very long and I'm using tables but I just made it short to show my problem.

Could you please tell my how I can use a BinaryImage in FormTemplate??


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 09 Jun 2010, 11:26 AM
Hello Zahra,

When you are using custom template as RadGrid editform you are in charge to provide the control which will compose it. Therefore you should manually add RadUpload control to the template and hook the logic in order to extract its value. More info on how to use EditFormTemplate can be found here.

Sincerely yours,
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question