protected void RadGridAssetExtrasCondition_ItemDataBound(object sender, GridItemEventArgs e) { switch (e.Item.OwnerTableView.Name) { case "AssetExtrasCondition": if (e.Item is GridCommandItem) { Do some stuff here } if (e.Item is GridDataItem) { Do some stuff here } if ((e.Item is GridEditFormItem || e.Item is GridEditFormInsertItem) && e.Item.IsInEditMode) { var ctrlLabelConditionRatingDescription = (Label)e.Item.FindControl("LabelConditionRatingDescription"); var ctrlRadRatingCondition = (RadRating)e.Item.FindControl("RadRatingCondition"); // Creating the Rad Rating stars dynamically foreach (var item in this.ConditionRatings.Items) { var ratingItem = new RadRatingItem { Value = Convert.ToDecimal(item.Rating), ToolTip = item.Rating.ToString() }; ctrlRadRatingCondition.Items.Add(ratingItem); } ctrlRadRatingCondition.Attributes.Add("onclientrated", "alert('hello');"); if (!e.Item.OwnerTableView.IsItemInserted) { Do some stuff here } } break; } }protected void Page_Init() { ConfigureGrid(); } private void ConfigureGrid() { OrderTypeRankingGrid.AddNeedDataSourceEventHandler(NeedDataSource); // Binding master table view OrderTypeRankingGrid.AddGridCommandEventHandler(DataGrid_ItemCommand); // Events for the standard ngm controls OrderTypeRankingGrid.AllowColumnsReorder = false; OrderTypeRankingGrid.GridHeaderText = "Order Type Ranking"; var masterView = OrderTypeRankingGrid.ConfigureMasterTableView("vDivisionOrderTypeRanking", new string[] { "DivisionOrderTypeRankId" }); masterView.AllowFilteringByColumn = true; masterView.AllowSorting = true; masterView.FullEditMode = true; masterView.EditMode = GridEditMode.InPlace; masterView.EnableShowHideColumns = true; masterView.SetPaging(GridPagerMode.NextPrevAndNumeric); masterView.GridTableView.ShowHeader = true; masterView.ShowHeader = true; masterView.ShowFooter = true; masterView.ShowHeadersWhenNoRecords = true; masterView.AllowPaging = true; //Enable standard Ngm controls masterView.AddNgmCommandButton(NgmButtonType.Save, "btnSave", null, null, "Save Function Id", Unit.Pixel(50)); masterView.AddNgmCommandButton(NgmButtonType.Cancel, null, null, null, null, Unit.Pixel(50)); masterView.CommandItemDisplay = GridCommandItemDisplay.Bottom; if (!IsPostBack) //must check for postback; otherwise, columns will be duplicated { //masterView.AddBoundColumn("DivisionOrderTypeRankId", "Rank ID", null, true, false, true, Unit.Percentage(7.0)); masterView.AddBoundColumn("CategoryCode", "Category Code", null, true, false, true, Unit.Percentage(7.0)); masterView.AddBoundColumn("PurposeCode", "Purpose Code", null, true, false, true, Unit.Percentage(7.0)); masterView.AddBoundColumn("ReasonCode", "Reason Code", null, true, false, true, Unit.Percentage(7.0)); masterView.AddBoundColumn("ReasonDescription", "Reason Description", null, true, false, true, Unit.Percentage(7.0)); masterView.AddBoundColumn("OrderTypeRank", "Rank", null, false, false, true, Unit.Percentage(7.0)); } } protected void NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { if (IsPostBack) { if (!e.IsFromDetailTable && (this.productDivision == 1 || this.productDivision == 2)) { IDivisionOrderTypeRankService divisionOrderTypeRankServiceAgent = null; divisionOrderTypeRankServiceAgent = (IDivisionOrderTypeRankService)ContextRegistry.GetContext().GetObject("DivisionOrderTypeRankServiceAgent"); IList<DivisionOrderTypeRankDTO> divisionOrderTypeRankDTOs = divisionOrderTypeRankServiceAgent.GetDivisionOrderTypeRankByDivision(productDivision); OrderTypeRankingGrid.DataSource = divisionOrderTypeRankDTOs; } } }Below code running old version but i have updated version no run now.
function
fileUploaded(sender, args) {
$find(
'RadAjaxManager1').ajaxRequest();
sender.deleteFileInputAt(0);
}
<telerik:radasyncupload runat="server" ID="AsyncUpload1" MaxFileInputsCount="1"
OnClientFileUploaded="fileUploaded" TargetPhysicalFolder="~/Image/Upload"
Width="90px" OverwriteExistingFiles="True" >
<Localization Select="Choose Avatar" />
</telerik:radasyncupload>
Try
' file.Add(e.File)
Dim fileStream As IO.Stream = e.File.InputStream
Dim imageData As Byte() = New Byte(fileStream.Length - 1) {}
fileStream.Read(imageData, 0,
CInt(fileStream.Length))
Thumbnail1.DataValue = imageData
fileStream.Close()
Catch ex As Exception
End Try
