This is a migrated thread and some comments may be shown as answers.

[Solved] How can I access eval in GroupHeaderTemplate

2 Answers 194 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ahmed
Top achievements
Rank 1
Ahmed asked on 13 Mar 2013, 07:49 AM
Hey all,

I want to insert an ID by using eval in a button in GroupHeaderTemplate, can anyone help as I can't access Eval.

My code
   <GroupHeaderTemplate>
               <telerik:RadButton ID="btnAddSpecificDelegationToCashGift" OnClick="btnAddSpecificDelegationToCashGift_OnClick"
                   CommandArgument=''
                   runat="server" Text='<%# Eval("TRP_LOOK_UP.ID") %>' >
                   <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="4"></Icon>
               </telerik:RadButton>
</GroupHeaderTemplate>

Or is there any other way to eval the ID.

Grid view data source.
    protected void gridAddDelegationToCashGift_OnNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
       {
           destinationID = int.Parse(Request.QueryString["destinationID"]);
           if (destinationID != 0)
               gridAddDelegationToCashGift.DataSource = _srv.GetDelegationNotAddedToCashGift(destinationID);
       }

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Mar 2013, 09:21 AM
Hi,

Try the following code.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
        if (e.Item is GridGroupHeaderItem)
        {
            GridGroupHeaderItem hitem = (GridGroupHeaderItem)e.Item;
            RadButton btn = (RadButton)hitem.FindControl("btnAddSpecificDelegationToCashGift");
            string value = btn.Text;
        }
}

Thanks,
Shinu
0
Ahmed
Top achievements
Rank 1
answered on 14 Mar 2013, 07:07 AM
Thanks for quick reply, What I want is to eval group ID in approve button beside group name (Have a look at the attached image).



Tags
Grid
Asked by
Ahmed
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ahmed
Top achievements
Rank 1
Share this question
or