Sep 15, 2012, 9:26 AM
FileUploadField : Inside a grid File Upload Field is not working.
Hello,
Specification :
I am using Ext.net 1.3 version. Visual studio 2008, Sql 2005
Issue Description
I have an issue of FileUploadField inside a grid. I am telling you whole scenario, I have grid in which user can add n number of row. row contain Name of file and Attachment i.e.( FileUploadField ) Once he add Attachement into grid and click to the save I need attachment at back end so i have written as follows..
Specification :
I am using Ext.net 1.3 version. Visual studio 2008, Sql 2005
Issue Description
I have an issue of FileUploadField inside a grid. I am telling you whole scenario, I have grid in which user can add n number of row. row contain Name of file and Attachment i.e.( FileUploadField ) Once he add Attachement into grid and click to the save I need attachment at back end so i have written as follows..
<ext:GridPanel ID="gridAttachments" Height="200" runat="server" AutoWidth="true">
<Store>
<ext:Store ID="storeAttachments" runat="server">
<Reader>
<ext:JsonReader IDProperty="NITAttachmentID">
<Fields>
<ext:RecordField Name="NITAttachmentID" />
<ext:RecordField Name="NITID" />
<ext:RecordField Name="Title" />
<ext:RecordField Name="AttachmentName" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<Plugins>
<ext:EditableGrid ID="EditableGrid4" runat="server">
</ext:EditableGrid>
</Plugins>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel5" runat="server" SingleSelect="true" />
</SelectionModel>
<ColumnModel>
<Columns>
<ext:RowNumbererColumn />
<ext:Column ColumnID="colSelectAttachment" Align="Center" DataIndex="" Header="Select"
Width="40">
<Editor>
<ext:Checkbox ID="Checkbox3" DataIndex="" runat="server" />
</Editor>
</ext:Column>
<ext:Column DataIndex="Title" ColumnID="colTitleAttachment" Width="450" Header="Title">
<Editor>
<ext:TextField ID="TextField1" runat="server" />
</Editor>
</ext:Column>
<ext:Column DataIndex="AttachmentName" ColumnID="colAttachmentName" Width="250" Header="Attachment">
<Editor>
<ext:FileUploadField runat="server" Icon="Image" DataIndex="AttachmentName" />
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
</ext:GridPanel>
<ext:Button ID="btnSave" runat="server" Text="Save" >
<DirectEvents>
<Click OnEvent="btnSave_Click>
<ExtraParams>
<ext:Parameter Name="Attachments" Value="Ext.encode(#{gridAttachments}.getRowsValues({selectedOnly : false}))" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
//server side
string strAttachment = string.Empty;
strAttachment = e.ExtraParams["Attachments"];
SC.NITAttachment NITAObj = new SC.NITAttachment();
XmlNode xmlAttachment = JSON.DeserializeXmlNode("{records:{record:" + strAttachment + "}}");
foreach (XmlNode row in xmlAttachment.SelectNodes("records/record"))
{
NITAObj.Title = row.SelectSingleNode("Title").InnerXml;
NITAObj.AttachmentName = row.SelectSingleNode("AttachmentName").InnerXml;
}
Please help me for this issue... I need Attachment Name and posted file at server side