So I have a grid where a few columns have been used to group, I was trying to use
ultraGrid1.Selected.Rows[0].Cells["Name of Column"].Value
to get the value that is being grouped but it just says null
Hello,
I just cheking the progress of this issue. please let meknow if you nedd may further assitanse on this.
Hello ,
I am not sure that I understand your requirement, so I have created a small sample where I have a grid with 4 column, and the grid is grouped by 3 of the columns. Please run the sample, you will see that “Column 3: Col3 item 2(1Item)” is selected, so what you would like to happen when you press button1?
I am waiting for your response.
that worked well, but I was hoping there would be a way to get all the columns that were grouped in one row. For example if I have 3 columns grouped and I was looking for the value in one specific column I would have to traverse through the grouped columns
if (ultraGrid1.Selected.Rows[0].IsGroupByRow){ if (((UltraGridGroupByRow)ultraGrid1.Selected.Rows[0]).Column.Key.ToString() == colName) cell = ((UltraGridGroupByRow) ultraGrid1.Selected.Rows[0]).Value.ToString(); else { if (ultraGrid1.Selected.Rows[0].HasParent() && ((UltraGridGroupByRow)ultraGrid1.Selected.Rows[0]).ParentRow.IsGroupByRow) { if (((UltraGridGroupByRow) ultraGrid1.Selected.Rows[0].ParentRow).Column.Key == colName) cell = ((UltraGridGroupByRow)ultraGrid1.Selected.Rows[0].ParentRow).Value.ToString(); else { if (ultraGrid1.Selected.Rows[0].ParentRow.HasParent() && ((UltraGridGroupByRow)ultraGrid1.Selected.Rows[0]).ParentRow.ParentRow.IsGroupByRow) { if (((UltraGridGroupByRow)ultraGrid1.Selected.Rows[0].ParentRow.ParentRow).Column.Key == colName) cell = ((UltraGridGroupByRow)ultraGrid1.Selected.Rows[0].ParentRow.ParentRow).Value.ToString(); } } } } }
Hi,
I just wanted to know if you were able to solve your issue based on my suggestions or you still need help?
Just let me know.
Thank you.
As far as I understand from your post, you want to get the value from grouped row , which is displayed in group by box. To do this you should use code like:
if (ultraGrid1.Selected.Rows[0].IsGroupByRow)
{
MessageBox.Show(string.Format("Value for row 0 is {0}", ((UltraGridGroupByRow)ultraGrid1.Selected.Rows[0]).Value));
}
Please let me know if you have any further questions or I am missing something.