Jul 28, 2016, 8:06 AM
[CLOSED] spreadsheet selection model pasted rows detection when pasting
Hello,
I am using a gridpanel with spreadsheet selection model, I want to copy from an excel file and paste in this gridpanel the problem is if this gridpanel on first load of the page will be holding only one empty row. if I have 5 rows in the excel and I copied it is there any way all the 5 rows pasted to be shown? which means adding automatically the rows to the grid?
Example: I have these 5 rows:
City1 10007395522 1021229881 1021229881
City2 10028238952 157415065 195849401
City3 10026675691 523403688 844342103
City4 10026675691 612204007 86041500
City5 10061386967 610395007 513017040
and this is my Code sample:
I want to copy the 5 rows above into the grid
Note That I dont want to create 5 Empty records because it is not fixed that I will always add 5 records maybe the excel file contains 12 or 40 records
I am using a gridpanel with spreadsheet selection model, I want to copy from an excel file and paste in this gridpanel the problem is if this gridpanel on first load of the page will be holding only one empty row. if I have 5 rows in the excel and I copied it is there any way all the 5 rows pasted to be shown? which means adding automatically the rows to the grid?
Example: I have these 5 rows:
City1 10007395522 1021229881 1021229881
City2 10028238952 157415065 195849401
City3 10026675691 523403688 844342103
City4 10026675691 612204007 86041500
City5 10061386967 610395007 513017040
and this is my Code sample:
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Store1.DataSource = new object[]
{
//new object[] { "Dammam", "10007395522", "1021229881", "1021229881" },
new object[] {}
};
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Spreadsheet Selection Model with Clipboard - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
<style>
.x-grid-row-over .x-grid-cell-inner {
font-weight: bold;
}
</style>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:GridPanel
ID="GridPanel1"
runat="server"
Title="Array Grid"
Width="700">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="City" />
<ext:ModelField Name="SAPAccountNb" />
<ext:ModelField Name="SAPSubscriberNumber" />
<ext:ModelField Name="SAPLegacyNumber" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column runat="server" Text="City" DataIndex="City" Flex="1" />
<ext:Column runat="server" Text="SAPAccountNb" DataIndex="SAPAccountNb" />
<ext:Column runat="server" Text="SAPSubscriberNumber" DataIndex="SAPSubscriberNumber">
</ext:Column>
<ext:Column runat="server" Text="SAPLegacyNumber" DataIndex="SAPLegacyNumber">
</ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:SpreadsheetSelectionModel ID="SpreadsheetSelectionModel1" CheckboxSelect="true" runat="server" />
</SelectionModel>
<Plugins>
<ext:Clipboard ID="Clipboard1" runat="server" />
<ext:RowEditing runat="server" ClicksToMoveEditor="1" AutoCancel="false" />
</Plugins>
</ext:GridPanel>
<ext:Label ID="Label1" runat="server" />
</body>
</html>
I want to copy the 5 rows above into the grid
Note That I dont want to create 5 Empty records because it is not fixed that I will always add 5 records maybe the excel file contains 12 or 40 records
Last edited by Geovision; Jul 28, 2016 at 8:15 AM.