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

Not answered In RadGrid Nest a RadChart

1 Answer 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
yang
Top achievements
Rank 1
yang asked on 26 Mar 2012, 02:26 AM
Hi Telerik:

This is a question perplex me.
In RadGrid,Nest a RadChart,Of course ,that data bind to radGrid.
There are two kind of think. 
        First : Through data of  radGrid takes datasource to radChart. This think source think of silverlight.
        Second: Through keyColumn of  radGrid ,Execute StoredProcedure with parameter to bind radChart. Why needing execute StoredProcedure ,Because I must process some things. The SqlDataSource seem to can't to execute  StoredProcedure with parameter.

I try to two ways,but fail.I  distressed.
So I please admin help me trying to use second way. Give me some example.
The sourcecode here:


<telerik:RadGrid AutoGenerateColumns="False" ID="RadGridFHData"
                AllowFilteringByColumn="True" AllowPaging="True"
                AllowSorting="True" runat="server" ShowGroupPanel="true"
            onitemcommand="RadGridFHData_ItemCommand">
                <PagerStyle Mode="NextPrevAndNumeric" />
                <GroupingSettings CaseSensitive="false" />
                <MasterTableView TableLayout="Fixed" DataKeyNames="FHID" ClientDataKeyNames="FHID">
                    <Columns>
                        <telerik:GridBoundColumn HeaderText="FHID" DataField="FHID" UniqueName="FHID"
                            SortExpression="FHID" HeaderStyle-Width="100px" FilterControlWidth="100px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridBoundColumn HeaderText="病人ID" DataField="PID" UniqueName="PID"
                            SortExpression="PID" HeaderStyle-Width="100px" FilterControlWidth="100px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridBoundColumn HeaderText="病人姓名" DataField="PName" UniqueName="PName"
                            SortExpression="PName" HeaderStyle-Width="100px" FilterControlWidth="100px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridNumericColumn  HeaderText="测量值" DataField="FHValue" UniqueName="FHValue"
                            SortExpression="FHValue" HeaderStyle-Width="100px" FilterControlWidth="140px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridDateTimeColumn HeaderText="测量日期" DataField="ReceiveDate" UniqueName="ReceiveDate"
                            SortExpression="ReceiveDate" HeaderStyle-Width="100px" FilterControlWidth="140px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridBoundColumn HeaderText="查看状态" DataField="isNew" UniqueName="isNew"
                            SortExpression="isNew" HeaderStyle-Width="100px" FilterControlWidth="140px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridBoundColumn HeaderText="医生留言" DataField="Remark" UniqueName="Remark"
                            SortExpression="Remark" HeaderStyle-Width="100px" FilterControlWidth="140px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />
                    </Columns>
                                        
                    <NestedViewSettings>
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="FHID" MasterKeyField="FHID" />
                        </ParentTableRelation>
                    </NestedViewSettings>
                     <NestedViewTemplate >
                         <table>
                             <tr>
                                <td align="left" colspan="3">
                                    <telerik:RadChart ID="RadChartFH" runat="Server"
                                                      Width="495px" AutoLayout="true" Skin="Mac">
                                        <ClientSettings EnableZoom="false" ScrollMode="XOnly" XScale="4" />
                                        <Series>
                                            <telerik:ChartSeries Name="ChartFH" DataYColumn="FHValue" Type="Line">
                                                <Appearance FillStyle-MainColor="223, 87, 60">
                                                </Appearance>
                                            </telerik:ChartSeries>
                                        </Series>
                                        <Legend Visible="false"></Legend>
                                        <ChartTitle TextBlock-Text="Scrolling only (initial XScale applied)">
                                        </ChartTitle>
                                    </telerik:RadChart>

                                </td>
                             </tr>
                         </table>
                   </NestedViewTemplate>
                  
                </MasterTableView>
                <ClientSettings AllowDragToGroup="true" >
                    <Selecting AllowRowSelect="true" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                </ClientSettings>
      </telerik:RadGrid>

      <asp:SqlDataSource ID="SqlDataSource1" CancelSelectOnNullParameter="false" runat="server" ConnectionString="<%$ appSettings:XCareSqlConn%>"
           ProviderName="System.Data.SqlClient" SelectCommandType="StoredProcedure" SelectCommand="ChartFHData">
          <SelectParameters>
               <asp:Parameter  Name="FHID" Type="String"/>
           </SelectParameters>          
          
      </asp:SqlDataSource>


1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 29 Mar 2012, 10:45 AM
Hello Yang,

I reviewed the provided code but I'm still not completely sure what exactly is the functionality you need to achieve. Could you please elaborate a bit more on what is the final result you are expecting in your application. It would be best if you could provide us runnable version of your application which demonstrates the scenario you are implementing.

Kind regards,
Maria Ilieva
the Telerik team
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 their blog feed now.
Tags
Grid
Asked by
yang
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or