Hi,
Our application Structure is mentioned below:
1) Master Page header part contains the Rad Menu. On Menu Click Navigates to the respective content page.
2) All our content pages contains the RadGrid
3) We are using WebUserControl for the RadGrid EditForm.
Ref : http://test.aptisys.com/UOMSetup.aspx
I implemented the example with the Need data source, similar to the below mentioned telerik URL, (You can check our url example in http://test.aptisys.com/UOMSetup.aspx for reference).
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/templateformupdate/defaultcs.aspx
Pls reply back to the below Query and send us some example samples:
In the RadGrid disabled the EnableViewState="false", when i tried to read the value from the webusercontrol edit form from the code behind content page, while implementing the InsertCommand to insert uom_code, uom_name and uom_desc values returns the empty string from the web user control.
1) How to insert the value using the InsertCommand when the viewstate is set to false?
2) What is the syntex to retrieve value from the webusercontrol edit form to assign to the respective table column in the insert command method?
3) What is the workaround to overcome this problem?
4) Could you please send us some example how to implement the need data source to insert, update and delete command when enable view state is set to false?
5) If i implement the heirarchy grid using the Need Data Source with Web User Control as edit form and set the Enable view state = false, does the second level of the heirarchy grid supports Grouping, Sorting, Filtering? Could you please send us some example for the scenario implemented using the need data source with Enable View State is set to false?
protected void RadGUOM_InsertCommand(object source, GridCommandEventArgs e)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
//Create new row in the DataSource
DataRow newRow = this.UOMCode.NewRow();
//Insert new values
Hashtable newValues = new Hashtable();
newValues["uom_code"] = (userControl.FindControl("txtUcode") as TextBox).Text; (*Returns empty string)
newValues["uom_name"] = (userControl.FindControl("txtUName") as TextBox).Text;(*Returns empty string)
newValues["uom_desc"] = (userControl.FindControl("txtUdesc") as TextBox).Text;(*Returns empty string)
//make sure that unique primary key value is generated for the inserted row
// newValues["EmployeeID"] = (int)this.Employees.Rows[this.Employees.Rows.Count - 1]["EmployeeID"] + 1;
try
{
foreach (DictionaryEntry entry in newValues)
{
newRow[(string)entry.Key] = entry.Value;
}
this.UOMCode.Rows.Add(newRow);
this.UOMCode.AcceptChanges();
}
catch (Exception ex)
{
Label lblError = new Label();
lblError.Text = "Unable to insert Employees. Reason: " + ex.Message;
lblError.ForeColor = System.Drawing.Color.Red;
RadGUOM.Controls.Add(lblError);
e.Canceled = true;
}
//RadGUOM.DataSource = null;
//RadGUOM.Rebind();
}
Our application Structure is mentioned below:
1) Master Page header part contains the Rad Menu. On Menu Click Navigates to the respective content page.
2) All our content pages contains the RadGrid
3) We are using WebUserControl for the RadGrid EditForm.
Ref : http://test.aptisys.com/UOMSetup.aspx
I implemented the example with the Need data source, similar to the below mentioned telerik URL, (You can check our url example in http://test.aptisys.com/UOMSetup.aspx for reference).
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/templateformupdate/defaultcs.aspx
Pls reply back to the below Query and send us some example samples:
In the RadGrid disabled the EnableViewState="false", when i tried to read the value from the webusercontrol edit form from the code behind content page, while implementing the InsertCommand to insert uom_code, uom_name and uom_desc values returns the empty string from the web user control.
1) How to insert the value using the InsertCommand when the viewstate is set to false?
2) What is the syntex to retrieve value from the webusercontrol edit form to assign to the respective table column in the insert command method?
3) What is the workaround to overcome this problem?
4) Could you please send us some example how to implement the need data source to insert, update and delete command when enable view state is set to false?
5) If i implement the heirarchy grid using the Need Data Source with Web User Control as edit form and set the Enable view state = false, does the second level of the heirarchy grid supports Grouping, Sorting, Filtering? Could you please send us some example for the scenario implemented using the need data source with Enable View State is set to false?
protected void RadGUOM_InsertCommand(object source, GridCommandEventArgs e)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
//Create new row in the DataSource
DataRow newRow = this.UOMCode.NewRow();
//Insert new values
Hashtable newValues = new Hashtable();
newValues["uom_code"] = (userControl.FindControl("txtUcode") as TextBox).Text; (*Returns empty string)
newValues["uom_name"] = (userControl.FindControl("txtUName") as TextBox).Text;(*Returns empty string)
newValues["uom_desc"] = (userControl.FindControl("txtUdesc") as TextBox).Text;(*Returns empty string)
//make sure that unique primary key value is generated for the inserted row
// newValues["EmployeeID"] = (int)this.Employees.Rows[this.Employees.Rows.Count - 1]["EmployeeID"] + 1;
try
{
foreach (DictionaryEntry entry in newValues)
{
newRow[(string)entry.Key] = entry.Value;
}
this.UOMCode.Rows.Add(newRow);
this.UOMCode.AcceptChanges();
}
catch (Exception ex)
{
Label lblError = new Label();
lblError.Text = "Unable to insert Employees. Reason: " + ex.Message;
lblError.ForeColor = System.Drawing.Color.Red;
RadGUOM.Controls.Add(lblError);
e.Canceled = true;
}
//RadGUOM.DataSource = null;
//RadGUOM.Rebind();
}