Hi , i'am trying to get the selected row in a ultrawebgrid, i'm using the event SelectedRowsChange, but it always throw an exception this rhe code:
protected void uwgDocumentos_SelectedRowsChange(object sender, Infragistics.WebUI.UltraWebGrid.SelectedRowsEventArgs e)
{
string i = string.Empty;
i = e.SelectedRows[e.SelectedRows.Count].Cells[0].Text;
}
the exception is nullReferenceException, it seem that there is no row selected or something like that, please i really need help with this. thanks
Hi Edison,
I am not sure why it fails, it works for me and I have attached the sample that I used to test it. Run the attached sample and try to reproduce the issue. Also it is very difficult to judge from a code snippet if the code would work.
hi Magued, i try but it fails too. but now i use the click event and it works, but not in all the cases , this the code, if you note that somethig is wrong please let me know.
protected void uwgDocumentos_Click(object sender, Infragistics.WebUI.UltraWebGrid.ClickEventArgs e)
i = e.Row.Cells[0].Text;
uwgAsociadosInf.DataSource = presentacion.documentosAsociadosInferiores(i);
uwgAsociadosInf.DataMember = "inferior";
uwgAsociadosInf.DataBind();
WebAsyncRefreshPanel2.DataBind();
uwgReferencias.DataSource = presentacion.documentosReferencia(i);
uwgReferencias.DataMember = "referencia";
uwgReferencias.DataBind();
WebAsyncRefreshPanel3.DataBind();
There is only one selected row with 0 index . Change your code to:
e.SelectedRows(0).Cells(0).Value
and see if that works.
Magued
Is necesary use javascript?