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
70
Ultragrid Grouped by Column get data from hidden Column
posted

So what I have is 

                    ultraGrid1.DataSource = HL7;

                    ultraGrid1.Visible = true;

                    ultraGrid1.DisplayLayout.Bands[0].Columns["File_Path"].Hidden = true;

                    ultraGrid1.DisplayLayout.GroupByBox.Hidden = true;

                    ultraGrid1.DisplayLayout.Bands[0].SortedColumns.Add("Date", false, true);

                    ultraGrid1.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ResizeAllColumns;

 

 Which displays like this

+ Date 2015-07-22

   Hour

   - 11:06

   - 11:01     <---- Click

When I attempt to retrieve the data as such 

        private void ultraGrid1_ClickCell(Object sender, Infragistics.Win.UltraWinGrid.ClickCellEventArgs clicked)

        {

            if (ultraGrid1.Rows[clicked.Cell.Row.Index].Cells["File_Path"].Value != null)

                presentation_Browser.Navigate(ultraGrid1.Rows[clicked.Cell.Row.Index].Cells["File_Path"].Value.ToString());

        }

I get an Exception...  Should I be paying attention to the Bands?  Or am I attempting to get the data in a poor way or am I using the wrong event all together.
Its probably just me but I've tried for a few hours to get the data out...  If more details or source code is needed please let me know.
Thanks for your time.
Parents
  • 23930
    Verified Answer
    Offline posted

    Hi Adam,

    Thank you for posting in our forums.

    Looking at the code that you have posted you can do a small modification by using:

    clicked.Cell.Row

    instead of:

    ultraGrid1.Rows[clicked.Cell.Row.Index]

    This will make sure that you are getting the correct row as if you are getting a row from a child band, you won’t be able to access it directly through the Rows collection of the grid.

     What is the exception that you are getting? Please provide us with the stack trace for the exception and possibly with a small sample that reproduces this issue.

    I am looking forward to hearing from you.

Reply Children