| function FindCombo(idCombo){ |
| var combo = $find(idCombo); |
| combo.set_text("Here I am!"); |
| } |
| var MyObject = new Object(); |
| MyObject.combo = $find("MyComboId"); |
| void OnPartAliasesItemCreated(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridEditableItem && e.Item.IsInEditMode) |
| { |
| GridEditableItem item = e.Item as GridEditableItem; |
| TextBox tbPartAlias = item.FindControl("tbPartAlias") as TextBox; |
| Label lblPartAliasValue = item.FindControl("lblPartAliasValue") as Label; |
| TextBox tbRetailList = item.FindControl("tbRetailList") as TextBox; |
| DropDownList ddlProductLine = item.FindControl("ddlProductLine") as DropDownList; |
| CheckBox cbDisplayOnRetail = item.FindControl("cbDisplayOnRetail") as CheckBox; |
| CheckBox cbRetailSpotlight = item.FindControl("cbRetailSpotlight") as CheckBox; |
| CheckBox cbDisplayOnWholesale = item.FindControl("cbDisplayOnWholesale") as CheckBox; |
| CheckBox cbListOnInfopia = item.FindControl("cbListOnInfopia") as CheckBox; |
| CheckBox cbBMWClearanceItem = item.FindControl("cbBMWClearanceItem") as CheckBox; |
| CheckBox cbSaabClearanceItem = item.FindControl("cbSaabClearanceItem") as CheckBox; |
| CheckBox cbVolvoClearanceItem = item.FindControl("cbVolvoClearanceItem") as CheckBox; |
| ddlProductLine.DataSource = App.Core.BusinessObjects.Part.FindAllProductLines(); |
| ddlProductLine.DataBind(); |
| if (e.Item.DataItem is App.Core.BusinessObjects.Part) |
| { |
| App.Core.BusinessObjects.Part partAlias = e.Item.DataItem as App.Core.BusinessObjects.Part; |
| lblPartAliasValue.Visible = true; |
| tbPartAlias.Visible = false; |
| lblPartAliasValue.Text = partAlias.PartAlias; |
| ddlProductLine.ClearSelection(); |
| ListItem productLine = ddlProductLine.Items.FindByValue(partAlias.ProductLine); |
| if (productLine != null) |
| productLine.Selected = true; |
| cbDisplayOnRetail.Checked = partAlias.DisplayOnRetail; |
| cbRetailSpotlight.Checked = partAlias.ShowInRetailSpotLight; |
| cbDisplayOnWholesale.Checked = partAlias.DisplayOnWholeSale; |
| cbListOnInfopia.Checked = partAlias.ListOnInfopia; |
| cbBMWClearanceItem.Checked = partAlias.IsBMWClearanceItem; |
| cbSaabClearanceItem.Checked = partAlias.IsSaabClearanceItem; |
| cbVolvoClearanceItem.Checked = partAlias.IsVolvoClearanceItem; |
| if (!partAlias.IsAlias) |
| { |
| Label lblRetailListValue = item.FindControl("lblRetailListValue") as Label; |
| Label lblProductLineValue = item.FindControl("lblProductLineValue") as Label; |
| lblPartAliasValue.Visible = true; |
| tbPartAlias.Visible = false; |
| lblPartAliasValue.Text = partAlias.PartAlias; |
| lblRetailListValue.Visible = true; |
| tbRetailList.Visible = false; |
| lblRetailListValue.Text = partAlias.UnitPrice.ToString("c"); |
| lblProductLineValue.Visible = true; |
| ddlProductLine.Visible = false; |
| lblProductLineValue.Text = partAlias.ProductLine; |
| } |
| } |
| } |
| } |
Hello,
I have a Grid whose editmode="forms". I am doing some server-side validation on the item Insert and Update events. I am not using a "DataSource", but instead binding directly to a collection of objects. What I am having trouble with is that if the inserted/updated item is not valid, I want to keep that row in edit view. My code for the Update event is as follows:
| void OnPartAliasesUpdateCommand(object source, GridCommandEventArgs e) |
| { |
| GridEditableItem item = e.Item as GridEditableItem; |
| string partCode = item.OwnerTableView.DataKeyValues[item.ItemIndex]["PartAlias"].ToString(); |
| App.Core.BusinessObjects.Part partAlias = PartAliases[partCode]; |
| RetrievePartAliasForm(item, partAlias); |
| if (!ValidatePartAliasForm(partAlias)) |
| { |
| ccPartAliasStatusLabel.AddErrors(base.Rules); |
| return; |
| } |
| PartAliases[partAlias.PartAlias] = partAlias; |
| rdgPartAliases.Rebind(); |
| } |

I think this should be fairly easy to solve and I'm missing something obvious but after combing through the forums and tutorials and not finding a reasonable solution I figured I'd just post the questions.
I have a situation where I am loading controls with LoadControl after the initial page load. I've broken this down into two issues:
http://www.telerik.com/community/forums/thread/b311D-kbkmc.aspx talks about pointing to the skin directly. I'm using Prometheus and while I suppose I can copy the Skins directory into my application instead of using the embedded skins I'm not thrilled about having thousands of files in source control when they're already in the dll. Is there a simple way to point to the skin directly or otherwise make the application load the skin if I load a control via LoadControl & Ajax AFTER the page has already been presented on the client?
Simple scenario -- the page is intially loaded with an asp:Panel that is populated by clicking a button that uses the RadAjaxManager to get the content for the Panel. The content that comes back is from a control that is loaded via LoadControl and of course also contains various Telerik controls. Obvious problem here is that the RadScriptManager and RadStyleSheetManager were present in the original page but that page was already rendered on the client. There doesn't seem to be an obvious way to register the newly loaded control with. I've looked at what feels like 100's of examples of using LoadControl but they all seem to deal with using it prior to the intial page being displayed rather than after an ajax call.
Thanks for all your assistance on this -- it's driving me nuts! :-)
Matt