.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 14th, 2011, 02:42 PM
jaydwire2 jaydwire2 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2011
Posts: 1 jaydwire2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 5 sec
Reputation Power: 0
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:

http://examples.ext.net/#/GridPanel/Data_with_Details/Form_Details/
http://examples.ext.net/#/GridPanel/Miscellaneous/Details_Window_Remote/

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:

Code:
<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;
        
        if(empl.ReportsTo.HasValue)
        {
            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)
    {
        this.Store1.DataBind();
    }
</script>


and

Code:
<SelectionModel>
                                            <ext:RowSelectionModel runat="server" SingleSelect="true">
                                                <AjaxEvents>
                                                    <RowSelect OnEvent="RowSelect" Buffer="250">
                                                        <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{Details}" />
                                                        <ExtraParams>
                                                            <%-- or can use params[2].id as value --%>
                                                            <ext:Parameter Name="EmployeeID" Value="this.getSelected().id" Mode="Raw" />
                                                        </ExtraParams>
                                                    </RowSelect>
                                                </AjaxEvents>
                                            </ext:RowSelectionModel>
                                        </SelectionModel>


Thank you in advance for any help.
Jay

Reply With Quote
  #2  
Old October 23rd, 2012, 03:39 PM
Klinxor Klinxor is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 1 Klinxor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 26 sec
Reputation Power: 0
I am trying to do the same thing and have this same issue. Did you ever figure it out? Can someone help?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > How to display form details when selecting a grid value?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap