Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6928173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:09:00+00:00 2026-05-27T11:09:00+00:00

I have a grid that i have been trying to set up in the

  • 0

I have a grid that i have been trying to set up in the code behind. So far everything has been going smoothly and working, but when
i go to set the itemcommand event or any event for the matter, when i go to click on the command or do something that should cause to trigger the event, nothing ends up firing. So i was wondering what exactly i am doing wrong with my declaration on my item command.
You will find my code below:

private void createRadGrid()
    {
        //create radgrid
        RadGrid rg = new RadGrid();
        rg.ID = "RadGridView";

        //setting the datasource and itemcommand event handler.
        rg.DataSourceID = "MachineDataSet";
        rg.ItemCommand += new GridCommandEventHandler(RadGridView_ItemCommand);

        rg.Width = 862;
        rg.CellSpacing = 2;
        rg.CellPadding = 4;
        rg.BorderWidth = 3;
        rg.BackColor = System.Drawing.Color.Transparent;
        rg.BorderColor = System.Drawing.Color.DarkGray;
        rg.ForeColor = System.Drawing.Color.Black;
        rg.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
        rg.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
        rg.BorderStyle = BorderStyle.Ridge;
        rg.ShowStatusBar = true;

        rg.AllowPaging = true;
        rg.PageSize = 5;
        rg.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
        rg.AutoGenerateColumns = false;

        rg.MasterTableView.PageSize = 5;
        rg.MasterTableView.DataKeyNames = new string[] { "ID" };
        rg.MasterTableView.ClientDataKeyNames = new string[] { "ID" };
        rg.MasterTableView.AutoGenerateColumns = false;

        rg.ClientSettings.Resizing.AllowColumnResize = true;
        rg.ClientSettings.Resizing.EnableRealTimeResize = true;
        rg.ClientSettings.Resizing.ResizeGridOnColumnResize = true;

        GridBoundColumn boundColumn = new GridBoundColumn();
        boundColumn.DataField = "ID";
        boundColumn.HeaderText = "ID";
        boundColumn.UniqueName = "MachineID";
        boundColumn.Visible = false;
        rg.MasterTableView.Columns.Add(boundColumn);

        GridBoundColumn boundColumn1 = new GridBoundColumn();
        boundColumn1.DataField = "SiteName";
        boundColumn1.HeaderText ="Site Name";
        boundColumn1.Resizable = true;
        boundColumn1.ReadOnly = true;
        rg.MasterTableView.Columns.Add(boundColumn1);

        GridBoundColumn boundColumn2 = new GridBoundColumn();
        boundColumn2.DataField = "Name";
        boundColumn2.HeaderText = "Machine Name";
        boundColumn2.Resizable = true;
        boundColumn2.ReadOnly = true;
        rg.MasterTableView.Columns.Add(boundColumn2);

        GridBoundColumn boundColumn3 = new GridBoundColumn();
        boundColumn3.DataField = "MachineType";
        boundColumn3.HeaderText = "Machine Type";
        boundColumn3.Resizable = true;
        boundColumn3.ReadOnly = true;
        rg.MasterTableView.Columns.Add(boundColumn3);

        GridBoundColumn boundColumn4 = new GridBoundColumn();
        boundColumn4.DataField = "MachineModel";
        boundColumn4.HeaderText = "Machine Model";
        boundColumn4.Resizable = true;
        boundColumn4.ReadOnly = true;
        rg.MasterTableView.Columns.Add(boundColumn4);

        GridButtonColumn buttonColumn = new GridButtonColumn();
        buttonColumn.ButtonType = GridButtonColumnType.PushButton;
        buttonColumn.CommandName = "AssignNewValues";
        buttonColumn.Resizable = true;
        buttonColumn.Text = "Assign New Values";
        rg.MasterTableView.Columns.Add(buttonColumn);

        PlaceHolder_RadGridView.Controls.Add(rg);
    }

The problem area seems to be in this line

rg.ItemCommand += new GridCommandEventHandler(RadGridView_ItemCommand);

Any help or suggestions are greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:09:01+00:00Added an answer on May 27, 2026 at 11:09 am

    Try placing the createRadGrid() either in the page_init or page_load event. if you are setting the event after, that could be the reason of it no firing.

    Hope this is of any help.

    Cheers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a set of data that has been displayed as just a simple
I have a grid that has multiple rows. I want to hide/show one of
I have a grid view that has two simple columns, a report number and
I dont know if this has been answered but what i am trying to
I have a set of buttons in a grid on a Map/MapControl. I've been
so i have been trying to style a scrollviewer, so that i can change
I have been trying out the Susy plugin for Compass ( SASS ), but
I have been trying to export some datagrids in Silverlight to excel, but have
I have a web application that has a grid displaying a paged list of
I have a grid that is dynamically generated based on search criteria. I render

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.