>>private void _LoadList() >>{ >> DataLayer.ProviderInvariantName = "System.Data.SqlClient"; >> DataLayer.ConnectionString = ConfigurationManager.ConnectionStrings["ApexGlobalConnectionString"].ConnectionString; >> >> dsRoles = DataLayer.ExecuteQuery("as_GetRole", CommandType.StoredProcedure); >> >> lstRoles.DataSource = dsRoles.Tables[0]; >> lstRoles.DataTextField = "RoleName"; >> lstRoles.DataBind(); >>} >> >>>>
lstRoles.Rows = dsRoles.Tables[0].Rows.Count;ya, but what if I don't want the size to change. This code you provided is what I'm already seeing, except I'm nto doin that anywhere.
<asp:ListBox ID="lstRoles" Height="100%" Width="100%" runat="server" AutoPostBack = "true" OnSelectedIndexChanged="lstRoles_SelectedIndexChanged"></asp:ListBox>Changed it to
<asp:ListBox ID="ListBox1" Height="200" Width="100%" runat="server" AutoPostBack = "true" OnSelectedIndexChanged="lstRoles_SelectedIndexChanged"></asp:ListBox>