I am Not able to fire selected index changed event.
I am retreiving previous combo box selected index
(string selectedstore_name = cmbRestaurant.Items[cmbRestaurant.SelectedIndex].ToString();)
but don't know how
i can use the same. Can someone guide me further with the same.

4 solutions

Solution 3

You can remove all the code from xxx_SelectedIndexChanged events and make it different methods and call these methods on these xxx_SelectedIndexChanged event . Then you can get the selected value of combo using folowing code....

int selectedstore = cmbRestaurant.SelectedValue;

You can input this selected value to the next method and fetch related records only, (write the methods with appropriate parameters) and fill the next combo. This way you may be able to solve your problem.

No control & the event(cmbRestaurant_SelectedIndexChanged) are perfectly sync but on cmbRestaurant_SelectedIndexChanged i want 'cmbServiceWindow' combobox should be filled with only 'sw_name' but here all the comboboxes are populated when i select the index of (cmbRestaurant_SelectedIndexChanged) event.

Solution 4

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
using System.Data.SqlClient;
using Microsoft.CSharp;
using Excel = Microsoft.Office.Interop.Excel;

Solution 2

All the four Comboboxes are loading at a time (restaurant,service window,Equipments and subsystems) but i want toload them one by one.
On restaurant selected index change service window should be loaded like that.