protected void rdbtnYes_Click(object sender, EventArgs e) { foreach (GridDataItem item in RadGrid2.MasterTableView.Items) { if (item.IsInEditMode && item is GridEditableItem) { if (item.OwnerTableView.IsItemInserted) { item.Edit = true; } } //item.Edit = true; } RadGrid2.Rebind(); rdwmdw1.Windows[0].VisibleOnPageLoad = false; }protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e) { int iPagecount = RadGrid2.MasterTableView.CurrentPageIndex; if (e.Item is GridDataItem) { if (iPagecount == 0) { if (e.Item.ItemIndex != 0) { GridDataItem item = (GridDataItem)e.Item; ImageButton imageButton = (ImageButton)item["imgEdit"].Controls[0]; imageButton.Visible = false; //imageButton.ImageUrl = "images/MailOk.png"; } else { GridDataItem item = (GridDataItem)e.Item; ImageButton imageButton = (ImageButton)item["imgEdit"].Controls[0]; imageButton.Visible = true; } } else { GridDataItem item = (GridDataItem)e.Item; ImageButton imageButton = (ImageButton)item["imgEdit"].Controls[0]; imageButton.Visible = false; } } if (e.Item is GridEditableItem && e.Item.IsInEditMode) { GridEditableItem item = e.Item as GridEditableItem; mlocal_strStoredProcName = StoredProcNames.Gender_uspGenderGetList; oEmployeePersonalData.Select(out mlocal_ds, mlocal_strStoredProcName); Label lblStatus = (Label)item.FindControl("lblApprovalStatus1"); if (lblStatus.Text == "Y") { if (!e.Item.OwnerTableView.IsItemInserted) { Label LBL1 = (Label)item.FindControl("lblMaritalStatus"); RadComboBox rdcmbGender = (RadComboBox)item.FindControl("rdcbGender"); rdcmbGender.DataSource = mlocal_ds; rdcmbGender.DataTextField = TablesAndColumns.tblGender_GenderDesc; rdcmbGender.DataValueField = TablesAndColumns.tblGender_GenderTypeID; rdcmbGender.SelectedValue = (string)DataBinder.Eval(e.Item.DataItem, "MaritalTypeID").ToString(); //rdcmbGender.SelectedValue = LBL1.Text; rdcmbGender.DataBind(); mlocal_strStoredProcName = USADAO.StoredProcNames.PayFrequency_uspPayFrequencySelect; oEmployee.FedTaxID = Session["FedTaxID"].ToString(); oEmployee.Select(out mlocal_ds, mlocal_strStoredProcName); RadComboBox ddlPayFrequencytype = (RadComboBox)item.FindControl("rdcbPayFrequency"); ddlPayFrequencytype.DataSource = mlocal_ds; ddlPayFrequencytype.DataTextField = "PayFrequencyDesc"; ddlPayFrequencytype.DataValueField = "PayFrequencyType"; ddlPayFrequencytype.DataBind(); ddlPayFrequencytype.Enabled = false; mlocal_ds.Clear(); RadDatePicker radDtStartDate = item.FindControl("radDtStartDate") as RadDatePicker; RadDatePicker radDtEndDate = item.FindControl("radDtEndDate") as RadDatePicker; strDate = radDtStartDate.SelectedDate.Value; EndDt = radDtEndDate.SelectedDate.Value; } } else { e.Item.Edit = false; rdwmdw1.Windows[0].VisibleOnPageLoad = true; } } }
Hi there I'm having trouble with the following:
I have a web form that has a RadTabStrip and when you click on a tab a webusercontrol gets loaded dynamically. Inside this webusercontrol I have a read-only RadGrid. When I click on a row on this RadGrid another webusercontrol (a 2nd) gets loaded dynamically as well. But this time, this 2nd webusercontrol has an editable RadGrid in it.
PROBLEM:
The problem lies in this 2nd webusercontrol
When I click on the Insert linkbutton, the ItemCommand event fires (e.Command = InitInsert). The RadGrid enters into edit-form. Everything's OK. But when I click on the Update linkbutton, the ItemCommand event doesn't fire! (e.Command = PerformInsert).
Please can someone help me with this issue asap? or shed some light?
Felix
