Actually I have taken one RadGrid and in that I have taken one RadUpLoad control in that.
And I want to find out the file name of Uploaded File along with pathname separately. Here I am sending the code which I tried to Implement….
<telerik:RadGrid ID="rgSubmenus" runat="server" AllowPaging="True" GridLines="Horizontal"
Skin="Default" OnNeedDataSource="rgSubmenus_NeedDataSource" PageSize="10" Width="70%"
OnInsertCommand="rgSubmenus_InsertCommand" OnItemDataBound="rgSubmenus_ItemDataBound"
OnUpdateCommand="rgSubmenus_UpdateCommand" >
<PagerStyle Mode="Slider" />
<MasterTableView CommandItemDisplay="TopAndBottom" AutoGenerateColumns="false" DataKeyNames="submenuid"
EditMode="EditForms" CommandItemSettings-AddNewRecordText="Add Submenu">
<Columns>
<telerik:GridBoundColumn DataField="submenuid" HeaderText="SubMenu ID" HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Left" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="mainmenuid" HeaderText="MainMenu ID" HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="15%" Visible="false">
</telerik:GridBoundColumn>
So On…
<telerik:GridBoundColumn DataField="url" HeaderText="URL" HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="25%">
</telerik:GridBoundColumn>
<FormTemplate>
<table width="100%" cellpadding="0" cellspacing="0" border="0" bordercolor="red">
<tr>
<td width="49%" align="right">
Select MainMenu
</td>
<td width="2%">
:
</td>
So On…..
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td width="49%" align="right">
Submenu Name
</td>
<td width="2%">
:
</td>
<tr>
<td width="49%" align="right">
Submenu URL
</td>
<td width="2%">
:
</td>
<td width="49%" align="left">
<telerik:RadUpload ID="rdSubmenuUpload" runat="server" Skin="Default" ControlObjectsVisibility="None" Width="150px" InputSize="25" AllowedFileExtensions=".aspx" />
</td>
</tr>
<tr>
So On…
<td width="49%" align="left">
<asp:Button runat="server" ID="btnAddRoles" Text='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "Insert" : "Update" %>'
CommandName='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "PerformInsert" : "Update" %>'
CssClass="btn1" />
<asp:Button runat="server" ID="btnCancel" Text="Cancel" CssClass="btn1" CausesValidation="false"
CommandName="Cancel" />
</td>
</tr>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
I tried C# in the following ways
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))
{
GridEditableItem formItem = (GridEditableItem)e.Item;
RadUpload rdUload = (RadUpload)formItem.FindControl("rdSubmenuUpload");
int a = rdUload.UploadedFiles.Count;
}
}
protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)
{
//Get the GridEditFormInsertItem of the RadGrid
//GridEditFormInsertItem insertedItem = e.Item as GridEditFormInsertItem;
//RadComboBox ddlMainmenu = (insertedItem.FindControl("ddlMainmenus") as RadComboBox);
GridEditFormInsertItem insertedItem = (GridEditFormInsertItem)e.Item;
RadUpload ruld = (insertedItem.FindControl("rdSubmenuUpload") as RadUpload);
int a = ruld.UploadedFiles.Count;
...
}