Getting selected value of a combobox

Try this: private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { ComboBox cmb = (ComboBox)sender; int selectedIndex = cmb.SelectedIndex; int selectedValue = (int)cmb.SelectedValue; ComboboxItem selectedCar = (ComboboxItem)cmb.SelectedItem; MessageBox.Show(String.Format(“Index: [{0}] CarName={1}; Value={2}”, selectedIndex, selectedCar.Text, selecteVal)); }

How to implement full row selecting in GridView without select button?

You must add this on every postback and not only on databinding. Therefore you should use the RowCreated-Event of the GridView. For example (C#): protected void GridView1_RowCreated(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes[“onmouseover”] = “this.style.cursor=”pointer”;this.style.textDecoration=’underline’;”; e.Row.Attributes[“onmouseout”] = “this.style.textDecoration=’none’;”; e.Row.ToolTip = “Click to select row”; e.Row.Attributes[“onclick”] = this.Page.ClientScript.GetPostBackClientHyperlink(this.GridView1, “Select$” + e.Row.RowIndex); } … Read more