Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
Initialising a new column to be visible
posted

It may sound a little lame but i am new to infragistics and cant find the way to make a column to be visible(at runtime) after i click on another column (This column contains an "edit" button)... what i want is that the column i just created to go invisible and another column(This column contains two button "save" and "cancel") should be visible and when i click save in that column then again it should revert back to the previous case.

 

can any1 plz help me out [:D]

 

 

Parents
  • 3732
    Verified Answer
    posted

    Hi,

    The columns can be made visible and invisible during runtime. The following block of code shows an example:

     

     

     

     

     

    protected

    void UltraWebGrid1_Click(object sender, ClickEventArgs e)

    {

     

     

    if (e.Cell.Column.BaseColumnName == "OrderID")

    {

    e.Cell.Column.Hidden =

    true;

    }

     

     

    else if (e.Cell.Column.BaseColumnName == "ProductID")

    {

     

     

    this.UltraWebGrid1.Bands[0].Columns.FromKey("ProductID").Hidden = true;

     

     

    this.UltraWebGrid1.Bands[0].Columns.FromKey("OrderID").Hidden = false;

    }

    }

    Here the click event of the WebGrid is handled. If you have button columns, then you can handle the ClickCellButton event and control the visibility of the columns there. To add the event handlers for the grid, in the design view open the properties window and click on the events button and then browse through the events. When you double click on any of the event names, it creates the handler in the code behind.

    Hope this helps.

    Thanks

Reply Children
No Data