Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

combobox selected changed event in wpf c#

In this post , I explained how to
Bind Combobox windows application, and selection Changed Event source code.


using System;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Text;
usingSystem.Windows.Forms;
usingTelerik.WinControls;

namespace company
{
    public partial class Receipts : Telerik.WinControls.UI.RadForm
    {
        publicReceipts()
        {
            InitializeComponent();
        }

  private void cmbChit_SelectionChangeCommitted(object sender, EventArgse)
        {
            if(cmbChit.SelectedIndex > 0)
            {
                SqlDataAdapterda = new SqlDataAdapter("select * from MASTER where CODE='" + cmbChit.SelectedValue + "'", con);
                DataSetds = new DataSet();
                da.Fill(ds, "Details");
                if(ds.Tables[0].Rows.Count > 0)
                {
                    txtChitAmount.Text = ds.Tables[0].Rows[0]["AMOUNT"].ToString();
                    txtBidDay.Text = ds.Tables[0].Rows[0]["DAY_OF_BID"].ToString();
                    txtChitName.Text = ds.Tables[0].Rows[0]["NAME"].ToString();
                }
            }
            else
            {
                txtChitAmount.Clear();
                txtBidDay.Clear();
                txtChitName.Clear();
            }
        }    }
}




This post first appeared on Asp.netSourceCodes, please read the originial post: here

Share the post

combobox selected changed event in wpf c#

×

Subscribe to Asp.netsourcecodes

Get updates delivered right to your inbox!

Thank you for your subscription

×