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

Grid Column data Bind

1 Answer 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mostafa
Top achievements
Rank 1
Mostafa asked on 21 Mar 2016, 01:17 PM

Hi
i have a grid and in that Grid i have a column name 'Result' which Show data like 6-5,10-11 etc
i have two way to make that 
1. select Set1 ,Set2   from table1

and then in grid 
 <telerik:GridTemplateColumn >
<ItemTemplate>
 <%# Eval("Set1")+" -"+Eval("Set2") +","+'<sup>'+Eval("Set1")+'</sup>'+" -"+Eval("Set2") %>
</ItemTemplate>
</telerik:GridTemplateColumn >

2. i can return a field named 'result' from my data query store procedure like '(select ISNULL(CAST( Set1 as nvarchar(5)),'') +''+ ISNULL('-'+CAST(Set2 as nvarchar(5))+''+ISNULL('<sup>'+CAST(Set3 as nvarchar(5))+'</sup>','')'')  as result  from table1' which give me 6-5,10-11

and in grid 
<telerik:GridBoundColumn UniqueName="Result" DataField="result" > </telerik:GridBoundColumn>


my Question is which one is better if the total number of set is 15.and number of row in result set more then 100

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 24 Mar 2016, 11:47 AM
Hi Mostafa,

Adding the data directly to the DataSource of the grid would be faster, because no calculations will be performed while the ItemTemplate is being created. However, at the end it is up to the developer to choose the approach that best fits the requirement.

On a side note, you could take a look at the GridCalculatedColumn, which could be used for displaying calculated data:
Hope this helps.


Regards,
Konstantin Dikov
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Mostafa
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or