You have demonstrated how to do a dynamic ASPxGridView templated column create in the example at http://www.devexpress.com/Support/Center/e/E308.aspx
Also you have shown how to use a declarative <DataRow> template in your help at
http://documentation.devexpress.com/#AspNet/DevExpressWebASPxGridViewASPxGridView_Templatestopic
However what I am trying to accomplish, is loading a <DataRow> template dynamically at runtime where the end user supplies the data template, likely as raw html with perhaps keywords for data source elements.
Could you possibly provide a small code example of how to achieve this, (perhaps populating a "Literal" control within the template) and in particular show how items within the gridview datasource columns may be accessed from within the ITemplate implementation I suspect needs to be coded. Also its not clear to me where the new of the ITemplate instance is hooked up to the gridview for the DataRow template. I hope I'm being clear.
Any help would be greatly appreciated,
Thank You
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Frank,
Thank you for your question.
I have reviewed the How to create and configure a HyperLink column at runtime example and should note that ASPxGridView does not have any templates in this scenario. The GridViewDataHyperLinkColumn is created and customized at runtime to display necessary hyperlinks based on database data.
I suggest you examine the Custom client-side logic implementation in the grid with multi-row editing example where the ITemplate nested class is utilized. The example also demonstrates how to get row or column values. I believe you can easily accomplish your scenario using a similar approach. Let us know if you need additional assistance.
Best regards,
Vladimir
I'm sorry this isn't what I was looking for the example given was quite different from what I need, perhaps I'm not making myself clear enough.
If you look at the example displayed at http://documentation.devexpress.com/#AspNet/DevExpressWebASPxGridViewASPxGridView_Templatestopic
All I want to be able to do is dynamically (at runtime) be able to replace the <table>…</table> data with a template that has been supplied by an end user, and it may differ from user top user. The <DataRow> template not the column templates. Hope this helps :-)
Frank
I am wondering whether an approach similar to that described in the ASPXDataView control template would also work in a similar manner with the ASPXxGridView control to accomplish what I am trying to do?
Like in http://www.devexpress.com/example=E1433
Hi Frank,
I am afraid we do not have an example in our Knowledge Base that suits your requirements fully. However, I suggest that you try the following samples illustrating how to creates controls at runtime:
How to create a master-detail grid at runtime
How to create a DataItem template for a grid column at runtime
ASPxGridView DataRowTemplate Value at Runtime
You can get this code and then use it in your application.
Thanks,
Marion