日期:2014-05-17 浏览次数:20502 次
...
<dxwgv:GridViewDataColumn FieldName="PictureUpload" VisibleIndex="13" Visible="False" Caption ="图片">
<EditItemTemplate>
<dxuc:ASPxUploadControl ID="uplImage" runat="server" ClientInstanceName="uplImage" Size="35" OnFileUploadComplete="uplImage_FileUploadComplete">
</dxuc:ASPxUploadControl>
</EditItemTemplate>
<EditFormSettings VisibleIndex="13" Visible="True"/>
<EditFormCaptionStyle Wrap="False">
</EditFormCaptionStyle>
</dxwgv:GridViewDataColumn>
...
protected void ASPxGridDetail_RowUpdated(object sender, DevExpress.Web.Data.ASPxDataUpdatedEventArgs e)
{
bool isEdit = ASPxGridDetail.IsEditing;
//ASPxUploadControl f = (ASPxUploadControl)ASPxGridDetail.TemplateControl.FindControl("uplImage");
//ASPxUploadControl file = (ASPxUploadControl)(ASPxGridDetail.Columns["PictureUpload"].Grid.TemplateControl.FindControl("uplImage"));
//ASPxUploadControl f = (ASPxUploadControl)this.ASPxGridDetail.TemplateControl.FindControl("uplImage");
//GridViewDataColumn gird = (GridViewDataColumn)ASPxGridDetail.Columns["PictureUpload"] ;
//foreach (TemplateControl ctrl in gird.Grid.TemplateControl)
//{
// string ctrlName = ctrl.ToString();
//}
//ASPxUploadControl f = (ASPxUploadControl)ASPxGridDetail.FindEditRowCellTemplateControl(gird , "uplImage");
string filename = f.FileName;
string UpdateLog = "Id=" + e.Keys["Id"].ToString();
DataAccess.SystemLog.InsertLogInfo(LoggingType.Update, "库存管理", "仓库类型维护", UpdateLog);
}
ASPxUploadControl f=((ASPxTextBox)this.ASPxGridView_ID.FindRowCellTemplateControl(0, this.ASPxGridView_ID.Columns["PictureUpload"] as GridViewDataColumn, "uplImage"));