Hi, I have a grid and I populate its datasource in the NeedDataSource event.
I requiere to modifiy a gridhyperlink column, I need to add an onclick attribute to the link column, but when I
This is the code:
How can I access in the Itemdatabound event the row information?
Thanks in advance.
I requiere to modifiy a gridhyperlink column, I need to add an onclick attribute to the link column, but when I
This is the code:
<
telerik:RadGrid
id
=
"grdPase"
Culture
=
"es-MX"
ShowStatusBar
=
"true"
runat
=
"server"
AllowPaging
=
"true"
AllowSorting
=
"true"
AllowNaturalSort
=
"false"
AutoGenerateColumns
=
"false"
AllowMultiRowSelection
=
"false"
OnItemDataBound
=
"grdPase_ItemDataBound"
OnPreRender
=
"grdPase_PreRender"
OnNeedDataSource
=
"grdPase_NeedDataSource"
>
<
MasterTableView
PageSize
=
"15"
NoDetailRecordsText
=
"Sin Informacion"
NoMasterRecordsText
=
"Sin Informacion"
>
<
Columns
>
<
telerik:GridHyperLinkColumn
DataTextFormatString
=
"{0:d7}"
UniqueName
=
"rowno"
DataTextField
=
"rowno"
HeaderText
=
"Folio"
>
</
telerik:GridHyperLinkColumn
>
protected void grdPase_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem _item = (GridDataItem)e.Item;
HyperLink _link = (HyperLink)_item["rowno"].Controls[0];
_link.Attributes["href"] = "#";
_link.Attributes["onclick"] = String.Format("javascript:top.fnOpenWin('PopSPase','Registro de Pases','../01/e01PasePop.aspx?r={0}',true,'wndshow.png',630,550,false,true,36);return false;", _item["rowno"].Text);
/* _item["rowno"].Text has always a value instead of a numeric value */
}
}
protected void grdPase_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
/*here we have a lot of code for filtering, ordering the information */
sqlPase.SelectCommand = "SELECT * FROM tbl01Pase" + strFilteringOrderingInformation;
grdPase.DataSource = sqlPase;
}
How can I access in the Itemdatabound event the row information?
Thanks in advance.