Hi,
i'm trying to modify the confirmtext value of a gridbuttoncolum. i'm making the change during the first firing of itemcreated event on the page.
on the oninsertcommand, onupdatecommand, etc of the radgrid i've used
to retrieve the datakey value.
i'm not having much luck using it in this event to get the value as datakeyvalues appears to be unavailable. how can i get this value from the itemcreated command?
here's my code in more detail.
i'm trying to modify the confirmtext value of a gridbuttoncolum. i'm making the change during the first firing of itemcreated event on the page.
on the oninsertcommand, onupdatecommand, etc of the radgrid i've used
string strChannelId = RadGrid1.MasterTableView.DataKeyValues[e.Item.ItemIndex]["ChannelId"].ToString();
to retrieve the datakey value.
i'm not having much luck using it in this event to get the value as datakeyvalues appears to be unavailable. how can i get this value from the itemcreated command?
here's my code in more detail.
protected void RadGrid1_ItemCreated(object source, GridItemEventArgs e)
{
if (e.Item is GridEditFormInsertItem && e.Item.IsInEditMode)
{
this.RadGrid1_ItemCreatedInsert(source, e);
}
else if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
{
this.RadGrid1_ItemCreatedUpdate(source, e);
}
else
{
foreach (GridColumn gridColumn in RadGrid1.MasterTableView.Columns)
{
if (gridColumn.UniqueName == "columnRelease")
{
// retrieve the original values from the database
DataSet dsOriginal = new DataSet();
string strErrorText = string.Empty;
string strChannelId = RadGrid1.MasterTableView.DataKeyValues[e.Item.ItemIndex]["ChannelId"].ToString();
this.GetChannelDetail(out dsOriginal, out strErrorText, strChannelId);
DataTable dtOriginal = dsOriginal.Tables["Channel"];
DataRow drOriginal = dtOriginal.Rows[0];
(gridColumn as GridButtonColumn).ConfirmText = string.Format("Are you sure you want to release channel {0} on FMIS Server {1}?", Convert.ToString(drOriginal.ItemArray[2]), Convert.ToString(drOriginal.ItemArray[1]));
}
}
}
}