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

Use of Eval()

2 Answers 285 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 2
Andy Green asked on 22 Jul 2013, 11:37 AM
Hi

In all your example you use the Eval or Bind. I have just seen this article on why not to use Eval().

http://www.codeproject.com/Articles/623516/The-evil-of-Eval-in-ASP-NET

How would you bind data without using Eval or Bind.

Andy

2 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 25 Jul 2013, 07:26 AM
Hello,

In most of the articles of that subject is explained how you could replace the call to the DataBinder.Eval and Eval calls. The common scenario is to use the Container.DataItem property and cast it to the specific for your case type. For example:

<telerik:GridTemplateColumn FilterControlAltText="Filter EditCommandColumn column" UniqueName="EditCommandColumn" HeaderStyle-Width="100px" ItemStyle-Width="100px" AllowFiltering="False" Groupable="False" DataField="City">
    <ItemTemplate>
        <%# ((System.Data.DataRowView)Container.DataItem)["City"] %>           
    </ItemTemplate>
</telerik:GridTemplateColumn>

Regards,
Andrey
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Andy Green
Top achievements
Rank 2
answered on 25 Jul 2013, 02:07 PM
Excellent Thank you

Andy
Tags
General Discussions
Asked by
Andy Green
Top achievements
Rank 2
Answers by
Andrey
Telerik team
Andy Green
Top achievements
Rank 2
Share this question
or