By default client-side selection information is unavailable on the server. However, you can track when the current cell position changes and send this data to server at postback.
For example, complete the following steps:
<script type="text/javascript">
function onCurrentCellChanged(e, args) {
$("#currentCellValue").val($(e.target).c1gridview("currentCell").value());
}
</script>
<cc1:C1GridView ID="C1GridView1" runat="server" DataSourceID="AccessDataSource1" AutogenerateColumns="false" OnClientCurrentCellChanged="onCurrentCellChanged">
<Columns>
<cc1:C1BoundField DataField="OrderID" HeaderText="OrderID" />
<cc1:C1BoundField DataField="Quantity" HeaderText="Quantity" />
</Columns>
</cc1:C1GridView>
To write the code in Visual Basic:
Visual Basic |
Copy Code
|
---|---|
Page.ClientScript.RegisterHiddenField("currentCellValue", Nothing) If IsPostBack Then Dim currentCellValue As String = Page.Request("currentCellValue") End If |
To write the code in C#:
C# |
Copy Code
|
---|---|
Page.ClientScript.RegisterHiddenField("currentCellValue", null); if (IsPostBack) { string currentCellValue = Page.Request["currentCellValue"]; } |
This code allows you to track when the current cell position changes and send this data to server at postback.