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

Itemtemplate at GridColumn??

2 Answers 151 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Just64
Top achievements
Rank 1
Just64 asked on 28 Jun 2012, 10:16 PM
ASPX:

<telerik:GridTemplateColumn
                                           HeaderText="Product No."
                                           UniqueName="lnkproductnumber"
                                           DataType="System.String"-
                                           SortExpression="vchproductno"
                                           DataField="vchproductno"
                                           ReadOnly="true"
                                           ShowFilterIcon="false"
                                           CurrentFilterFunction="Contains"
                                           AutoPostBackOnFilter="true">
                                            
                                           <ItemTemplate>
                                               <asp:LinkButton
                                                   ID="lnkProdNo"
                                                   runat="server"
                                                   Text='<%# Eval( "vchproductno" ) %>'
                                                   Font-Bold="true"
                                                   OnCommand="GetProductDetail"
                                                   CommandName='<%# Eval( "vchproductno" ) %>' 
                                                   CommandArgument='<%# Eval( "intproductid" ) %>'>
                                               </asp:LinkButton>
                                           </ItemTemplate>
                                            
                                           </EditItemTemplate>
                                           <HeaderStyle Width="100px" />
                                           <ItemStyle Width="100px" />
                                       </telerik:GridTemplateColumn>



And im getting this error:

Parser Error Message: Telerik.Web.UI.GridColumnCollection must have items of type 'Telerik.Web.UI.GridColumn'. 'ItemTemplate' is of type 'System.Web.UI.HtmlControls.HtmlGenericControl'.

Telerik.Web.Ui Version=2012.1.215.40

Any idea?

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 29 Jun 2012, 04:48 AM
Hi,

Please remove the '-' from the code(DataType="System.String"-) and check.

ASPX:
<telerik:GridTemplateColumn  HeaderText="Product No."  UniqueName="lnkproductnumber"  DataType="System.String"  SortExpression="vchproductno"
DataField="vchproductno"  ReadOnly="true"  ShowFilterIcon="false"  CurrentFilterFunction="Contains"  AutoPostBackOnFilter="true">
   <ItemTemplate>
     <asp:LinkButton ID="lnkProdNo" runat="server" Text='<%# Eval( "vchproductno" ) %>' Font-Bold="true" OnCommand="GetProductDetail"
     CommandName='<%# Eval( "vchproductno" ) %>'  CommandArgument='<%# Eval( "intproductid" ) %>'> </asp:LinkButton>
   </ItemTemplate>
   <HeaderStyle Width="100px" />
   <ItemStyle Width="100px" />
</telerik:GridTemplateColumn>

Thanks,
Princy.
0
Just64
Top achievements
Rank 1
answered on 11 Jul 2012, 03:07 PM
U save me lots of time, ty!
Tags
Grid
Asked by
Just64
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Just64
Top achievements
Rank 1
Share this question
or