I am doing inline edit in "Prometheus" RagGrid,
I m trying to fill Dropdownlist at runtime when its been click for add new record,
I used ItemDataBound event but problem is that, it's been called when i do edit and also with insert
i kind of want only when its been clicked "add new record"
Any one know that how to check command = edit or insert in Itemdatabound () event
protected void RadGridSpecialty_ItemDataBound1(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditManager editMan = editedItem.EditManager;
GridDropDownColumnEditor editor = editMan.GetColumnEditor("ddlGridSepcialty") as GridDropDownColumnEditor;
//// My logic not related to Error
strSelect =
"select SpecialtyID, SpecialtyName from sl_Specialty where SpecialtyID NOT IN (1,3)";
DataSet dst = new DataSet();
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]);
SqlCommand cnn = new SqlCommand(strSelect, con);
SqlDataAdapter adp = new SqlDataAdapter(cnn);
adp.Fill(dst);
editor.DataSource = dst.Tables[0];
editor.DataBind();
}
}