Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
270
Format input on a RowEditTemplate
posted

How do I format a read only input element on my RowEditTemplate?  Its bound to a columnKey of type DateTime type and I do not like the default formatting which is being applied to the field when the RowEditTemplate is displayed.

Parents
No Data
Reply
  • 19308
    Verified Answer
    posted

    I'm not sure whether you're looking to format the string, or format the appearance.  I'm going to guess the string, since the appearance can be easily changed using a little CSS.

    The WebGrid will simply copy the cell value into the edit template.  You can use the client-side events fired by the grid, for example AfterRowEditTemplateOpen

    From this event, you can access the read only input element and change the text-value to anything you want. 

    For a complete example of manually controlling the RowEditTemplate data fields, take a look at the PortfolioManager sample.  The grid on the  "Client" tab does manual manipulations of the RowEditTemplate.  The source is included with the samples download (packaged up with the product download).

Children
No Data