1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Rep Power

    Question How to display form details when selecting a grid value?

    Hello all,
    I am hoping someone here will be able to help me convert two examples to using SqlDataSource. These are the two examples:


    In the first example, I am able to display the grid values from a SqlDataSource but when I select a grid row, I am unable to display its details. If someone can show me how to modify the code at the top to work with a SqlDataSource, I would be very grateful. Further, if it would be possible to add a New, Save, and delete button to that first example, that is really what I am trying to get. The full code is at the example site, but I believe the area that needs to be updated is:

    <script runat="server">
        protected void RowSelect(object sender, AjaxEventArgs e)
            string employeeID = e.ExtraParams["EmployeeID"];
            Employee empl = Employee.GetEmployee(int.Parse(employeeID));
            this.EmployeeID.Text = empl.EmployeeID.ToString();
            this.FirstName.Text = empl.FirstName;
            this.LastName.Text = empl.LastName;
            this.Title.Text = empl.Title;
                Employee reportsTo = Employee.GetEmployee(empl.ReportsTo.Value);
                this.ReportsTo.Text = reportsTo != null ? reportsTo.LastName : "";
            this.HireDate.SelectedDate = empl.HireDate.HasValue ? empl.HireDate.Value : DateTime.MinValue;
            this.Extension.Text = empl.Extension;
            this.Address.Text = empl.Address;
            this.City.Text = empl.City;
            this.PostCode.Text = empl.PostalCode;
            this.HomePhone.Text = empl.HomePhone;
            this.TitleCourt.Text = empl.TitleOfCourtesy;
            this.BirthDate.SelectedDate = empl.BirthDate.HasValue ? empl.BirthDate.Value : DateTime.MinValue;
            this.Region.Text = empl.Region;
            this.Country.Text = empl.Country;
            this.Note.Text = empl.Notes;
        protected void Store1_Refresh(object sender, StoreRefreshDataEventArgs e)

                                                <ext:RowSelectionModel runat="server" SingleSelect="true">
                                                        <RowSelect OnEvent="RowSelect" Buffer="250">
                                                            <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{Details}" />
                                                                <%-- or can use params[2].id as value --%>
                                                                <ext:Parameter Name="EmployeeID" Value="this.getSelected().id" Mode="Raw" />
    Thank you in advance for any help.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Rep Power
    I am trying to do the same thing and have this same issue. Did you ever figure it out? Can someone help?

IMN logo majestic logo threadwatch logo seochat tools logo