Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6598499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:21:23+00:00 2026-05-25T18:21:23+00:00

Just starting to look into using LinqDataSource for a GridView and I’m looking for

  • 0

Just starting to look into using LinqDataSource for a GridView and I’m looking for a few more examples on how to set up my data source.

I am hoping later on to use it against a SharePoint List but for now I’m simply after some detailed examples for a class that I can retrieve data from and update.

Here is an example class from MS. I just after more than one example so i have better idea how this work.

A Simple example that is known to work and is a little more complicated would be great

public class MovieLibrary
{
        string[] _availableGenres = { "Comedy", "Drama", "Romance" };

        public MovieLibrary()
        {
        }

        public string[] AvailableGenres
        {
            get
            {
                return _availableGenres;
            }
        }
    }

Cheers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:21:24+00:00Added an answer on May 25, 2026 at 6:21 pm

    I’m using LinqDataSource with SPGridView here is my code.

          <SharePoint:SPGridView runat="server" ID="spgvUserTrainingLists" AutoGenerateColumns="false"
                                    DataSourceID="linqDsEmployeeTrainingLists" DataKeyNames="RowId" OnRowDataBound="spgvUserTrainingLists_RowDataBound"
                                    AllowSorting="true" AllowPaging="true" PageSize="15" AllowFiltering="true" FilteredDataSourcePropertyName="Where"
                                    FilteredDataSourcePropertyFormat='{1} == "{0}"' FilterDataFields=",TrainingType,,Trainer,Status">
                                    <Columns>
                                        <SharePoint:SPBoundField HeaderText="Ref #" SortExpression="RefNo" DataField="RefNo" />
                                        <SharePoint:SPBoundField HeaderText="Type" SortExpression="TrainingType" DataField="TrainingType" />
                                        <asp:TemplateField HeaderText="Training" SortExpression="TrainingTitle">
                                            <ItemTemplate>
                                                <asp:HyperLink ID="hlTrainingDetail" runat="server" Text='<%# Eval("TrainingTitle") %>'
                                                    NavigateUrl="#" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <SharePoint:SPBoundField HeaderText="Trainer" SortExpression="Trainer" DataField="Trainer" />
                                        <SharePoint:SPBoundField HeaderText="Status" SortExpression="Status" DataField="Status" />
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <asp:ImageButton ID="imgDelete" ImageUrl="~/_layouts/images/DELITEM.GIF" runat="server"
                                                    UseSubmitBehaviour="false" CommandValue='<%# Eval("RowId") %>' OnClientClick="javascript:DeleteTraining(this);" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <EmptyDataTemplate>
                                        No training yet.
                                    </EmptyDataTemplate>
                                </SharePoint:SPGridView>
                                <SharePoint:SPGridViewPager ID="SPGridViewPager1" runat="server" GridViewId="spgvUserTrainingLists" />
                                <aspweb:LinqDataSource runat="server" ID="linqDsEmployeeTrainingLists" OnSelecting="linqDs_Selecting" />
    

    In the LinqDataSource Selecting event is where the data binding happened

    protected void linqDs_Selecting(object sender, LinqDataSourceSelectEventArgs e)
        {
            object parameter = null;
    
            if (e.SelectParameters.TryGetValue("employee", out parameter))
            {
                e.Result = DefaultBLL.GetEmployeeTrainingLists(parameter.ToString());
            }
        }
    
    
    Hope this help.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just starting to look into using LINQ for my database (and XML, and
My company is just starting to look at using WPF for migrating all of
Just starting to look into WCF and came across the WSDualHttpBinding binding. I have
I'm just starting to look into Futures and the ScheduledExecutorService in Java, and I'm
Just starting out with subversion, have set up repos for 3 current projects and
Just starting to learn ASP.NET (C#) and I am using Visual Studio 2008. I
I am starting to have a look at Core Data, as many claiming is
I'm just starting to get into JQuery so I apologize in advance if this
I'm just starting to dive into some basic Android development and have been experimenting
I'm just starting to get into backbone.js. It looks like it's pretty involved and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.