Hi
How do I stop the databinding process in my grid when switching to insert mode?
My RadGrid has 1 ItemTemplate column and 1 EditFormSettings FormTemplate column. I therefore only have standard controls in the templates with usual data binding expressions eg <%# Bind(" StoreName") %>
The idea is to use RadGrid similarly to asp:FormView in that I only show/edit/insert 1 record at a time in a Form format as opposed to rows/tabular format.
When the user selects an option (eg store name) from an external dropdownlist it triggers the grid to retrieve the store details from a datasource.
When the user clicks Edit command button, the grid switches to Edit form.
I have an Insert LinkButton that sits outside of the grid which turns the form to an empty data entry form for insertion. Its event handler below:
protected void imgAddStore_Clicked(object sender, EventArgs e) {
gridDetailsStore.MasterTableView.IsItemInserted = true;
gridDetailsStore.DataBind();
}
After messing around, I found that I had to call DataBind() (per above) on the grid to make the Insert form appears in place of the View form.
However, this also goes through the Select Command and reloads the record.
Because I hide the item template column to only show the Insert form when in Insert mode, I do not want the Select Command to execute because it's redundant when I am inserting a new record.
How do i stop the Select Command to execute?
Thanks for your help.