Advertisement

05.07.2008 at 05:12AM PDT, ID: 23382446
[x]
Attachment Details

ASP.Net 2.0 Datagridview bound to arraylist - how do I make one of the columns into a dropdownlist

Asked by JamesAStewart in Microsoft Visual Basic.Net, Programming for ASP.NET, .NET Framework 2.0

Tags: VB.Net 2.0 ASP

I am using an arraylist to populate a datagridview which is working well however, I would like to edit two of the columns.

I would like to be able to place dropdownlists into columns 2 and 3 (customerRef,ThemePreference) and populate them and make the current selection visible. I can then handle any update and update the underlying profile properties information.

Any advice would be greatlly appreciated.

James
Using ASP.Net 2.0
Start Free Trial
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:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        GridView1.DataSource = getProfiles()
        GridView1.DataBind()
    End Sub
 
 
    Public Function getProfiles()
 
        Dim profiles As New ArrayList
 
        Dim userProfiles As ProfileInfoCollection
        userProfiles = ProfileManager.GetAllProfiles(ProfileAuthenticationOption.All)
        Dim userInfo As ProfileInfo
        For Each userInfo In userProfiles
            profiles.Add(New userProfileDetails(Profile.GetProfile(userInfo.UserName).UserName, _
            Profile.GetProfile(userInfo.UserName).customerRef, _
            Profile.GetProfile(userInfo.UserName).ThemePreference, _
            Profile.GetProfile(userInfo.UserName).LastActivityDate))
 
        Next
 
        Return profiles
    End Function
 
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" Style="position: relative" AutoGenerateColumns="false" >
            <Columns>
                <asp:BoundField HeaderText="User Name" DataField="UserName"/>
                <asp:BoundField HeaderText="customerRef" DataField="customerRef"/>
                <asp:BoundField HeaderText="ThemePreference" DataField="ThemePreference" />
                <asp:BoundField HeaderText="Last Activity" DataField="LastActivityDate" />
            </Columns>
        </asp:GridView>
    
    </div>
    </form>
</body>
[+][-]05.07.2008 at 05:20AM PDT, ID: 21515552

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, Programming for ASP.NET, .NET Framework 2.0
Tags: VB.Net 2.0 ASP
Sign Up Now!
Solution Provided By: avnish_tanna
Participating Experts: 1
Solution Grade: B
 
 
[+][-]05.07.2008 at 07:29AM PDT, ID: 21516760

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 10:15PM PDT, ID: 21522465

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 02:11AM PDT, ID: 21531241

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 04:15AM PDT, ID: 21545882

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 04:18AM PDT, ID: 21562885

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628