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

displying NULL VALUES on top

1 Answer 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Duncan Evans
Top achievements
Rank 1
Duncan Evans asked on 19 Oct 2010, 08:13 PM
I have a RadGrid that i a sorting by "AdmitDate". This date column could have NULL values and i need to get these rows to display on top of all other RadGrid rows. I was hoping that i could place these rows with NULL values in a group at the top of the Radgrid. Sorting the SqlDataSource in Asc order works, however i need to display the rows with actual dates in Desc order.

I was then looking into populating two SqlDataSource. 1 for the null rows and one for the non-null rows. I was then hoping that the RadGrid could append the two datasources together in the grid. Is this possible?

Any guidance as to how to accomplish this would be great.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
 
public partial class Admin_Admissions : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            GridSortExpression expression = new GridSortExpression();
            expression.FieldName = "AdmitDate";
            expression.SetSortOrder("Descending");
            RadGrid1.MasterTableView.SortExpressions.AddSortExpression(expression);
 
            //GridGroupByExpression expression1 = GridGroupByExpression.Parse("AdmitDate Group By IS NULL(AdmitDate)");
            //RadGrid1.MasterTableView.GroupByExpressions.Add(expression1);
        }
    }
 
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
 
            //foreach (GridColumn column in RadGrid1.MasterTableView.RenderColumns)
            //{
            //    if (column is GridTemplateColumn)
            //    {
            item["PtName"].ToolTip =
                "<strong>Patient Name:</strong><br/>" + ((System.Data.DataRowView)(item.DataItem)).Row["PtName"].ToString() + "<br/><br/>" +
                "<strong>Patient Notes:</strong><br/>" + ((System.Data.DataRowView)(item.DataItem)).Row["History"].ToString() + "<br/><br/>" +
                "<strong>Status Notes:</strong><br/>" + ((System.Data.DataRowView)(item.DataItem)).Row["Status"].ToString();
 
            RadToolTipManager1.TargetControls.Add(item["PtName"].ClientID, true);
            //    }
            //}
 
 
            Label AdmitDateLabel = item.FindControl("AdmitDateLabel") as Label;
 
            if (AdmitDateLabel != null)
            {
 
                if (((System.Data.DataRowView)(item.DataItem)).Row["AdmitDate"].ToString() == "")
                {
                    AdmitDateLabel.Text = "Pending";
                }
            }
 
 
            Label InsLabel = item.FindControl("InsLabel") as Label;
 
            if (InsLabel != null)
            {
                DataView Insurance_DataView = (DataView)Insurance_DataSource.Select(DataSourceSelectArguments.Empty);
 
                int indx = 0;
                if (Int32.TryParse(((System.Data.DataRowView)(item.DataItem)).Row["Ins"].ToString(), out indx))
                {
                    Insurance_DataView.Sort = "ID";
                    InsLabel.Text = Insurance_DataView[Insurance_DataView.Find(indx)]["Name"].ToString();
                }
                else
                {
                    InsLabel.Text = "";
                }
            }
 
            Label ReferralLabel = item.FindControl("ReferralLabel") as Label;
 
            if (ReferralLabel != null)
            {
                DataView Referral_DataView = (DataView)Referral_DataSource.Select(DataSourceSelectArguments.Empty);
 
                int indx = 0;
                if (Int32.TryParse(((System.Data.DataRowView)(item.DataItem)).Row["Referral"].ToString(), out indx))
                {
                    Referral_DataView.Sort = "ID";
                    ReferralLabel.Text = Referral_DataView[Referral_DataView.Find(indx)]["Name"].ToString();
                }
                else
                {
                    ReferralLabel.Text = "";
                }
            }
 
            Label LOCLabel = item.FindControl("LOCLabel") as Label;
 
            if (LOCLabel != null)
            {
                DataView CareLevel_DataView = (DataView)CareLevel_DataSource.Select(DataSourceSelectArguments.Empty);
 
                int indx = 0;
                if (Int32.TryParse(((System.Data.DataRowView)(item.DataItem)).Row["LOC"].ToString(), out indx))
                {
                    CareLevel_DataView.Sort = "ID";
                    LOCLabel.Text = CareLevel_DataView[CareLevel_DataView.Find(indx)]["CareLevel"].ToString();
                }
                else
                {
                    LOCLabel.Text = "";
                }
            }
 
            Label CampaignLabel = item.FindControl("CampaignLabel") as Label;
 
            if (CampaignLabel != null)
            {
                DataView Campaigns_DataView = (DataView)Campaigns_DataSource.Select(DataSourceSelectArguments.Empty);
 
                int indx = 0;
                if (Int32.TryParse(((System.Data.DataRowView)(item.DataItem)).Row["Campaign"].ToString(), out indx))
                {
                    Campaigns_DataView.Sort = "ID";
                    CampaignLabel.Text = Campaigns_DataView[Campaigns_DataView.Find(indx)]["Campaign"].ToString();
                }
                else
                {
                    CampaignLabel.Text = "";
                }
            }
 
            Label CCRepLabel = item.FindControl("CCRepLabel") as Label;
 
            if (CCRepLabel != null)
            {
                DataView CCReps_DataView = (DataView)CCReps_DataSource.Select(DataSourceSelectArguments.Empty);
 
                int indx = 0;
                if (Int32.TryParse(((System.Data.DataRowView)(item.DataItem)).Row["CCRep"].ToString(), out indx))
                {
                    CCReps_DataView.Sort = "ID";
                    CCRepLabel.Text = CCReps_DataView[CCReps_DataView.Find(indx)]["Name"].ToString();
                }
                else
                {
                    CCRepLabel.Text = "";
                }
            }
 
            Label StateLabel = item.FindControl("StateLabel") as Label;
 
            if (StateLabel != null)
            {
                DataView States_DataView = (DataView)States_DataSource.Select(DataSourceSelectArguments.Empty);
 
                int indx = 0;
                if (Int32.TryParse(((System.Data.DataRowView)(item.DataItem)).Row["State"].ToString(), out indx))
                {
                    States_DataView.Sort = "ID";
                    StateLabel.Text = States_DataView[States_DataView.Find(indx)]["StateName"].ToString();
                }
                else
                {
                    StateLabel.Text = "";
                }
            }
        }
    }
}
<%@ Page Title="" Language="C#" MasterPageFile="~/App_Master/Admin.master" AutoEventWireup="true"
    CodeFile="Admissions.aspx.cs" Inherits="Admin_Admissions" Theme="Reports" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
 
    <script type="text/javascript">
        function onRequestStart(sender, args) {
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                args.set_enableAjax(false);
            }
        }
    </script>
 
    <br />
    <div class="container_label">
        Add/Update/Delete Lead Records:</div>
    <div>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Office2007">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <ClientEvents OnRequestStart="onRequestStart" />
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadToolTipManager ID="RadToolTipManager1" OffsetY="-1" HideEvent="LeaveToolTip"
            runat="server" EnableShadow="true" RelativeTo="Element" Skin="Default" Height="150px"
            Width="250px" Animation="Resize" AutoCloseDelay="2000" Overlay="False" OffsetX="0"
            AnimationDuration="300">
        </telerik:RadToolTipManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
            AllowSorting="True" AutoGenerateDeleteColumn="True" DataSourceID="Admissions_DataSource"
            GridLines="None" ShowGroupPanel="True" Skin="Office2007" Width="1400px" Height="800px"
            PageSize="75" ShowFooter="True" AutoGenerateColumns="False" OnItemDataBound="RadGrid1_ItemDataBound"
            AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
            <ExportSettings ExportOnlyData="True" HideStructureColumns="True" FileName="LeadsExport"
                IgnorePaging="True" OpenInNewWindow="True">
            </ExportSettings>
            <MasterTableView DataKeyNames="ID" CommandItemDisplay="Top" DataSourceID="Admissions_DataSource"
                EditMode="PopUp" GroupLoadMode="Client" InsertItemPageIndexAction="ShowItemOnCurrentPage">
                <CommandItemSettings ExportToPdfText="Export to Pdf" ShowExportToExcelButton="True"
                    ShowExportToPdfButton="True" />
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="" HeaderStyle-Width="30">
                        <HeaderStyle Width="30px" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridTemplateColumn AllowFiltering="False" DataField="AdmitDate" DataType="System.DateTime"
                        HeaderText="Admit Date" SortExpression="AdmitDate" GroupByExpression="AdmitDate Group By AdmitDate desc"
                        UniqueName="AdmitDate" HeaderStyle-Width="95">
                        <EditItemTemplate>
                            <telerik:RadDatePicker ID="RadDatePicker2" runat="server" Culture="English (United States)"
                                DbSelectedDate='<%# Bind("AdmitDate") %>' Skin="Office2007" ShowPopupOnFocus="True">
                                <Calendar Skin="Office2007" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
                                    ViewSelectorText="x">
                                </Calendar>
                                <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                <DateInput DateFormat="M/d/yyyy" DisplayDateFormat="M/d/yyyy">
                                </DateInput>
                            </telerik:RadDatePicker>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="AdmitDateLabel" runat="server" Text='<%# Bind("AdmitDate", "{0:MM/dd/yyyy}") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="95px" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn AllowFiltering="False" DataField="CallDate" DataType="System.DateTime"
                        HeaderText="Call Date" SortExpression="CallDate" GroupByExpression="CallDate Group By CallDate desc"
                        UniqueName="CallDate" HeaderStyle-Width="95">
                        <EditItemTemplate>
                            <telerik:RadDatePicker ID="RadDatePicker3" runat="server" Culture="English (United States)"
                                DbSelectedDate='<%# Bind("CallDate") %>' ShowPopupOnFocus="True" Skin="Office2007">
                                <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"
                                    Skin="Office2007">
                                </Calendar>
                                <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                <DateInput DateFormat="M/d/yyyy" DisplayDateFormat="M/d/yyyy">
                                </DateInput>
                            </telerik:RadDatePicker>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="RadDatePicker3"
                                ErrorMessage="Call Date Required"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="CallDateLabel" runat="server" Text='<%# Bind("CallDate", "{0:MM/dd/yyyy}") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="95px" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="PtName" Groupable="False" HeaderText="Patient Name"
                        SortExpression="PtName" UniqueName="PtName" ItemStyle-Wrap="false">
                        <EditItemTemplate>
                            <telerik:RadTextBox ID="RadTextBox1" runat="server" EmptyMessage="Patient Name" Skin="Office2007"
                                Text='<%# Bind("PtName") %>' Width="125px">
                            </telerik:RadTextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="RadTextBox1"
                                ErrorMessage="Patient name Required"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="PtNameLabel" runat="server" Text='<%# Bind("PtName") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Wrap="False" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="Ins" DataType="System.Int32" HeaderText="Insurance"
                        SortExpression="Ins" GroupByExpression="Ins Group By Ins desc" UniqueName="Ins"
                        HeaderStyle-Width="140">
                        <EditItemTemplate>
                            <telerik:RadComboBox ID="RadComboBox1" runat="server" DataSourceID="Insurance_DataSource"
                                DataTextField="Name" DataValueField="ID" SelectedValue='<%# Bind("Ins") %>' Skin="Office2007"
                                NoWrap="True" Sort="Ascending">
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="InsLabel" runat="server" Text='<%# Bind("Ins") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="140px" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn AllowFiltering="False" DataField="Referral" DataType="System.Int32"
                        HeaderText="Referrer" SortExpression="Referral" GroupByExpression="Referral Group By Referral desc"
                        UniqueName="Referral" HeaderStyle-Width="100">
                        <EditItemTemplate>
                            <telerik:RadComboBox ID="RadComboBox2" runat="server" DataSourceID="Referral_DataSource"
                                DataTextField="Name" DataValueField="ID" SelectedValue='<%# Bind("Referral") %>'
                                Skin="Office2007" NoWrap="True" Sort="Ascending">
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="ReferralLabel" runat="server" Text='<%# Bind("Referral") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="100px" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn AllowFiltering="False" DataField="LOC" DataType="System.Int32"
                        HeaderText="Level of Care" SortExpression="LOC" GroupByExpression="LOC Group By LOC desc"
                        UniqueName="LOC" HeaderStyle-Width="90">
                        <EditItemTemplate>
                            <telerik:RadComboBox ID="RadComboBox3" runat="server" DataSourceID="CareLevel_DataSource"
                                DataTextField="CareLevel" DataValueField="ID" SelectedValue='<%# Bind("LOC") %>'
                                Skin="Office2007" NoWrap="True" Sort="Ascending">
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="LOCLabel" runat="server" Text='<%# Bind("LOC") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="90px" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn AllowFiltering="False" DataField="Arrived" Groupable="False"
                        HeaderText="Arrived?" SortExpression="Arrived" UniqueName="Arrived" HeaderStyle-Width="80">
                        <EditItemTemplate>
                            <telerik:RadComboBox ID="RadComboBox4" runat="server" SelectedValue='<%# Bind("Arrived") %>'
                                Skin="Office2007" NoWrap="True" Sort="Ascending">
                                <Items>
                                    <telerik:RadComboBoxItem runat="server" Text="Yes" Value="YES" />
                                    <telerik:RadComboBoxItem runat="server" Text="No" Value="NO" />
                                    <telerik:RadComboBoxItem runat="server" Text="Unknown" Value="UNKNOWN" />
                                </Items>
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="ArrivedLabel" runat="server" Text='<%# Bind("Arrived") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="80px" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn AllowFiltering="False" DataField="CCRep" DataType="System.Int32"
                        HeaderText="Call Center Rep" SortExpression="CCRep" GroupByExpression="CCRep Group By CCRep desc"
                        UniqueName="CCRep" HeaderStyle-Width="100">
                        <EditItemTemplate>
                            <telerik:RadComboBox ID="RadComboBox5" runat="server" DataSourceID="CCReps_DataSource"
                                DataTextField="Name" DataValueField="ID" SelectedValue='<%# Bind("CCRep") %>'
                                Skin="Office2007" NoWrap="True" Sort="Ascending">
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="CCRepLabel" runat="server" Text='<%# Bind("CCRep") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="100px" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="Campaign" DataType="System.Int32" HeaderText="Campaign"
                        SortExpression="Campaign" UniqueName="Campaign" GroupByExpression="Campaign Group By Campaign desc"
                        HeaderStyle-Width="200">
                        <EditItemTemplate>
                            <telerik:RadComboBox ID="RadComboBox6" runat="server" DataSourceID="Campaigns_DataSource"
                                DataTextField="Campaign" DataValueField="ID" SelectedValue='<%# Bind("Campaign") %>'
                                Skin="Office2007" NoWrap="True" Sort="Ascending">
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="CampaignLabel" runat="server" Text='<%# Bind("Campaign") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="200px" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="State" DataType="System.Int32" HeaderText="State"
                        SortExpression="State" GroupByExpression="State Group By State desc" UniqueName="State"
                        HeaderStyle-Width="120">
                        <EditItemTemplate>
                            <telerik:RadComboBox ID="RadComboBox7" runat="server" DataSourceID="States_DataSource"
                                DataTextField="StateName" DataValueField="ID" SelectedValue='<%# Bind("State") %>'
                                Skin="Office2007" NoWrap="True" Sort="Ascending">
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="StateLabel" runat="server" Text='<%# Bind("State") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="120px" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn AllowFiltering="False" DataField="Value" DataType="System.Decimal"
                        Groupable="False" HeaderText="ROI Value" SortExpression="Value" UniqueName="Value"
                        HeaderStyle-Width="80">
                        <EditItemTemplate>
                            <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" Culture="English (United States)"
                                DbValue='<%# Bind("Value") %>' Skin="Office2007" Type="Currency" Value="0" Width="125px"
                                EmptyMessage="Enter Dollar Value" DataType="System.Decimal">
                            </telerik:RadNumericTextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="ValueLabel" runat="server" Text='<%# Bind("Value", "{0:C}") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="80px" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn AllowFiltering="False" DataField="Status" HeaderText="Status"
                        SortExpression="Status" GroupByExpression="Status Group By Status desc" UniqueName="Status"
                        ItemStyle-Wrap="false" Visible="False">
                        <EditItemTemplate>
                            <telerik:RadTextBox ID="RadTextBox3" runat="server" Skin="Office2007" Text='<%# Bind("Status") %>'
                                Width="125px">
                            </telerik:RadTextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="StatusLabel" runat="server" Text='<%# Bind("Status") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Wrap="False" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn AllowFiltering="False" DataField="History" Groupable="False"
                        HeaderText="Notes" SortExpression="History" UniqueName="History" ItemStyle-Wrap="false"
                        Visible="False">
                        <EditItemTemplate>
                            <telerik:RadTextBox ID="RadTextBox2" runat="server" EmptyMessage="Enter History/Details/Notes"
                                Height="75px" Skin="Office2007" Text='<%# Bind("History") %>' TextMode="MultiLine"
                                Width="200px">
                            </telerik:RadTextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="HistoryLabel" runat="server" Text='<%# Bind("History") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Wrap="False" />
                    </telerik:GridTemplateColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <GroupingSettings ShowUnGroupButton="True" />
            <ClientSettings AllowDragToGroup="True" EnableRowHoverStyle="true">
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                <Selecting AllowRowSelect="false" EnableDragToSelectRows="false" />
            </ClientSettings>
        </telerik:RadGrid>
        <br />
    </div>
    <asp:SqlDataSource ID="Admissions_DataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        InsertCommand="INSERT INTO [Admissions] ([CallDate], [PtName], [Ins], [Referral], [AdmitDate], [History], [LOC], [Arrived], [CCRep], [Status], [Campaign], [Value], [State]) VALUES (@CallDate, @PtName, @Ins, @Referral, @AdmitDate, @History, @LOC, @Arrived, @CCRep, @Status, @Campaign, @Value, @State)"
        SelectCommand="SELECT [ID], [CallDate], [PtName], [Ins], [Referral], [AdmitDate], [History], [LOC], [Arrived], [CCRep], [Status], [Campaign], [Value], [State] FROM [Admissions] ORDER BY ISNULL(AdmitDate, '20550101')"
        DeleteCommand="DELETE FROM [Admissions] WHERE [ID] = @original_ID" UpdateCommand="UPDATE [Admissions] SET [CallDate] = @CallDate, [PtName] = @PtName, [Ins] = @Ins, [Referral] = @Referral, [AdmitDate] = @AdmitDate, [History] = @History, [LOC] = @LOC, [Arrived] = @Arrived, [CCRep] = @CCRep, [Status] = @Status, [Campaign] = @Campaign, [Value] = @Value, [State] = @State WHERE [ID] = @original_ID"
        ConflictDetection="CompareAllValues" OldValuesParameterFormatString="original_{0}">
        <DeleteParameters>
            <asp:Parameter Name="original_ID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="CallDate" DbType="Date" />
            <asp:Parameter Name="PtName" Type="String" />
            <asp:Parameter Name="Ins" Type="Int32" />
            <asp:Parameter Name="Referral" Type="Int32" />
            <asp:Parameter Name="AdmitDate" DbType="Date" />
            <asp:Parameter Name="History" Type="String" />
            <asp:Parameter Name="LOC" Type="Int32" />
            <asp:Parameter Name="Arrived" Type="String" />
            <asp:Parameter Name="CCRep" Type="Int32" />
            <asp:Parameter Name="Status" Type="String" />
            <asp:Parameter Name="Campaign" Type="Int32" />
            <asp:Parameter Name="Value" Type="Decimal" />
            <asp:Parameter Name="State" Type="Int32" />
            <asp:Parameter Name="original_ID" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="CallDate" DbType="Date" />
            <asp:Parameter Name="PtName" Type="String" />
            <asp:Parameter Name="Ins" Type="Int32" />
            <asp:Parameter Name="Referral" Type="Int32" />
            <asp:Parameter Name="AdmitDate" DbType="Date" />
            <asp:Parameter Name="History" Type="String" />
            <asp:Parameter Name="LOC" Type="Int32" />
            <asp:Parameter Name="Arrived" Type="String" />
            <asp:Parameter Name="CCRep" Type="Int32" />
            <asp:Parameter Name="Status" Type="String" />
            <asp:Parameter Name="Campaign" Type="Int32" />
            <asp:Parameter Name="Value" Type="Decimal" />
            <asp:Parameter Name="State" Type="Int32" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="CCReps_DataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT [ID], [Name] FROM [CCReps] ORDER BY [Name]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="Insurance_DataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT [ID], [Name] FROM [Insurance] ORDER BY [Name]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="Referral_DataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT [ID], [Name] FROM [Referral] ORDER BY [Name]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="CareLevel_DataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT [ID], [CareLevel] FROM [CareLevels] ORDER BY [CareLevel]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="Campaigns_DataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT [ID], [Campaign] FROM [Campaigns] ORDER BY [Campaign]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="States_DataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT [ID], [StateCode], [StateName] FROM [States] ORDER BY [StateName]">
    </asp:SqlDataSource>
</asp:Content>

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 25 Oct 2010, 08:46 AM
Hello Duncan Evans,

Note that RadGrid can bind to a single data source at a time just as other data bound controls behave. Since you would like to bind your grid to a custom sorted view of your data, I am afraid that custom sorting is the only option you can use in this scenario. For more information you can review the following help topic:

Applying custom sort criteria

I hope this helps.

All the best,
Martin
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
Tags
Grid
Asked by
Duncan Evans
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or