frnds i m not getting first item of listbox details but i m getting otherthan first item listbox details when i click..on item in listbox. for loading values i m using below code..
[code=cpp]
public void bindinglistbox( )
{
DataTable dataoffices;
dataoffices = obj.getoffices( );
LTB_Existingoff ices.DataBindin gs.Clear();
LTB_Existingoff ices.DataBindin gs.Add("Text", States3, "LongName3" );
LTB_Existingoff ices.DataSource = dataoffices.Def aultView;
//LTB_Existingoff ices.SelectedIn dex = 0;
LTB_Existingoff ices.DisplayMem ber = dataoffices.Col umns["Name"].ToString();
LTB_Existingoff ices.ValueMembe r = dataoffices.Col umns["id"].ToString();
}
for getting valuemember i m using this code..........
private void LTB_Existingoff ices_SelectedVa lueChanged(obje ct sender, EventArgs e)
{
//if ((LTB_Existingo ffices.Selected Index) >= (LTB_Existingof fices.Items.Cou nt-1) )
//{
// LTB_Existingoff ices.SelectedIn dex = 0;
if ((LTB_Existingo ffices.Selected Index) > 0)
{
string myid;
myid = (LTB_Existingof fices.SelectedV alue.ToString() );
officeid = (Convert.ToInt3 2(myid));
BTN_SAVE.Text = "Update";
BTN_Del.Enabled = true;
binding();
//}
//else
//{
// LTB_Existingoff ices.SelectedIn dex += 1;
//}
}
}
[/code]
any one plz Help me ........
[code=cpp]
public void bindinglistbox( )
{
DataTable dataoffices;
dataoffices = obj.getoffices( );
LTB_Existingoff ices.DataBindin gs.Clear();
LTB_Existingoff ices.DataBindin gs.Add("Text", States3, "LongName3" );
LTB_Existingoff ices.DataSource = dataoffices.Def aultView;
//LTB_Existingoff ices.SelectedIn dex = 0;
LTB_Existingoff ices.DisplayMem ber = dataoffices.Col umns["Name"].ToString();
LTB_Existingoff ices.ValueMembe r = dataoffices.Col umns["id"].ToString();
}
for getting valuemember i m using this code..........
private void LTB_Existingoff ices_SelectedVa lueChanged(obje ct sender, EventArgs e)
{
//if ((LTB_Existingo ffices.Selected Index) >= (LTB_Existingof fices.Items.Cou nt-1) )
//{
// LTB_Existingoff ices.SelectedIn dex = 0;
if ((LTB_Existingo ffices.Selected Index) > 0)
{
string myid;
myid = (LTB_Existingof fices.SelectedV alue.ToString() );
officeid = (Convert.ToInt3 2(myid));
BTN_SAVE.Text = "Update";
BTN_Del.Enabled = true;
binding();
//}
//else
//{
// LTB_Existingoff ices.SelectedIn dex += 1;
//}
}
}
[/code]
any one plz Help me ........
Comment