I have a datagridview
which is bind from a bindingsource
I really try to find out how onclick row on datagridview
the row data fill in the TextBox. Because I want to show some data on combobox according selection on datagridview. My code for bind the datagridview is below
private void FillGrid()
{
if (_fisComp == null)
_fisComp = new FiscalComponent();
List<FiscalPeriod> _fisPeriod = _fisComp.GetAllByFiscalPeriod(Convert.ToString(fiscalYearComboBox.SelectedValue));
fiscalPeriodBindingSource.DataSource = _fisPeriod;
fiscalPeriodDataGridView.Refresh();
}
I am binding my datagridview by list<> type . The problem is that I am getting data from my stored procedure Y~
N` and i want to display in combobox in Yes or No
This code is where I am binding my combobox
public void FillDropdown()
{
var itemsleaverun = new BindingList<KeyValuePair<string, string>>();
itemsleaverun.Add(new KeyValuePair<string, string>("Y", "Yes"));
itemsleaverun.Add(new KeyValuePair<string, string>("N", "No"));
leaveRunTypeComboBox.DataSource = itemsleaverun;
leaveRunTypeComboBox.ValueMember = "Key";
leaveRunTypeComboBox.DisplayMember = "Value";
leaveRunTypeComboBox.SelectedIndex = 0;
}