ItemDataBound
method.
Method CreateHeaderControls(e); is doesn't call while we click a record on click which will call below method,
Is there any possibility to call CreateHeaderControls(e); in method RaisePostBackEvent(IPostBackEventHandler source, string eventArgument)
or else any alternate..thnx please help?
protected
override void RaisePostBackEvent(IPostBackEventHandler source, string eventArgument)
{
try
{
base.RaisePostBackEvent(source, eventArgument);
if (source == this.grdADInbox && eventArgument.IndexOf("RowDblClicked") != -1)
{
RadGrid rg = (RadGrid)source;
int index = int.Parse(eventArgument.Split(':')[1]);
========================================================================
protected
void grdADInbox_ItemDataBound(object sender, GridItemEventArgs e)
{
CreateHeaderControls(e);
}
private
void CreateHeaderControls(GridItemEventArgs args)
{
Button btnGroupApprove = new Button();
Button btnGroupReject = new Button();
String tranType = String.Empty;
Int32 tranCount = 0;
try
{
if (args.Item is GridGroupHeaderItem)
{
GridGroupHeaderItem item = args.Item as GridGroupHeaderItem;
DataRowView groupDataRow = (DataRowView)args.Item.DataItem;
if (groupDataRow != null)
{
tranType =
((System.Data.
DataRowView) (((Telerik.Web.UI.GridGroupHeaderItem) item).DataItem)).Row.ItemArray
.GetValue(0).ToString();
tranCount =
Convert.ToInt32(((System.Data.DataRowView)(((Telerik.Web.UI.GridGroupHeaderItem)item).DataItem)).Row.ItemArray
.GetValue(1).ToString());
}
btnGroupApprove.ID =
"btnGroupApprove";
btnGroupApprove.Text =
"Approve All";
btnGroupReject.ID =
"btnGroupReject";
btnGroupReject.Text =
"Reject All";
Label lbl = new Label();
lbl.ID =
"lblGroup";
String strGroupingText = item.DataCell.Text;
if (strGroupingText != " ")
{
if (strGroupingText.Contains("("))
{
strGroupingText = strGroupingText.Remove(strGroupingText.IndexOf(
"("));
}
lbl.Text = strGroupingText.Insert(strGroupingText.IndexOf(
"Total"), " ");
lbl.Text +=
" ";
item.DataCell.Controls.Add(lbl);
}
item.DataCell.Controls.Add(btnGroupApprove);
item.DataCell.Controls.Add(btnGroupReject);
}
string strApproveUrl = "ApproveAction.aspx?action=GroupApprove&&Tran_Type=" + tranType + "&&Tran_Count=" + tranCount;
string strRejectUrl = "ApproveAction.aspx?action=GroupReject&&Tran_Type=" + tranType + "&&Tran_Count=" + tranCount;
btnGroupApprove.Attributes.Add(
"onclick", "return ShowApprovalPopUp('" + strApproveUrl + "');");
btnGroupReject.Attributes.Add(
"onclick", "return ShowApprovalPopUp('" + strRejectUrl + "');");
}
catch (Exception ex)
{
throw ex;
}
}
Hello Sir,
I have radgird which is bound with sqldatasource..the griddropdown is bound with sqldatasource..
i want when i select the item of dropdown i want to enable or disable checkbox..which is also a bound column in grid.
how can i do this..please help me to solve this issue.
thanks
Hi,
I'm currently using the usercontrl edit form and I would like to have this function in javascript
if the value of the rdbBillable= 1
then enable some of the textboxes
else
disable the text boxes
The problem is when I place the javascript inside the ascx page, the it complaints that there is no javascript (Microsoft JScript runtime error: Object expected), but then if I put in the aspx page, it also complaint for this line
radio = $find(
'<%= rdbBillable.ClientID %>');
Compiler Error Message: CS0103: The name 'rdbBillable' does not exist in the current context.
Thanks
Vinh Vu