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

GridBinaryImageColumn in RadGrid FormTemplate

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

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"
            OnItemCommand="RadGrid_Exercises_OnItemCommand"
            OnDeleteCommand="RadGrid_Exercises_DeleteCommand" OnInsertCommand="RadGrid_Exercises_InsertCommand">

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


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


               </FormTemplate>
         </EditFormSettings>
   </MasterTableView>
</telerik:RadGrid>


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??

Thanks.




1 Answer, 1 is accepted

Sort by
0
Rosen
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,
Rosen
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.
Tags
BinaryImage
Asked by
Zahra
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or