Chase Florell
Top achievements
Rank 1
Chase Florell
asked on 14 Mar 2010, 01:50 AM
I'm using the Efficient Paging method shown in your demos, and it works great. I'm able to page through thousands of records far faster than before.
I'm trying to make it even faster by adding efficient NestedViewTemplate expansion. What I'd like to do (but not sure how) is ONLY select the data that I use in my GridView on my initial call, and then when I expand a NestedViewTemplate, I'd like to make another DB call to get the details... what is the best way to do this?
I'm trying to make it even faster by adding efficient NestedViewTemplate expansion. What I'd like to do (but not sure how) is ONLY select the data that I use in my GridView on my initial call, and then when I expand a NestedViewTemplate, I'd like to make another DB call to get the details... what is the best way to do this?
2 Answers, 1 is accepted
0
Chase Florell
Top achievements
Rank 1
answered on 14 Mar 2010, 03:48 AM
I think I figured out the answer, can anyone confirm or deny if this is correct?
| <NestedViewTemplate> |
| <asp:HiddenField runat="server" ID="HiddenID" Value='<%#DataBinder.Eval(Container.DataItem, "ID")%>' /> |
| <asp:LinqDataSource ID="LinqDataSource1" runat="server" OnSelecting="LinqDataSource_Selecting"> |
| <WhereParameters> |
| <asp:ControlParameter ControlID="HiddenID" PropertyName="Value" Type="String" Name="ID" /> |
| </WhereParameters> |
| </asp:LinqDataSource> |
| <asp:FormView ID="FormView1" runat="server" DataSourceID="LinqDataSource1"> |
| <ItemTemplate> |
| <fieldset> |
| <legend style="font-size: 14px; font-weight: bolder;">Error Details</legend> |
| <table> |
| <tr style="background-color: #f2f2f2"> |
| <td style="white-space: nowrap;"> |
| Error URL: |
| </td> |
| <td style="width: 100%;"> |
| <%#DataBinder.Eval(Container.DataItem, "errURL")%> |
| </td> |
| </tr> |
| <tr> |
| <td style="white-space: nowrap;"> |
| Error Source: |
| </td> |
| <td> |
| <%#DataBinder.Eval(Container.DataItem, "errSource")%> |
| </td> |
| </tr> |
| <tr style="background-color: #f2f2f2"> |
| <td style="white-space: nowrap;"> |
| Exception: |
| </td> |
| <td> |
| <%#DataBinder.Eval(Container.DataItem, "errEx")%> |
| </td> |
| </tr> |
| <tr> |
| <td style="white-space: nowrap;"> |
| Stack Trace: |
| </td> |
| <td> |
| <%#DataBinder.Eval(Container.DataItem, "errStack")%> |
| </td> |
| </tr> |
| <tr style="background-color: #f2f2f2"> |
| <td style="white-space: nowrap;"> |
| Additional Notes: |
| </td> |
| <td> |
| <%#DataBinder.Eval(Container.DataItem, "errNotes")%> |
| </td> |
| </tr> |
| </table> |
| </fieldset> |
| <fieldset> |
| <legend style="font-size: 14px; font-weight: bolder;">User Details</legend> |
| <table> |
| <tr> |
| <td style="white-space: nowrap;"> |
| User Name: |
| </td> |
| <td style="width: 100%;"> |
| <%#DataBinder.Eval(Container.DataItem, "errUser")%> |
| </td> |
| </tr> |
| <tr style="background-color: #f2f2f2"> |
| <td style="white-space: nowrap;"> |
| User IP Address: |
| </td> |
| <td> |
| <%#DataBinder.Eval(Container.DataItem, "errIP")%> |
| </td> |
| </tr> |
| <tr> |
| <td style="white-space: nowrap;"> |
| User Browser: |
| </td> |
| <td> |
| <%#DataBinder.Eval(Container.DataItem, "errBrowser")%> |
| </td> |
| </tr> |
| <tr style="background-color: #f2f2f2"> |
| <td style="white-space: nowrap;"> |
| User Operating System: |
| </td> |
| <td> |
| <%#DataBinder.Eval(Container.DataItem, "errOS")%> |
| </td> |
| </tr> |
| </table> |
| </fieldset> |
| </ItemTemplate> |
| </asp:FormView> |
| <div style="height: 20px;"> |
| </div> |
| </NestedViewTemplate> |
| Protected Sub LinqDataSource_Selecting(ByVal sender As Object, ByVal e As LinqDataSourceSelectEventArgs) |
| Dim hdc As New DAL.HealthMonitorDataContext() |
| e.Result = hdc.bt_HealthMonitor_GetByID(Integer.Parse(e.WhereParameters("ID"))) |
| End Sub |
0
Hi Chase,
I checked your code I cannot find anything disturbing there.
If it works as desired you can proceed using the above approach.
I hope this helps.
Kind regards,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I checked your code I cannot find anything disturbing there.
If it works as desired you can proceed using the above approach.
I hope this helps.
Kind regards,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.