Advertisement

03.04.2008 at 02:19PM PST, ID: 23214263
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

How to programmatically select GridView row so that "OnSelectedIndexChanged" event fires

Tags: ASP.NET C#
I have a GridView that represents a list of Users. There's also a DetailsView to display a User's details. Both controls use the same ObjectDataSource control for data.

 In normal mode, when a user selects "Details", it selects the row, fires off the "OnSelectedIndexChanging" and "OnSelectedIndexChanged" events, and the details for a user are displayed in the DetailsView.

I want to be able to come into the page with a User's ID stored in Session, and to select that User's row in the GridView and display the DetailsView record for that user. This must all happen on Page Load.

I've searched online, but can find no solutions. I've attached my ASP.NET Code.

Thanks!

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
<asp:ObjectDataSource ID="odsUsers" runat="server" 
        DataObjectTypeName="RandomLengths.MyPrintCodeBlocks.BusinessObjects.CUser" 
        SelectMethod="FetchUserSearch" UpdateMethod="UpdateUser" SortParameterName="argSortExpression" 
        TypeName="RandomLengths.MyPrintCodeBlocks.BusinessObjects.CUserCollection">
        <SelectParameters>
            <asp:ControlParameter Name="argEmail" ControlID="SearchEmail" Type="String" PropertyName="Text" />
            <asp:ControlParameter Name="argEmailContains" ControlID="SearchEmailContains" Type="Boolean" PropertyName="Checked" />
            <asp:ControlParameter Name="argFirstName" ControlID="SearchFirstName" Type="String" PropertyName="Text" />
            <asp:ControlParameter Name="argFirstNameContains" ControlID="SearchFirstNameContains" Type="Boolean" 
 
PropertyName="Checked" />
            <asp:ControlParameter Name="argLastName" ControlID="SearchLastName" Type="String" PropertyName="Text" />
            <asp:ControlParameter Name="argLastNameContains" ControlID="SearchLastNameContains" Type="Boolean" PropertyName="Checked" 
 
/>
            <asp:ControlParameter Name="argCompanyName" ControlID="SearchCompanyName" Type="String" PropertyName="Text" />
            <asp:ControlParameter Name="argCompanyNameContains" ControlID="SearchCompanyNameContains" Type="Boolean" 
 
PropertyName="Checked" />
            <asp:ControlParameter Name="argSTProv" ControlID="SearchSTProv" Type="String" PropertyName="SelectedValue" />
            <asp:ControlParameter Name="argZip" ControlID="SearchZip" Type="String" PropertyName="Text" />
            <asp:ControlParameter Name="argCountry" ControlID="SearchCountry" Type="String" PropertyName="SelectedValue" />
            <asp:ControlParameter Name="argPhoneNumber" ControlID="SearchPhoneNumber" Type="String" PropertyName="Text" />
            <asp:ControlParameter Name="argPhoneNumberContains" ControlID="SearchPhoneNumberContains" Type="Boolean" 
 
PropertyName="Checked" />
            <asp:ControlParameter Name="argUserStatusPKSEQ" ControlID="SearchUserStatus" Type="Int32" PropertyName="SelectedValue" />
        </SelectParameters>
        </asp:ObjectDataSource>
        
    <asp:GridView ID="gvUsers" runat="server" AllowPaging="true" PageSize="50" AllowSorting="true" AutoGenerateColumns="false" 
        DataSourceID="odsUsers" DataKeyNames="PKSEQ" EnableViewState="false" Width="850" OnRowCommand="gvUsers_RowCommand" 
        OnSelectedIndexChanged="gvUsers_SelectedIndexChanged" OnSelectedIndexChanging="gvUsers_SelectedIndexChanging" 
 
OnSorted="gvUsers_Sorted" 
        >
        <HeaderStyle BackColor="#191970" ForeColor="#FFFFFF" Font-Names="Verdana,Arial" Font-Bold="true" HorizontalAlign="center" />
        <RowStyle HorizontalAlign="center" Font-Names="Verdana,Arial" />
        <AlternatingRowStyle HorizontalAlign="center" Font-Names="Verdana,Arial" BackColor="#FFE4C4" />
        <Columns>
            <asp:CommandField ButtonType="Button" SelectText="Details" ShowSelectButton="true" ControlStyle-CssClass="Button" />
            <asp:BoundField ItemStyle-Width="200" HeaderText="Email" DataField="Email" SortExpression="Email" />
            <asp:BoundField ItemStyle-Width="160" HeaderText="First Name" DataField="FirstName" SortExpression="FirstName" />
            <asp:BoundField ItemStyle-Width="160" HeaderText="Last Name" DataField="LastName" SortExpression="LastName" />
            <asp:BoundField ItemStyle-Width="160" HeaderText="Company Name" DataField="CompanyName" SortExpression="CompanyName" />
            <asp:BoundField ItemStyle-Width="100" HeaderText="Zip Code" DataField="Zip" SortExpression="Zip" />
            <asp:BoundField ItemStyle-Width="120" HeaderText="Phone Number" DataField="PhoneNumber" SortExpression="PhoneNumber" />
            <asp:BoundField ItemStyle-Width="100" HeaderText="User Status" DataField="UserStatusText" SortExpression="UserStatusPKSEQ" 
 
/>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Button ID="btnResetPwd" runat="server" Text="Reset Pwd" CommandName="ResetPwd" 
 
CommandArgument='<%#Bind("PKSEQ") %>' CssClass="Button" OnClientClick="return confirm('Do you really want to reset this user's 
 
password?');" />
                    <asp:HiddenField ID="txtPKSEQ" runat="server" Value='<%#Bind("PKSEQ") %>' />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    
    </asp:GridView>
    
 
 
    <asp:ObjectDataSource ID="odsUserDetail" runat="server" 
        SelectMethod="fnFetchSingleUser" EnableViewState="false"  
        TypeName="RandomLengths.MyPrintCodeBlocks.BusinessObjects.CUserCollection" 
        DataObjectTypeName="RandomLengths.MyPrintCodeBlocks.BusinessObjects.CUser"
        OldValuesParameterFormatString="original_{0}" OnUpdating="odsUserDetail_Updating" 
        UpdateMethod="UpdateUser" >
        <SelectParameters>
            <asp:ControlParameter ControlID="gvUsers" Name="argUserPKSEQ"
                PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="FirstName" Type="String" />
            <asp:Parameter Name="MiddleName" Type="String" />
            <asp:Parameter Name="LastName" Type="String" />
            <asp:Parameter Name="Address1" Type="String" />
            <asp:Parameter Name="Address2" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:ControlParameter Name="STProv" ControlID="ddlSTProv" PropertyName="SelectedValue" Type="Char" Size="2" />
            <asp:Parameter Name="Zip" Type="String" />
            <asp:ControlParameter Name="Country" ControlID="ddlCountry" PropertyName="SelectedValue" Type="Char" Size="2" />
            <asp:Parameter Name="PhoneNumber" Type="String" />
            <asp:Parameter Name="FaxNumber" Type="String" />
            <asp:Parameter Name="CompanyName" Type="String" />
            <asp:Parameter Name="Title" Type="String" />
            <asp:ControlParameter Name="FavoriteQuestion" ControlID="ddlFavoriteQuestion" PropertyName="SelectedValue" Type="String" 
 
/>
            <asp:Parameter Name="FavoriteAnswer" Type="String" />
            <asp:Parameter Name="IsPromoByEmail" Type="Boolean" />
            <asp:Parameter Name="IsPromoByPost" Type="Boolean" />
            <asp:Parameter Name="IsPromoByFax" Type="Boolean" />
        </UpdateParameters>
        </asp:ObjectDataSource>
 
    <asp:DetailsView ID="dvUser" runat="server" AutoGenerateRows="False" CellPadding="5"  
        DataKeyNames="PKSEQ" DataSourceID="odsUserDetail" EnableViewState="false" 
        HeaderText="User Details" OnItemUpdating="dvUser_ItemUpdating" OnItemUpdated="dvUser_ItemUpdated" Width="350"
        OnDataBound="dvUser_DataBound" OnItemCommand="dvUser_ItemCommand" >
        <HeaderStyle BackColor="#191970" ForeColor="#FFFFFF" Font-Names="Verdana,Arial" Font-Bold="true" HorizontalAlign="center" />
        <RowStyle HorizontalAlign="left" Font-Names="Verdana,Arial" />
        <FieldHeaderStyle HorizontalAlign="Right" Font-Bold="true"  />
        <CommandRowStyle BackColor="#191970" ForeColor="#FFFFFF" />
        <AlternatingRowStyle HorizontalAlign="left" Font-Names="Verdana,Arial" BackColor="#FFE4C4" />
        <EditRowStyle HorizontalAlign="Left" />
        <Fields>
            <asp:CommandField ButtonType="Button" EditText="Edit User" UpdateText="Update User" 
                CancelText="Cancel Changes" Visible="true" ShowEditButton="true" ControlStyle-CssClass="Button" />
            <asp:BoundField HeaderText="Email" DataField="Email" />
            <asp:BoundField HeaderText="First Name" DataField="FirstName" />
            <asp:BoundField HeaderText="Middle Name" DataField="MiddleName" />
            <asp:BoundField HeaderText="Last Name" DataField="LastName" />
            <asp:BoundField HeaderText="User Status" DataField="UserStatusText" ReadOnly="True" />
            <asp:BoundField HeaderText="Address 1" DataField="Address1" />
            <asp:BoundField HeaderText="Address 2" DataField="Address2" />
            <asp:BoundField HeaderText="City" DataField="City" />
            <asp:TemplateField HeaderText="State/Province" >
                <ItemTemplate>
                    <asp:Label ID="STProv" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "STProvName") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:DropDownList ID="ddlSTProv" runat="server" />
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="Zip" DataField="Zip" />
            <asp:TemplateField HeaderText="Country" >
                <ItemTemplate>
                    <asp:Label ID="Country" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "CountryName") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:DropDownList ID="ddlCountry" runat="server" />
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="Phone Number" DataField="PhoneNumber" />
            <asp:BoundField HeaderText="Fax Number" DataField="FaxNumber" />
            <asp:BoundField HeaderText="Company Name" DataField="CompanyName" />
            <asp:BoundField HeaderText="Title" DataField="Title" />
            <asp:TemplateField HeaderText="Security Question" >
                <ItemTemplate>
                    <asp:Label ID="FavoriteQuestion" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "FavoriteQuestion") 
 
%>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:DropDownList ID="ddlFavoriteQuestion" runat="server" >    
                        <asp:ListItem Value="x" Text="Select a question ..." />
                        <asp:ListItem Value="What is my Mother's maiden name?" Text="What is my Mother's maiden name." />
                        <asp:ListItem Value="What is my Father's middle name?" Text="What is my Father's middle name." />
                        <asp:ListItem Value="Who was my favorite teacher in high school?" Text="Who was my favorite teacher in high 
 
school?" />
                        <asp:ListItem Value="What was the name of my elementary school?" Text="What was the name of my elementary 
 
school?" />
                        <asp:ListItem Value="What is my favorite movie?" Text="What is my favorite movie?" />
                        <asp:ListItem Value="What is my favorite song?" Text="What is my favorite song?" />
                        <asp:ListItem Value="What make/model was my first car?" Text="What make/model was my first car?" />
                        <asp:ListItem Value="In what city was I born?" Text="In what city was I born?" />
                    </asp:DropDownList>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="Security Answer" DataField="FavoriteAnswer" />
            <asp:CheckBoxField HeaderText="Promo By Email" DataField="IsPromoByEmail" />
            <asp:CheckBoxField HeaderText="Promo By Post" DataField="IsPromoByPost" />
            <asp:CheckBoxField HeaderText="Promo By Fax" DataField="IsPromoByFax" />
            <asp:BoundField HeaderText="Last Login Date" DataField="LastLoginDate" ReadOnly="True" />
            <asp:TemplateField Visible="false" >
                <EditItemTemplate>
                    <asp:Label ID="lblModifiedBy" runat="server" />
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField Visible="true">
                <ItemTemplate>
                    <asp:HiddenField ID="txtSelectedUserPKSEQ" runat="server" />
                    <asp:Button ID="btnRemoveUser" runat="server" Text="Remove User" OnClientClick="return confirm('Do you really want 
 
to permanently remove this User from My Print?');"
                        CommandName="RemoveUser" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "PKSEQ") %>' 
 
CausesValidation="false" />
                </ItemTemplate>
            </asp:TemplateField>
        </Fields>
    </asp:DetailsView>
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: DanielBorson
Solution Provided By: Edy
Participating Experts: 2
Solution Grade: B
Views: 462
Translate:
Loading Advertisement...
03.04.2008 at 02:35PM PST, ID: 21045891

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.12.2008 at 04:52AM PDT, ID: 21104851

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.12.2008 at 05:22AM PDT, ID: 21105090

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.12.2008 at 05:30AM PDT, ID: 21105155

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.12.2008 at 11:37AM PDT, ID: 21109277

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
03.04.2008 at 02:35PM PST, ID: 21045891

Rank: Wizard

couldn't you just manually invoke the event handling method after you've set the appropriate selectedindex?
 
03.12.2008 at 04:52AM PDT, ID: 21104851
The problem is that SelectedIndex is the ordinal number of the selected row in the GridView. Ideally we would need to set up the SelectedValue property, which is read-only and contains the primary key of the selected row ("PKSEQ").
 
03.12.2008 at 05:22AM PDT, ID: 21105090
I've found a partial solution: instead of selecting the active user in the GridView, select that user in the DetailsView. Thus, the page will display the GridView with no record selected, but the DetailsView will show the details of the specified record.

Try adding the code line below in your page_load method. The behavior will be:

- If the session variable is present then the DetailsView will show that record and the GridView won't show any selected record.
- If the user selects a different record, then the DetailsView will be updated accordingly (DetailsView.SelectedValue takes priority over the Session variable).

I had the same problem as you and this was an acceptable workaround for my case.
1:
odsUserDetail.SelectParameters["argUserPKSEQ"].DefaultValue = Session["yoursessionvariable"];
Open in New Window
Accepted Solution
 
03.12.2008 at 05:30AM PDT, ID: 21105155
Sorry for the mistakes, here's again the explanation on the behavior:

- If the session variable is present then the DetailsView will show that record and the GridView will show the record list normally, with no selected record.
- If the user selects a different record in the GridView, then the DetailsView will be updated accordingly (GridView.SelectedValue takes priority over the Session variable).
 
03.12.2008 at 11:37AM PDT, ID: 21109277
Code fixed. The previous code seems to work fine with Request.QueryString["variable"] directly, but as Session values are objects then we must check whether the value is present or not.
1:
2:
3:
if (Session["yoursessionvariable"] != null)
   odsUserDetail.SelectParameters["argUserPKSEQ"].DefaultValue = Session["yoursessionvariable"].ToString();
Open in New Window
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628