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 6333759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:31:33+00:00 2026-05-24T18:31:33+00:00

i use 3-Tiers Application. I have created Data acces layer and Business Layer. How

  • 0

i use 3-Tiers Application. I have created Data acces layer and Business Layer. How can i bind this with my Datagrid on View layer ?

public partial class Magasinier : Form
{
    Magasinier_BL oMag_BL = new Magasinier_BL();

    public Magasinier()
    {
        InitializeComponent();
        GetDataOrdre();
    }

    public void GetDataOrdre()
    {            
        dataGridView_Mag.DataSource = oMag_BL.Get_All_Magasinier_BL();
        dataGridView_Mag.DataMember = "MagTable";
    }


}

  private void Del_Mag(object sender, DataGridViewRowCancelEventArgs e)
    {
        if (!e.Row.IsNewRow)
        {
            DialogResult res = MessageBox.Show("Etes-vous sûr de vouloir supprimer cette ligne ?", "confirmation suppression",
                     MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (res == DialogResult.No)
            {
                e.Cancel = true;
            }
            else
            {
                oMag_BL.DelMag_BL(e.Row.Cells["CODE_MAG"].Value.ToString());
            }

        }
    }

i have done the Read and Delete, but not Create and Update.

How can i cable these Create and Update to my businnes layer, by the way, how can i retrive NEW row value or CHANGE row value.

these what i did in ASP.NET: Create

 protected void Insrting_Obj_ClientMag(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
{
    Pers_Magasinier oPersMag = new Pers_Magasinier();
    oPersMag.NoClient = Id;
    oPersMag.CodeMag = e.NewValues["CODE_MAG"].ToString();
    oPersMag.NomUsr = e.NewValues["NOM"].ToString();
    oPersMag.PrenomUsr = e.NewValues["PRENOM"].ToString();
    oPersMag.MemoMag = e.NewValues["MEMO"].ToString();

    oMag_BL.InstUpdtMag_BL(oPersMag, true);       

    //To Stop processing Gridview
    ASPxGridView_Mag.CancelEdit();
    e.Cancel = true;

    //Rebind donne
    GetDataMags();
}

and Update:

protected void Updting_Obj_ClientMag(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
{
    Pers_Magasinier oPersMag = new Pers_Magasinier();
    oPersMag.NoClient = Id;
    oPersMag.CodeMag = e.NewValues["CODE_MAG"].ToString();
    oPersMag.NomUsr = e.NewValues["NOM"].ToString();
    oPersMag.PrenomUsr = e.NewValues["PRENOM"].ToString();
    oPersMag.MemoMag = e.NewValues["MEMO"].ToString();

    oMag_BL.InstUpdtMag_BL(oPersMag, false);      

    ASPxGridView_Mag.CancelEdit();
    e.Cancel = true;
    GetDataMags();
}

Now how can i do that in WinForm ?

Thanks you in advance

  • 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-24T18:31:34+00:00Added an answer on May 24, 2026 at 6:31 pm

    Update:
    To get Create/Update working, you usually use Grid RowEditTemplate control (which basically is another WinForm which allows you to do extra validation and create/update existing values). Infragistics got good one.

    1. You will need to make sure you are using BindingSource with your Grid so that when you update the item in your Collection, it automatically gets updated in the Grid
    2. You will also need to make sure your BusinessObject/DomainModel/CollectionItem implements INotifyPropertyChanged, so that when you update the values within your business layer, it gets updated in the grid automatically
    3. When you click on Create/Update button, it will load existing values (if updating, otherwise new default values) into Row Edit Template Control
    4. When hit Submit Create, it will create new BusinessObject and add this into your Collection. as you collection is bound to the grid, Grid will automatically get refreshed.
    5. Same with Submit Update, if you updating the same references object in the collection, any update should get reflected in the Grid

    you might need to fix your tags, because you are talking about ASP and not WinForms.

    I am using Telerik’s Grid with ASP MVC 2 atm. Helps a lot with serializing your data into the ViewModel and you work with ViewModel in your Controllers (dont have to mess around with Request.Params most of the time).

    See Telerik Grid and
    ASP MVC

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my web application, I create some framework that use to bind model data
I have created a C# Windows Forms application which I've attempted to make as
We have a typical multi-tier/layer architecture. Application + WCF Service + Repository/EF4/Database. We are
How do you pass data to layers in an n-tier application? I have mapped
I have a multi-tier application. DAL -> BAL -> Business Gateway ->UI. If a
I use a System.Timers.Timer in my Asp.Net application and I need to use the
I have a specific question, that could use a general answer... When building Multi-Tier
Use case: 3rd party application wants to programatically monitor a text file being generated
use this website a lot but first time posting. My program creates a number
Currently, we use NHibernate to map business objects to database tables. Said business objects

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.