Dear Support
I want to use the following js to delete a item from the radgrid. If the js fires the first time, it runs correctly. On the next item it bring up an error. But I don't know why. Must I rebind the grid or someting else?
| function DeleteItem() |
| { |
| var _rowIndex = parseInt(-1); |
| _rowIndex = parseInt(document.getElementById("radGridClickedRowIndex").value); |
| if (_rowIndex >= 0) |
| { |
| var bResponse = window.confirm("Datensatz wirklich löschen?"); |
| if (bResponse) |
| { |
| var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView(); |
| masterTable.deleteItem(masterTable.get_dataItems()[_rowIndex].get_element()); |
| } |
| } |
| } |
| Object asyncState = null; |
| //AsyncCallback callback; |
| IAsyncResult asyncresult = null; |
| try |
| { |
| DateTime begintime = DateTime.Now; |
| //Connect |
| proxy.Connection = new SAP.Connector.SAPConnection(destination1); |
| proxy.Connection.Open(); |
| // Call SAP RFC HERE |
| string strCustNo = "0000000000" + user.SAPCustomerNo.Trim(); |
| strCustNo = strCustNo.Substring(strCustNo.Length - 10, 10); |
| string cust = strCustNo; |
| AsyncCallback callback = new AsyncCallback(ProcessInfo); |
| asyncresult = proxy.BeginZvasec_Pnlookup_And_Ixos(cust, portal, strPN, ref tblALTPN_ACTYPE, ref tblALTPN_AVAIL, ref tblPN_ACTYPE, ref tblPN_AVAIL, callback, asyncState); |
| //proxy.Connection.Close(); |
| DateTime endtime = DateTime.Now; |
| TimeSpan elapsedtime = endtime - begintime; |
| } |
| catch (Exception ex) |
| { |
| proxy.Connection.Close(); |
| _return = false; |
| } |
| } |
| void ProcessInfo(IAsyncResult result) |
| { |
| OrderFunctions objOF = new OrderFunctions(); |
| TList<Cart> reg = new TList<Cart>(); |
| TList<Cart> alt = new TList<Cart>(); |
| ArrayList ary = new ArrayList(); |
| string pnDesc; |
| int partNo; |
| ZVAS_INVENTORY_SEARCH_STOCK2Table tblALTPN_AVAIL = new ZVAS_INVENTORY_SEARCH_STOCK2Table(); |
| ZVAS_INVENTORY_SEARCH_STOCK2Table tblPN_AVAIL = new ZVAS_INVENTORY_SEARCH_STOCK2Table(); |
| ZVAS_INVENTORY_SEARCH_AIRCRAFTTable tblALTPN_ACTYPE = new ZVAS_INVENTORY_SEARCH_AIRCRAFTTable(); |
| ZVAS_INVENTORY_SEARCH_AIRCRAFTTable tblPN_ACTYPE = new ZVAS_INVENTORY_SEARCH_AIRCRAFTTable(); |
| SAPDestinationFunctions objSF = new SAPDestinationFunctions(); |
| bool blnProduction = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings.Get("isproduction")); |
| SAP.Connector.Destination destination1 = objSF.GetR3Destination(blnProduction); |
| SAPR3Proxy proxy = new SAPR3Proxy(); |
| proxy.Connection = new SAP.Connector.SAPConnection(destination1); |
| //proxy.Connection.Open(); |
| proxy.EndZvasec_Pnlookup_And_Ixos(result, out pnDesc, out partNo, ref tblALTPN_ACTYPE, ref tblALTPN_AVAIL, ref tblPN_ACTYPE, ref tblPN_AVAIL); |
| proxy.Connection.Close(); |
| UserProfile user = new UserProfile();// = (UserProfile)HttpContext.Current.Session["user"]; |
| DateTime endtime = DateTime.Now; |
| } |
| Server Error in '/' Application. |
| Input string was not in a correct format. |
| Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. |
| Exception Details: System.FormatException: Input string was not in a correct format. |
| Source Error: |
| An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
| Stack Trace: |
| [FormatException: Input string was not in a correct format.] |
| System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7469351 |
| System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119 |
| System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection) +163 |
| System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +14 |
| System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +693 |
| System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743 |
| Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082 |
| <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="ProgramPage.aspx.vb" Inherits="ProgramPage" title="KiDO : Program maintenance" %> |
| <%@ MasterType VirtualPath="~/MasterPage.master" %> |
| <%@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="radC" %> |
| <%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" %> |
| <%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %> |
| <%@ Register Assembly="RadEditor.Net2" Namespace="Telerik.WebControls" TagPrefix="radE" %> |
| <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> |
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:cnKido %>" |
| SelectCommand="SELECT * FROM [Program]" |
| UpdateCommand="UPDATE Program SET ProgramCode=@ProgramCode ,ProgramName=@ProgramName ,ProgramDesc=@ProgramDesc ,IsCanceled=@IsCanceled ,UpdateUser=@UpdateUser ,UpdateDT=@UpdateDT where ProgramKey=@ProgramKey " |
| InsertCommand="INSERT INTO Program( ProgramCode,ProgramName,ProgramDesc,IsCanceled,AddUser,UpdateUser,AddDT,UpdateDT) values (@ProgramCode,@ProgramName,@ProgramDesc,@IsCanceled,@AddUser,@UpdateUser,@AddDT,@UpdateDT)"> |
| <UpdateParameters> |
| <asp:Parameter Name="ProgramKey" Type="Int64" /> |
| <asp:Parameter Name="ProgramCode" Type="String" /> |
| <asp:Parameter Name="ProgramName" Type="String" /> |
| <asp:Parameter Name="ProgramDesc" Type="String" /> |
| <asp:Parameter Name="IsCanceled" Type="Boolean" /> |
| <asp:Parameter Name="UpdateUser" Type="String" /> |
| <asp:Parameter Name="UpdateDT" Type="datetime" /> |
| </UpdateParameters> |
| <InsertParameters> |
| <asp:Parameter Name="ProgramCode" Type="String" /> |
| <asp:Parameter Name="ProgramName" Type="String" /> |
| <asp:Parameter Name="ProgramDesc" Type="String" /> |
| <asp:Parameter Name="IsCanceled" Type="Boolean" /> |
| <asp:Parameter Name="AddUser" Type="String" /> |
| <asp:Parameter Name="UpdateUser" Type="String" /> |
| <asp:Parameter Name="AddDT" Type="datetime" /> |
| <asp:Parameter Name="UpdateDT" Type="datetime" /> |
| </InsertParameters> |
| </asp:SqlDataSource> |
| <br /> |
| <radG:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" |
| AllowAutomaticUpdates="True" AllowMultiRowSelection="True" |
| AllowPaging="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" |
| EnableAJAX="True" EnableAJAXLoadingTemplate="True" LoadingTemplateTransparency="50" |
| PageSize="14" ShowStatusBar="True" Width="97%" GridLines="None" AllowSorting="True" AllowFilteringByColumn="True"> |
| <PagerStyle Mode="Slider" /> |
| <ClientSettings> |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| <MasterTableView CommandItemDisplay="Top" DataKeyNames="ProgramKey" |
| DataSourceID="SqlDataSource1" Width="100%"> |
| <CommandItemTemplate> |
| <div style="padding: 10px 0px;"> |
| |
| <asp:LinkButton ID="btnCancel" runat="server" CausesValidation="false" CommandName="CancelAll" |
| Visible='<%# RadGrid1.EditIndexes.Count > 0 Or RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="images/DataEditing/Img/Cancel.gif" /> Cancel editing</asp:LinkButton> |
| |
| <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# Not RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="images/DataEditing/Img/AddRecord.gif" /> Add new </asp:LinkButton> |
| |
| <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="images/DataEditing/Img/Refresh.gif" /> Refresh list</asp:LinkButton> |
| </div> |
| </CommandItemTemplate> |
| <Columns> |
| <radG:GridEditCommandColumn ButtonType="ImageButton" CancelImageUrl="images/DataEditing/Img/Cancel.gif" |
| EditImageUrl="images/DataEditing/Img/Edit.gif" InsertImageUrl="images/DataEditing/Img/Insert.gif" UpdateImageUrl="images/DataEditing/Img/Update.gif"> |
| <HeaderStyle Width="30px" /> |
| </radG:GridEditCommandColumn> |
| <radG:GridTemplateColumn DataField="IsCanceled" DataType="System.Boolean" HeaderText="Cancel" |
| SortExpression="IsCanceled" UniqueName="IsCanceled"> |
| <ItemTemplate> |
| <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("IsCanceled") %>' Enabled="False" /> |
| </ItemTemplate> |
| </radG:GridTemplateColumn> |
| <radG:GridBoundColumn DataField="ProgramCode" HeaderText="Code" SortExpression="ProgramCode" |
| UniqueName="ProgramCode"> |
| </radG:GridBoundColumn> |
| <radG:GridBoundColumn DataField="ProgramName" HeaderText="Program Name" SortExpression="ProgramName" |
| UniqueName="ProgramName"> |
| </radG:GridBoundColumn> |
| <radG:GridBoundColumn DataField="ProgramDesc" HeaderText="Description" SortExpression="ProgramDesc" |
| UniqueName="ProgramDesc"> |
| </radG:GridBoundColumn> |
| </Columns> |
| <EditFormSettings EditFormType="Template"> |
| <FormTemplate> |
| <asp:Label ID="lblKey" runat="server" Text='<%# Eval("ProgramKey") %>'></asp:Label> |
| <table style="width: 100%"> |
| <tr> |
| <td style="text-align: center;"> |
| <table border="0" cellpadding="0" cellspacing="0" class="LoginOuterBox" style="width: 80%"> |
| <tr> |
| <td style="text-align: right"> |
| </td> |
| <td style="text-align: left;"> |
| <asp:CheckBox ID="chbIsCanceled" runat="server" Checked='<%# ScriptHelper.DBBoolean(Eval("IsCanceled")) %>' |
| Text="Cancel" /></td> |
| </tr> |
| <tr><td style="text-align: right"> |
| <asp:Label ID="lblProgramCode" runat="server" Text="Program Code"></asp:Label></td> |
| <td style="text-align: left;"> |
| <asp:TextBox ID="txbProgramCode" runat="server" MaxLength="50" Text='<%# Bind("ProgramCode") %>' Width="336px"></asp:TextBox> |
| </td></tr> |
| <tr><td style="text-align: right; height: 38px;"> |
| <asp:Label ID="lblProgramName" runat="server" Text="Program Name"></asp:Label></td> |
| <td style="text-align: left; height: 38px;"> |
| <asp:TextBox ID="txbProgramName" runat="server" MaxLength="100" Text='<%# Bind("ProgramName") %>' Width="336px"></asp:TextBox> |
| </td></tr> |
| <tr><td style="text-align: right; vertical-align: top;"> |
| <asp:Label ID="lblProgramDesc" runat="server" Text="Description"></asp:Label></td> |
| <td style="text-align: left;"> |
| <asp:TextBox ID="txbProgramDesc" runat="server" MaxLength="200" Text='<%# Bind("ProgramDesc") %>' Width="336px" Height="112px" TextMode="MultiLine"></asp:TextBox> |
| </td></tr> |
| <tr> |
| <td style="text-align: right"> |
| </td> |
| <td style="text-align: left"> |
| <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="false" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'> |
| <img style="border:0px;vertical-align:middle;" alt="" src="images/DataEditing/Img/Update.gif" /> Save </asp:LinkButton> |
| <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Cancel"> |
| <img style="border:0px;vertical-align:middle;" alt="" src="images/DataEditing/Img/Cancel.gif" /> Cancel </asp:LinkButton> |
| </td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| </FormTemplate> |
| <EditColumn UniqueName="EditCommandColumn1"> |
| </EditColumn> |
| </EditFormSettings> |
| <RowIndicatorColumn Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn Resizable="False" Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| </MasterTableView> |
| <ExportSettings> |
| <Pdf PageBottomMargin="" PageFooterMargin="" PageHeaderMargin="" PageHeight="11in" |
| PageLeftMargin="" PageRightMargin="" PageTopMargin="" PageWidth="8.5in" /> |
| </ExportSettings> |
| </radG:RadGrid> |
| </asp:Content> |
| Imports ScriptHelper |
| Imports System.Data |
| Partial Class ProgramPage |
| Inherits System.Web.UI.Page |
| Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
| Me.RadGrid1.ClientSettings.ClientEvents.OnGridCreated = "" |
| If Not Page.IsPostBack Then |
| If Not (User.IsInRole("Admit") Or User.IsInRole("HQ")) Then |
| Response.Redirect("./default.aspx") |
| End If |
| End If |
| End Sub |
| Private Sub SetSQlValue(ByVal ParameterName As String, ByVal ParameterValue As Object, ByVal IsADD As Boolean) |
| If IsADD Then |
| SqlDataSource1.InsertParameters(ParameterName).DefaultValue = ParameterValue |
| Else |
| SqlDataSource1.UpdateParameters(ParameterName).DefaultValue = ParameterValue |
| End If |
| End Sub |
| Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles RadGrid1.ItemCommand |
| Select Case e.CommandName |
| Case "Update" |
| If Not CheckValid(e, False) Then |
| e.Canceled = True |
| Exit Sub |
| End If |
| SqlDataSource1.Update() |
| Case Telerik.WebControls.RadGrid.PerformInsertCommandName |
| If Not CheckValid(e, True) Then |
| e.Canceled = True |
| Exit Sub |
| End If |
| SqlDataSource1.Update() |
| Case Telerik.WebControls.RadGrid.InitInsertCommandName |
| RadGrid1.MasterTableView.ClearEditItems() |
| e.Canceled = True |
| Dim newValues As System.Collections.Specialized.ListDictionary = New System.Collections.Specialized.ListDictionary() |
| newValues("IsCanceled") = False |
| e.Item.OwnerTableView.InsertItem(newValues) |
| Case Telerik.WebControls.RadGrid.RebindGridCommandName |
| RadGrid1.MasterTableView.ClearEditItems() |
| For Each item As Telerik.WebControls.GridDataItem In RadGrid1.MasterTableView.Items |
| item.OwnerTableView.IsItemInserted = False |
| Next |
| Case Telerik.WebControls.RadGrid.EditCommandName |
| RadGrid1.MasterTableView.ClearEditItems() |
| End Select |
| End Sub |
| Private Function CheckValid(ByVal e As Telerik.WebControls.GridCommandEventArgs, ByVal IsAdd As Boolean) As Boolean |
| Dim strErr As String = "" |
| Dim lbl As Label |
| lbl = e.Item.FindControl("lblProgramCode") |
| Dim txbProgramCode As TextBox = e.Item.FindControl("txbProgramCode") |
| If txbProgramCode.Text.Trim = "" Then |
| strErr &= "- Invalid " & lbl.Text & vbCrLf |
| End If |
| lbl = e.Item.FindControl("lblProgramName") |
| Dim txbProgramName As TextBox = e.Item.FindControl("txbProgramName") |
| If txbProgramName.Text.Trim = "" Then |
| strErr &= "- Invalid " & lbl.Text & vbCrLf |
| End If |
| lbl = e.Item.FindControl("lblProgramDesc") |
| Dim txbProgramDesc As TextBox = e.Item.FindControl("txbProgramDesc") |
| If txbProgramDesc.Text.Trim = "" Then |
| strErr &= "- Invalid " & lbl.Text & vbCrLf |
| End If |
| If strErr <> "" Then |
| DisplayMessage(strErr, RadGrid1) |
| Return False |
| End If |
| Master.MainData.ClearAllValue() |
| Master.MainData.AddSqlCommand("select * from Program where ProgramCode=@ProgramCode") |
| Master.MainData.AddParameter("@ProgramCode", txbProgramCode.Text) |
| Dim ds As DataSet = Master.MainData.GetDataset() |
| Dim lblKey As Label = e.Item.FindControl("lblKey") |
| If IsAdd Then |
| If ds.Tables(0).Rows.Count > 0 Then |
| DisplayMessage("Code '" & txbProgramCode.Text & "' is already exist!", RadGrid1) |
| Return False |
| End If |
| Else |
| If ds.Tables(0).Rows.Count > 0 AndAlso ds.Tables(0).Rows(0)("ProgramKey") <> Convert.ToInt64(lblKey.Text) Then |
| DisplayMessage("Code '" & txbProgramCode.Text & "' is already exist!", RadGrid1) |
| Return False |
| End If |
| End If |
| Dim chbIsCanceled As CheckBox = e.Item.FindControl("chbIsCanceled") |
| SetSQlValue("ProgramCode", txbProgramCode.Text, IsAdd) |
| SetSQlValue("ProgramName", txbProgramName.Text, IsAdd) |
| SetSQlValue("ProgramDesc", txbProgramDesc.Text, IsAdd) |
| SetSQlValue("UpdateUser", Membership.GetUser.ProviderUserKey.ToString, IsAdd) |
| SetSQlValue("UpdateDT", Now, IsAdd) |
| SetSQlValue("IsCanceled", chbIsCanceled.Checked, IsAdd) |
| If IsAdd Then |
| SetSQlValue("AddUser", Membership.GetUser.ProviderUserKey.ToString, IsAdd) |
| SetSQlValue("AddDT", Now, IsAdd) |
| Else |
| SetSQlValue("ProgramKey", Convert.ToInt64(lblKey.Text), IsAdd) |
| End If |
| Return True |
| End Function |
| End Class |
<
telerik:RadScriptManager runat="server"/>
<telerik:RadAjaxManager ID="RadAjaxManager2" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Button3">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid3" />
<telerik:AjaxUpdatedControl ControlID="RadGrid4" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="Button4">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid3" />
<telerik:AjaxUpdatedControl ControlID="RadGrid4" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<td cssclass="resultsRowB">
<div class="txtBold"> <asp:Literal>Available accounts</asp:Literal></div>
</td>
<td cssclass="resultsRowB">
<div class="txtBold"> <asp:Literal>Selected accounts</asp:Literal></div>
</td>
</tr>
<tr>
<td>
<telerik:RadGrid ID="RadGrid3" runat="server" OnNeedDataSource="RadGrid3_NeedDataSource" ShowHeader="false" AllowMultiRowSelection="true">
<ClientSettings>
<Selecting AllowRowSelect="True"></Selecting>
<Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="100" SaveScrollPosition="True" FrozenColumnsCount="1"> </Scrolling>
</ClientSettings>
<SelectedItemStyle Font-Bold="True" ForeColor="#F7F7F7" BackColor="#738A9C" />
<AlternatingItemStyle CssClass="resultsRowE" />
<ItemStyle CssClass="resultsRowE" />
<mastertableview DataKeyNames="meeting_account_id" gridlines="None" BorderWidth="1" BorderStyle=Inset CssClass="resultsRowE" showfooter="False" RetrieveAllDataFields="false" AutoGenerateColumns="False">
<Columns>
<telerik:GridBoundColumn DataField="meeting_account_id" HeaderText="ID" ReadOnly="True" SortExpression="meeting_account_id"
UniqueName="meeting_account_id" Visible="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="inst_inv_nm" HeaderText="Account Name" ReadOnly="True" SortExpression="inst_inv_nm"
UniqueName="inst_inv_nm" Visible="true">
</telerik:GridBoundColumn>
</Columns>
</mastertableview>
</telerik:RadGrid>
</td>
<td>
<asp:Button ID="Button3" runat="server" Text=">" OnClick="Button3_Click"></asp:Button>
<br />
<asp:Button ID="Button4" runat="server" Text="<" OnClick="Button4_Click"></asp:Button>
</td>
<td>
<telerik:RadGrid ID="RadGrid4" OnNeedDataSource="RadGrid4_NeedDataSource" ShowHeader="false" runat="server" AllowMultiRowSelection="true">
<ClientSettings>
<Selecting AllowRowSelect="True"></Selecting>
<Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="100" SaveScrollPosition="True" FrozenColumnsCount="1"> </Scrolling>
</ClientSettings>
<SelectedItemStyle Font-Bold="True" ForeColor="#F7F7F7" BackColor="#738A9C" />
<AlternatingItemStyle CssClass="resultsRowE" />
<ItemStyle CssClass="resultsRowE" />
<mastertableview DataKeyNames="meeting_account_id" gridlines="Both" showfooter="False" RetrieveAllDataFields="false" AutoGenerateColumns="False">
<Columns>
<telerik:GridBoundColumn DataField="meeting_account_id" HeaderText="ID" ReadOnly="True" SortExpression="meeting_account_id"
UniqueName="meeting_account_id" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="inst_inv_nm" HeaderText="Account Name" ReadOnly="True" SortExpression="inst_inv_nm"
UniqueName="inst_inv_nm" Visible="true">
</telerik:GridBoundColumn>
</Columns>
</mastertableview>
</telerik:RadGrid></td>
</tr>
aspx.cs -
protected void RadGrid3_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
RadGrid3.DataSource = AvaList;
//RadGrid3.DataSource = Session["Available"];
}
protected void RadGrid4_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
RadGrid4.DataSource = SelList;
//RadGrid4.DataSource = Session["Selected"]; ;
}
protected void Button3_Click(object sender, System.EventArgs e)
{
foreach (GridDataItem item in RadGrid3.SelectedItems)
{
for (int i = AvaList.Count-1 ; i >= 0 ; i--)
{
MeetingAccount ma = AvaList[i] as MeetingAccount;
if (ma.meeting_account_id.ToString() == item["meeting_account_id"].Text)
{
AvaList.RemoveAt(i); ;
SelList.Add(ma);
break;
}
}
}
RadGrid3.Rebind();
RadGrid4.Rebind();
private ArrayList AvaList
{
get
{
ArrayList obj = (ArrayList)Session["AvaList"];
if (obj == null)
{
ArrayList list = new ArrayList();
MeetingAccountCollection macoll= MeetingAccountManager.GetMeetingAccountsByEvent(m_iEventId);
foreach (MeetingAccount ma in macoll)
{
list.Add(ma);
}
Session[
"AvaList"] = list;
return list;
}
return obj;
}
}
private ArrayList SelList
{
get
{
ArrayList obj = (ArrayList)Session["SelList"];
if (obj == null)
{
ArrayList list = new ArrayList();
//MeetingAccountCollection macoll = MeetingAccountManager.GetMeetingAccountsByEvent(m_iEventId);
//foreach (MeetingAccount ma in macoll)
//{
// list.Add(ma);
//}
Session[
"SelList"] = list;
return list;
}
return obj;
}
}
