


HI,
Last few days I am posting the same prob again and again, but I am nt getting proper response .
Again now I am posting the prob once…
1:- I want to retrieve the uploaded file name and no of files from the RadUpload Control, which is under RadGrid.
My code looks like as follow…
<telerik:RadAjaxManager ID="RadAjaxManager2" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1" >
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
//On insert and update buttons click temporarily disables ajax to perform upload actions
function conditionalPostback(e, sender)
{
var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
if (sender.EventTarget.match(theRegexp))
{
var upload = $find(window['UploadId']);
//AJAX is disabled only if file is selected for upload
if(upload.getFileInputs()[0].value != "")
{
sender.EnableAjax = false;
}
}
}
</script>
</telerik:RadScriptBlock>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" clientevents-onrequeststart="conditionalPostback"
Width="75px" Transparency="5">
<img style="margin-top: 150px;" alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading4.gif") %>' />
</telerik:RadAjaxLoadingPanel>
<telerik:RadGrid PageSize="3" AllowPaging="true" ID="RadGrid1" runat="server" GridLines="Horizontal"
AllowFilteringByColumn="true" Skin="WebBlue" AllowAutomaticDeletes="True" OnNeedDataSource="RadGrid1_NeedDataSource"
OnDeleteCommand="RadGrid1_DeleteCommand" OnInsertCommand="RadGrid1_InsertCommand"
OnUpdateCommand="RadGrid1_UpdateCommand" OnItemDataBound="RadGrid1_ItemDataBound"
OnItemInserted="RadGrid1_ItemInserted">
<PagerStyle Mode="Slider" />
<MasterTableView AutoGenerateColumns="false" DataKeyNames="TerritoryID" EditMode="EditForms"
CommandItemDisplay="TopAndBottom">
<Columns>
<telerik:GridEditCommandColumn>
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn ReadOnly="true" HeaderText="TerritoryID" DataField="TerritoryID"
UniqueName="TerritoryID" />
<telerik:GridBoundColumn ReadOnly="false" HeaderText="TerritoryDescription" DataField="TerritoryDescription"
UniqueName="TerritoryDescription" />
<telerik:GridBoundColumn ReadOnly="false" HeaderText="RegionID" DataField="RegionID"
UniqueName="RegionID" />
<telerik:GridButtonColumn CommandName="Delete" Text="Delete">
</telerik:GridButtonColumn>
</Columns>
<EditFormSettings EditFormType="Template">
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
<FormTemplate>
<table id="Table2" cellspacing="2" cellpadding="1" width="250" border="1" rules="none"
style="border-collapse: collapse">
<tr>
<td>
<table id="Table3" cellspacing="1" cellpadding="1" width="250" border="0">
<tr>
<td>
TerritoryID:
</td>
<td>
<asp:TextBox ID="txtTerritoryID" MaxLength="5" Visible='<% # (Container as GridItem).OwnerTableView.IsItemInserted %>'
runat="server">
</asp:TextBox>
</td>
</tr>
<tr>
<td>
TerritoryDescription:
</td>
<td>
<asp:TextBox ID="txtTerritoryDescription" runat="server" Text='<%# Eval( "TerritoryDescription" ) %>'>
</asp:TextBox>
</td>
</tr>
<tr>
<td>
RegionID: </td>
<td>
<telerik:RadUpload ID="RadUpload1" runat="server" InitialFileInputsCount="1" MaxFileInputsCount="1" ControlObjectsVisibility="None" AllowedFileExtensions=".aspx" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<b>Territory Info:</b>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<asp:Button ID="btnUpdate" Text='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "Insert" : "Update" %>'
runat="server" CommandName='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "PerformInsert" : "Update" %>'>
</asp:Button>
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
CommandName="Cancel"></asp:Button>
</td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
C#:-
protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)
{
GridEditFormInsertItem item = (GridEditFormInsertItem)e.Item;
RadAjaxManager2.Alert((item.FindControl("RadUpload1") as RadUpload).UploadedFiles.Count.ToString());
)
OR
protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
{
GridEditFormInsertItem item = (GridEditFormInsertItem)e.Item;
int cnt=(item.FindControl("RadUpload1") as RadUpload).UploadedFiles.Count;
Response.Write((item.FindControl("RadUpload1") as RadUpload).UploadedFiles[0].FileName);
}
Above either of the following ways I am nt able to retreive any fiels, which I have uploaded through RadUpload control…
Please provide me solution int his regards…
Regards,
Ranganath.S


<
td width="90%">
<table width="95%" border="1">
<tr>
<td>
<span style="font-weight: bold; font-size: 10pt"></span>
<%
--<asp:Label ID="lblAccountNumber" runat="server" Text='<%# Bind("AccountNumber") %>'
Font-Bold="true" Font-Size="10"></asp:Label>--
%>
<br />
<asp:ListBox ID="lbAllAccountNumbers" runat="server" Width="300" Height="200" SelectionMode="Multiple">
</asp:ListBox>
<ajaxToolkit:ListSearchExtender ID="SearchAllAccount" TargetControlID="lbAllAccountNumbers"
runat="server">
</ajaxToolkit:ListSearchExtender>
<asp:ImageButton ID="btnSelect" ImageUrl="~/images/right.jpg" ImageAlign="Middle" runat="server" OnClick="btnSelect_Click" />
<asp:ImageButton ID="btnUnselect" ImageUrl="~/images/left.jpg" ImageAlign="Middle" runat="server" OnClick="btnUnselect_Click" />
<ajaxToolkit:ListSearchExtender ID="SearchAvailableAccounts" TargetControlID="lbAvailableAccountNumbers"
runat="server">
</ajaxToolkit:ListSearchExtender>
<asp:ListBox ID="lbAvailableAccountNumbers" runat="server" Width="300" Height="200"
SelectionMode="Multiple"></asp:ListBox>
</td>
</tr>
</table>
</td>
The above code is in EditFormSettings tab.
When edit button is clicked iam loading two listboxes with some data.
In between those two listboxes , i have two buttons which will select or unselect from the above list boxes. When an item or items is selected in the listbox and clicked on Button, i have to move those items selected in the listbox to the other listbox.
I am writing this code in the button click event.
But in the button click , iam not able to gt the listbox.
Is there a way to get a reference to the listbox in the grid when the grid is in edit mode.
Thanks in advance.
