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