I want the code where i can bound the data code behind and access and change all the bind controls on the ItemDataBound Event
see the code.
This is my c# code
see the code.
<telerik:RadGrid ID="RadGrid1" runat="server" onitemcommand="RadGrid1_ItemCommand" GridLines="None" onitemdatabound="RadGrid1_ItemDataBound"> <MasterTableView> <Columns> <telerik:GridTemplateColumn HeaderText="CompanyName" UniqueName="CompanyName"> <EditItemTemplate> <asp:TextBox runat="server"></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label runat="server"><%# Eval("CompanyName")%></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> <ClientSettings> <Selecting AllowRowSelect="True" /> </ClientSettings> </telerik:RadGrid>protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadData(); } } private void LoadData() {
// done some binding code RadGrid1.DataSource = gd.GetDataTable("SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, PostalCode FROM Customers"); } protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { // what i have to do for the stuff for example } protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item) { GridItem item = default(GridItem); // get the label value on databound and change it. } }