Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146467 | Aug 5,2019 01:32 PM UTC | Aug 7,2019 04:50 PM UTC | ASP.NET Web Forms | 1 |
![]() |
Tags: Grid |
Hi
I
have a few issues with the asp.net web forms Grid control, id appreciate some help please
1) the ServerRowDeselected event never seems to fire
2) when I click the header to sort it deselects the current row (so none are selected) but as it doesn’t seem to raise an event I can’t reset my internal ‘SelectedIndex’ flag to -1, how do I do this?. Im sure at sone time clicking the header kept the current item selected, but I think I must have changed a setting somewhere or my update panels are getting in the way – any ideas?
3) I can’t find how to check what the current grid selected row or index is programatically in my c# code behind - all examples seem to Do it in an event. And am pretty much a newbie to javascript and need to learn more, so if you are giving a javascript example please also tell me how I get the appropriate values into my code behind
4) How do I programmatically select a row on one of the grid pages and ensure its visible, eg after a new row is inserted mid way in the list
ive attached my test page to give you an idea where im at
<ej:Button ID="btn_Click" runat="server" OnClick="btn_Click_Click" Size="Normal" Text="Click to Select"></ej:Button>
<ej:Grid ID="OrdersGrid" runat="server"
-----------
<Columns>
----
</Columns>
</ej:Grid>
In code behind
protected void btn_Click_Click(object Sender, ButtonEventArgs e)
{
if(OrdersGrid.SelectedRowIndex != -1) {
// GridId. SelectedRowIndex will give selected rownindex
--------
}
}
|
<script>
function complete(args) {
if (args.requestType == "save" && args.action == "add") {
this.selectRows(index); // index= index of newly added row
}
}
</script>
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.