WebGrid's NewRow not displaying CellTemplate

17 replies. Last post: September 22, 2010 5:58 AM by Niven Prasetya
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Shawn AugustMember

I have a button that simply adds a new row to a WebGrid and defaults some data. However, I noticed that a CellTemplate column that has an Image isn't being displayed. This renders as expected for every row that is bound to the grid just not any new row added via Client Side.  I tried with a Button too and that also didn't render.

 I also tried using the Grid's InitializeLayout to set this column programatically using a custom class and the ITemplate interface (InstantiateIn method) but it had the same problem.

        <ISWebGrid:WebGridColumn Caption=" "                        Name="AddPortfolio"         DataMember=""                                            HiddenDataMember="ScenarioPortfolioID" 
                                 DataType="System.String"           ColumnType="Template"       EditType="NoEdit"        NewRowEditType="SameAsEditType" FilterEditType="NoEdit"        Width="65px" 
                                 ButtonText="Add Portfolio">
            <ButtonStyle BackColor="AliceBlue">
                <Padding Top="2px" Left="1px" Right="1px" Bottom="1px" />
            </ButtonStyle>
            <CellTemplate>
                <img runat="server" id="imgPortfolio" src="~/Images/Buttons/process_off.gif" alt="Manage this treaty's portfolios"
                     border="0" style="padding-top: 1px;" 
                     onclick="javascript:UpdatePortfolioList();" onmouseout="javascript:MM_swapImgRestore()" onmouseover="javascript:MM_swapImage(this.id, '', '../Images/Buttons/process_on.gif',1)" />
            </CellTemplate>
        </ISWebGrid:WebGridColumn>
All times are GMT -5. The time now is 10:57 PM.
Previous Next