I am using gridview with paging. My grid has a command column, and ShowSelectCheckbox is true. I bind the DataTable to the grid in the Page_Load event with the condition [ if (!IsCallback) ].
Therefore, when I change the page index data, it is lost. After that, I wrote the binding code for the grid event of PageIndexChanged . Now it works like a charm.
But GetSelectedFieldValues only works on the first page when the SelectionChanged event occurs.
In the example, when I select a row on the first page, it gets the values of the fields that I want. But when I change the pageindex GetSelectedField , it is not possible to get the field values. He warns the blank text.
If I select a row in the second index of the page, it also works on this page, but when I change the index of the page, it breaks again.
BTW works when I bind the grid to the PageLoad event without the condition !IsCallback , but I cannot bind it to the Page_Load event because other controls must change the request and therefore the data.
Here comes my javascript function that warns selected values
<ClientSideEvents SelectionChanged="function(s, e) { grid.GetSelectedFieldValues('SDNO;SANTRAL',alert); }" />
And the event with the modified page index
protected void myGrid_PageIndexChanged(object sender, EventArgs e) { myGridDataSource = dtable; //dtable is static, i also used BindThat function here too. But no way out. myGridDataBind(); } protected void Page_Load(object sender, EventArgs e) { if (!IsCallback) { BindThat(); // Fetch data from db, create dtable and bind it to grid. } }