Hi all,
I am new one for telerik controlls, my scenario is following
i have one mater grid and its detail grid and both gird have EditFormTemplete it means i want to add, update both master and details tablse through editform templete fields, and i have bound master and details gird with entityDataSource object control so i want to insert through EntityDataSource Object onInsert Event . i wrote insert event of entity data source like this and it works fine
protected void OnAllMembersInserting(object sender, EntityDataSourceChangingEventArgs e)
{
try
{
GridEditFormItem editedItem = (GridEditFormItem)(rg_AllMembers.MasterTableView.GetItems(GridItemType.EditFormItem)[0]);
if (editedItem != null)
{
DAL.UserProfile uP = (DAL.UserProfile)e.Entity;
uP.RoleName = (editedItem.FindControl("rdbtnRegisterAs") as RadioButtonList).SelectedIndex.Equals(0) ? HunchClub.Common.Constants.RoleNames.Bidders : HunchClub.Common.Constants.RoleNames.Sellers;
uP.RegisteredDate = DateTime.UtcNow;
uP.RegisteredIPAddress = Common.Utility.Operations.GetUserIPAddress();
uP.islock = (editedItem.FindControl("chkIsLock") as CheckBox).Checked;
BLL.BO.Profile.Members m = new BLL.BO.Profile.Members();
string[] outMessage = new string[] { };
string UserID = HunchClub.BLL.BO.Profile.aspMembership.CreateNewUser(uP.PrimaryEmailAddress, (editedItem.FindControl("txtPassword") as RadTextBox).Text, uP.PrimaryEmailAddress, true, out outMessage);//isApprove is false until user verify email address
if (!string.IsNullOrEmpty(UserID))
{
HunchClub.BLL.BO.Profile.aspMembership.AddUserToRole(uP.PrimaryEmailAddress, uP.RoleName);
uP.ID = Guid.Parse(UserID);
}
}
}
so how can i find such fields on update when i write this line for finding controls
GridEditFormItem editedItem = (GridEditFormItem)(rg_AllMembers.MasterTableView.GetItems(GridItemType.EditFormItem)[0]);
it gives all null controls
is there any one can help me how can i find master and details editforms fiedls with sample code
I am new one for telerik controlls, my scenario is following
i have one mater grid and its detail grid and both gird have EditFormTemplete it means i want to add, update both master and details tablse through editform templete fields, and i have bound master and details gird with entityDataSource object control so i want to insert through EntityDataSource Object onInsert Event . i wrote insert event of entity data source like this and it works fine
protected void OnAllMembersInserting(object sender, EntityDataSourceChangingEventArgs e)
{
try
{
GridEditFormItem editedItem = (GridEditFormItem)(rg_AllMembers.MasterTableView.GetItems(GridItemType.EditFormItem)[0]);
if (editedItem != null)
{
DAL.UserProfile uP = (DAL.UserProfile)e.Entity;
uP.RoleName = (editedItem.FindControl("rdbtnRegisterAs") as RadioButtonList).SelectedIndex.Equals(0) ? HunchClub.Common.Constants.RoleNames.Bidders : HunchClub.Common.Constants.RoleNames.Sellers;
uP.RegisteredDate = DateTime.UtcNow;
uP.RegisteredIPAddress = Common.Utility.Operations.GetUserIPAddress();
uP.islock = (editedItem.FindControl("chkIsLock") as CheckBox).Checked;
BLL.BO.Profile.Members m = new BLL.BO.Profile.Members();
string[] outMessage = new string[] { };
string UserID = HunchClub.BLL.BO.Profile.aspMembership.CreateNewUser(uP.PrimaryEmailAddress, (editedItem.FindControl("txtPassword") as RadTextBox).Text, uP.PrimaryEmailAddress, true, out outMessage);//isApprove is false until user verify email address
if (!string.IsNullOrEmpty(UserID))
{
HunchClub.BLL.BO.Profile.aspMembership.AddUserToRole(uP.PrimaryEmailAddress, uP.RoleName);
uP.ID = Guid.Parse(UserID);
}
}
}
so how can i find such fields on update when i write this line for finding controls
GridEditFormItem editedItem = (GridEditFormItem)(rg_AllMembers.MasterTableView.GetItems(GridItemType.EditFormItem)[0]);
it gives all null controls
is there any one can help me how can i find master and details editforms fiedls with sample code